id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
21,900
RoaringBitmap/RoaringBitmap
roaringbitmap/src/main/java/org/roaringbitmap/RoaringBitmap.java
RoaringBitmap.select
@Override public int select(int j) { long leftover = Util.toUnsignedLong(j); for (int i = 0; i < this.highLowContainer.size(); i++) { Container c = this.highLowContainer.getContainerAtIndex(i); int thiscard = c.getCardinality(); if (thiscard > leftover) { int keycontrib = this.highLo...
java
@Override public int select(int j) { long leftover = Util.toUnsignedLong(j); for (int i = 0; i < this.highLowContainer.size(); i++) { Container c = this.highLowContainer.getContainerAtIndex(i); int thiscard = c.getCardinality(); if (thiscard > leftover) { int keycontrib = this.highLo...
[ "@", "Override", "public", "int", "select", "(", "int", "j", ")", "{", "long", "leftover", "=", "Util", ".", "toUnsignedLong", "(", "j", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "highLowContainer", ".", "size", "(", ...
Return the jth value stored in this bitmap. The provided value needs to be smaller than the cardinality otherwise an IllegalArgumentException exception is thrown. @param j index of the value @return the value @see <a href="https://en.wikipedia.org/wiki/Selection_algorithm">Selection algorithm</a>
[ "Return", "the", "jth", "value", "stored", "in", "this", "bitmap", ".", "The", "provided", "value", "needs", "to", "be", "smaller", "than", "the", "cardinality", "otherwise", "an", "IllegalArgumentException", "exception", "is", "thrown", "." ]
b26fd0a1330fd4d2877f4d74feb69ceb812e9efa
https://github.com/RoaringBitmap/RoaringBitmap/blob/b26fd0a1330fd4d2877f4d74feb69ceb812e9efa/roaringbitmap/src/main/java/org/roaringbitmap/RoaringBitmap.java#L2326-L2342
21,901
RoaringBitmap/RoaringBitmap
roaringbitmap/src/main/java/org/roaringbitmap/RoaringBitmap.java
RoaringBitmap.maximumSerializedSize
public static long maximumSerializedSize(long cardinality, long universe_size) { long contnbr = (universe_size + 65535) / 65536; if (contnbr > cardinality) { contnbr = cardinality; // we can't have more containers than we have values } final long headermax = Math.max(8, 4 + (contnbr + 7) / 8...
java
public static long maximumSerializedSize(long cardinality, long universe_size) { long contnbr = (universe_size + 65535) / 65536; if (contnbr > cardinality) { contnbr = cardinality; // we can't have more containers than we have values } final long headermax = Math.max(8, 4 + (contnbr + 7) / 8...
[ "public", "static", "long", "maximumSerializedSize", "(", "long", "cardinality", ",", "long", "universe_size", ")", "{", "long", "contnbr", "=", "(", "universe_size", "+", "65535", ")", "/", "65536", ";", "if", "(", "contnbr", ">", "cardinality", ")", "{", ...
Assume that one wants to store "cardinality" integers in [0, universe_size), this function returns an upper bound on the serialized size in bytes. @param cardinality maximal cardinality @param universe_size maximal value @return upper bound on the serialized size in bytes of the bitmap
[ "Assume", "that", "one", "wants", "to", "store", "cardinality", "integers", "in", "[", "0", "universe_size", ")", "this", "function", "returns", "an", "upper", "bound", "on", "the", "serialized", "size", "in", "bytes", "." ]
b26fd0a1330fd4d2877f4d74feb69ceb812e9efa
https://github.com/RoaringBitmap/RoaringBitmap/blob/b26fd0a1330fd4d2877f4d74feb69ceb812e9efa/roaringbitmap/src/main/java/org/roaringbitmap/RoaringBitmap.java#L2532-L2543
21,902
RoaringBitmap/RoaringBitmap
roaringbitmap/src/main/java/org/roaringbitmap/RoaringBitmap.java
RoaringBitmap.selectRangeWithoutCopy
private static RoaringBitmap selectRangeWithoutCopy(RoaringBitmap rb, final long rangeStart, final long rangeEnd) { final int hbStart = Util.toIntUnsigned(Util.highbits(rangeStart)); final int lbStart = Util.toIntUnsigned(Util.lowbits(rangeStart)); final int hbLast = Util.toIntUnsigned(Util.highbits(r...
java
private static RoaringBitmap selectRangeWithoutCopy(RoaringBitmap rb, final long rangeStart, final long rangeEnd) { final int hbStart = Util.toIntUnsigned(Util.highbits(rangeStart)); final int lbStart = Util.toIntUnsigned(Util.lowbits(rangeStart)); final int hbLast = Util.toIntUnsigned(Util.highbits(r...
[ "private", "static", "RoaringBitmap", "selectRangeWithoutCopy", "(", "RoaringBitmap", "rb", ",", "final", "long", "rangeStart", ",", "final", "long", "rangeEnd", ")", "{", "final", "int", "hbStart", "=", "Util", ".", "toIntUnsigned", "(", "Util", ".", "highbits"...
had formerly failed if rangeEnd==0
[ "had", "formerly", "failed", "if", "rangeEnd", "==", "0" ]
b26fd0a1330fd4d2877f4d74feb69ceb812e9efa
https://github.com/RoaringBitmap/RoaringBitmap/blob/b26fd0a1330fd4d2877f4d74feb69ceb812e9efa/roaringbitmap/src/main/java/org/roaringbitmap/RoaringBitmap.java#L2602-L2656
21,903
RoaringBitmap/RoaringBitmap
roaringbitmap/src/main/java/org/roaringbitmap/RoaringBitmap.java
RoaringBitmap.toArray
@Override public int[] toArray() { final int[] array = new int[this.getCardinality()]; int pos = 0, pos2 = 0; while (pos < this.highLowContainer.size()) { final int hs = this.highLowContainer.getKeyAtIndex(pos) << 16; Container c = this.highLowContainer.getContainerAtIndex(pos++); c.fill...
java
@Override public int[] toArray() { final int[] array = new int[this.getCardinality()]; int pos = 0, pos2 = 0; while (pos < this.highLowContainer.size()) { final int hs = this.highLowContainer.getKeyAtIndex(pos) << 16; Container c = this.highLowContainer.getContainerAtIndex(pos++); c.fill...
[ "@", "Override", "public", "int", "[", "]", "toArray", "(", ")", "{", "final", "int", "[", "]", "array", "=", "new", "int", "[", "this", ".", "getCardinality", "(", ")", "]", ";", "int", "pos", "=", "0", ",", "pos2", "=", "0", ";", "while", "("...
Return the set values as an array, if the cardinality is smaller than 2147483648. The integer values are in sorted order. @return array representing the set values.
[ "Return", "the", "set", "values", "as", "an", "array", "if", "the", "cardinality", "is", "smaller", "than", "2147483648", ".", "The", "integer", "values", "are", "in", "sorted", "order", "." ]
b26fd0a1330fd4d2877f4d74feb69ceb812e9efa
https://github.com/RoaringBitmap/RoaringBitmap/blob/b26fd0a1330fd4d2877f4d74feb69ceb812e9efa/roaringbitmap/src/main/java/org/roaringbitmap/RoaringBitmap.java#L2665-L2676
21,904
RoaringBitmap/RoaringBitmap
roaringbitmap/src/main/java/org/roaringbitmap/buffer/BufferFastAggregation.java
BufferFastAggregation.convertToImmutable
public static Iterator<ImmutableRoaringBitmap> convertToImmutable( final Iterator<MutableRoaringBitmap> i) { return new Iterator<ImmutableRoaringBitmap>() { @Override public boolean hasNext() { return i.hasNext(); } @Override public ImmutableRoaringBitmap next() { ...
java
public static Iterator<ImmutableRoaringBitmap> convertToImmutable( final Iterator<MutableRoaringBitmap> i) { return new Iterator<ImmutableRoaringBitmap>() { @Override public boolean hasNext() { return i.hasNext(); } @Override public ImmutableRoaringBitmap next() { ...
[ "public", "static", "Iterator", "<", "ImmutableRoaringBitmap", ">", "convertToImmutable", "(", "final", "Iterator", "<", "MutableRoaringBitmap", ">", "i", ")", "{", "return", "new", "Iterator", "<", "ImmutableRoaringBitmap", ">", "(", ")", "{", "@", "Override", ...
Convenience method converting one type of iterator into another, to avoid unnecessary warnings. @param i input bitmaps @return an iterator over the provided iterator, with a different type
[ "Convenience", "method", "converting", "one", "type", "of", "iterator", "into", "another", "to", "avoid", "unnecessary", "warnings", "." ]
b26fd0a1330fd4d2877f4d74feb69ceb812e9efa
https://github.com/RoaringBitmap/RoaringBitmap/blob/b26fd0a1330fd4d2877f4d74feb69ceb812e9efa/roaringbitmap/src/main/java/org/roaringbitmap/buffer/BufferFastAggregation.java#L68-L87
21,905
authorjapps/zerocode
core/src/main/java/org/jsmart/zerocode/core/httpclient/BasicHttpClient.java
BasicHttpClient.execute
public Response execute(String httpUrl, String methodName, Map<String, Object> headers, Map<String, Object> queryParams, Object body) throws Exception { httpclient = createHttpClient(); // -...
java
public Response execute(String httpUrl, String methodName, Map<String, Object> headers, Map<String, Object> queryParams, Object body) throws Exception { httpclient = createHttpClient(); // -...
[ "public", "Response", "execute", "(", "String", "httpUrl", ",", "String", "methodName", ",", "Map", "<", "String", ",", "Object", ">", "headers", ",", "Map", "<", "String", ",", "Object", ">", "queryParams", ",", "Object", "body", ")", "throws", "Exception...
Override this method in case you want to execute the http call differently via your http client. Otherwise the framework falls back to this implementation by default. @param httpUrl : path to end point @param methodName : e.g. GET, PUT etc @param headers : headers, cookies etc @param queryParams : key-value q...
[ "Override", "this", "method", "in", "case", "you", "want", "to", "execute", "the", "http", "call", "differently", "via", "your", "http", "client", ".", "Otherwise", "the", "framework", "falls", "back", "to", "this", "implementation", "by", "default", "." ]
d66a3e8778d2eb5e4f0006bfcccfc0922ceb7cef
https://github.com/authorjapps/zerocode/blob/d66a3e8778d2eb5e4f0006bfcccfc0922ceb7cef/core/src/main/java/org/jsmart/zerocode/core/httpclient/BasicHttpClient.java#L108-L144
21,906
authorjapps/zerocode
core/src/main/java/org/jsmart/zerocode/core/httpclient/BasicHttpClient.java
BasicHttpClient.handleResponse
public Response handleResponse(CloseableHttpResponse httpResponse) throws IOException { Response serverResponse = createCharsetResponse(httpResponse); Header[] allHeaders = httpResponse.getAllHeaders(); Response.ResponseBuilder responseBuilder = Response.fromResponse(serverResponse); fo...
java
public Response handleResponse(CloseableHttpResponse httpResponse) throws IOException { Response serverResponse = createCharsetResponse(httpResponse); Header[] allHeaders = httpResponse.getAllHeaders(); Response.ResponseBuilder responseBuilder = Response.fromResponse(serverResponse); fo...
[ "public", "Response", "handleResponse", "(", "CloseableHttpResponse", "httpResponse", ")", "throws", "IOException", "{", "Response", "serverResponse", "=", "createCharsetResponse", "(", "httpResponse", ")", ";", "Header", "[", "]", "allHeaders", "=", "httpResponse", "...
Once the client executes the http call, then it receives the http response. This method takes care of handling that. In case you need to handle it differently you can override this method. @param httpResponse : Received Apache http response from the server @return : Effective response with handled http session. @th...
[ "Once", "the", "client", "executes", "the", "http", "call", "then", "it", "receives", "the", "http", "response", ".", "This", "method", "takes", "care", "of", "handling", "that", ".", "In", "case", "you", "need", "to", "handle", "it", "differently", "you",...
d66a3e8778d2eb5e4f0006bfcccfc0922ceb7cef
https://github.com/authorjapps/zerocode/blob/d66a3e8778d2eb5e4f0006bfcccfc0922ceb7cef/core/src/main/java/org/jsmart/zerocode/core/httpclient/BasicHttpClient.java#L155-L168
21,907
authorjapps/zerocode
core/src/main/java/org/jsmart/zerocode/core/httpclient/BasicHttpClient.java
BasicHttpClient.createDefaultRequestBuilder
public RequestBuilder createDefaultRequestBuilder(String httpUrl, String methodName, String reqBodyAsString) { RequestBuilder requestBuilder = RequestBuilder .create(methodName) .setUri(httpUrl); if (reqBodyAsString != null) { HttpEntity httpEntity = EntityBu...
java
public RequestBuilder createDefaultRequestBuilder(String httpUrl, String methodName, String reqBodyAsString) { RequestBuilder requestBuilder = RequestBuilder .create(methodName) .setUri(httpUrl); if (reqBodyAsString != null) { HttpEntity httpEntity = EntityBu...
[ "public", "RequestBuilder", "createDefaultRequestBuilder", "(", "String", "httpUrl", ",", "String", "methodName", ",", "String", "reqBodyAsString", ")", "{", "RequestBuilder", "requestBuilder", "=", "RequestBuilder", ".", "create", "(", "methodName", ")", ".", "setUri...
This is the usual http request builder most widely used using Apache Http Client. In case you want to build or prepare the requests differently, you can override this method. Please see the following request builder to handle file uploads. - BasicHttpClient#createFileUploadRequestBuilder(java.lang.String, java.lang.St...
[ "This", "is", "the", "usual", "http", "request", "builder", "most", "widely", "used", "using", "Apache", "Http", "Client", ".", "In", "case", "you", "want", "to", "build", "or", "prepare", "the", "requests", "differently", "you", "can", "override", "this", ...
d66a3e8778d2eb5e4f0006bfcccfc0922ceb7cef
https://github.com/authorjapps/zerocode/blob/d66a3e8778d2eb5e4f0006bfcccfc0922ceb7cef/core/src/main/java/org/jsmart/zerocode/core/httpclient/BasicHttpClient.java#L279-L292
21,908
authorjapps/zerocode
core/src/main/java/org/jsmart/zerocode/core/httpclient/BasicHttpClient.java
BasicHttpClient.createFileUploadRequestBuilder
public RequestBuilder createFileUploadRequestBuilder(String httpUrl, String methodName, String reqBodyAsString) throws IOException { Map<String, Object> fileFieldNameValueMap = getFileFieldNameValue(reqBodyAsString); List<String> fileFieldsList = (List<String>) fileFieldNameValueMap.get(FILES_FIELD); ...
java
public RequestBuilder createFileUploadRequestBuilder(String httpUrl, String methodName, String reqBodyAsString) throws IOException { Map<String, Object> fileFieldNameValueMap = getFileFieldNameValue(reqBodyAsString); List<String> fileFieldsList = (List<String>) fileFieldNameValueMap.get(FILES_FIELD); ...
[ "public", "RequestBuilder", "createFileUploadRequestBuilder", "(", "String", "httpUrl", ",", "String", "methodName", ",", "String", "reqBodyAsString", ")", "throws", "IOException", "{", "Map", "<", "String", ",", "Object", ">", "fileFieldNameValueMap", "=", "getFileFi...
This is the http request builder for file uploads, using Apache Http Client. In case you want to build or prepare the requests differently, you can override this method. Note- With file uploads you can send more headers too from the testcase to the server, except "Content-Type" because this is reserved for "multipart/...
[ "This", "is", "the", "http", "request", "builder", "for", "file", "uploads", "using", "Apache", "Http", "Client", ".", "In", "case", "you", "want", "to", "build", "or", "prepare", "the", "requests", "differently", "you", "can", "override", "this", "method", ...
d66a3e8778d2eb5e4f0006bfcccfc0922ceb7cef
https://github.com/authorjapps/zerocode/blob/d66a3e8778d2eb5e4f0006bfcccfc0922ceb7cef/core/src/main/java/org/jsmart/zerocode/core/httpclient/BasicHttpClient.java#L340-L361
21,909
authorjapps/zerocode
core/src/main/java/org/jsmart/zerocode/core/httpclient/BasicHttpClient.java
BasicHttpClient.handleHttpSession
public void handleHttpSession(Response serverResponse, String headerKey) { /** --------------- * Session handled * ---------------- */ if ("Set-Cookie".equals(headerKey)) { COOKIE_JSESSIONID_VALUE = serverResponse.getMetadata().get(headerKey); } }
java
public void handleHttpSession(Response serverResponse, String headerKey) { /** --------------- * Session handled * ---------------- */ if ("Set-Cookie".equals(headerKey)) { COOKIE_JSESSIONID_VALUE = serverResponse.getMetadata().get(headerKey); } }
[ "public", "void", "handleHttpSession", "(", "Response", "serverResponse", ",", "String", "headerKey", ")", "{", "/** ---------------\n * Session handled\n * ----------------\n */", "if", "(", "\"Set-Cookie\"", ".", "equals", "(", "headerKey", ")", ")",...
This method handles the http session to be maintained between the calls. In case the session is not needed or to be handled differently, then this method can be overridden to do nothing or to roll your own feature. @param serverResponse @param headerKey
[ "This", "method", "handles", "the", "http", "session", "to", "be", "maintained", "between", "the", "calls", ".", "In", "case", "the", "session", "is", "not", "needed", "or", "to", "be", "handled", "differently", "then", "this", "method", "can", "be", "over...
d66a3e8778d2eb5e4f0006bfcccfc0922ceb7cef
https://github.com/authorjapps/zerocode/blob/d66a3e8778d2eb5e4f0006bfcccfc0922ceb7cef/core/src/main/java/org/jsmart/zerocode/core/httpclient/BasicHttpClient.java#L371-L379
21,910
authorjapps/zerocode
core/src/main/java/org/jsmart/zerocode/core/engine/preprocessor/ZeroCodeExternalFileProcessorImpl.java
ZeroCodeExternalFileProcessorImpl.digReplaceContent
void digReplaceContent(Map<String, Object> map) { map.entrySet().stream().forEach(entry -> { Object value = entry.getValue(); if (value instanceof Map) { digReplaceContent((Map<String, Object>) value); } else { LOGGER.debug("Leaf node found...
java
void digReplaceContent(Map<String, Object> map) { map.entrySet().stream().forEach(entry -> { Object value = entry.getValue(); if (value instanceof Map) { digReplaceContent((Map<String, Object>) value); } else { LOGGER.debug("Leaf node found...
[ "void", "digReplaceContent", "(", "Map", "<", "String", ",", "Object", ">", "map", ")", "{", "map", ".", "entrySet", "(", ")", ".", "stream", "(", ")", ".", "forEach", "(", "entry", "->", "{", "Object", "value", "=", "entry", ".", "getValue", "(", ...
Digs deep into the nested map and looks for external file reference,if found, replaces the place holder with the file content. This is handy when the engineers wants to drive the common contents from a central place. @param map A map representing the key-value pairs, can be nested
[ "Digs", "deep", "into", "the", "nested", "map", "and", "looks", "for", "external", "file", "reference", "if", "found", "replaces", "the", "place", "holder", "with", "the", "file", "content", ".", "This", "is", "handy", "when", "the", "engineers", "wants", ...
d66a3e8778d2eb5e4f0006bfcccfc0922ceb7cef
https://github.com/authorjapps/zerocode/blob/d66a3e8778d2eb5e4f0006bfcccfc0922ceb7cef/core/src/main/java/org/jsmart/zerocode/core/engine/preprocessor/ZeroCodeExternalFileProcessorImpl.java#L113-L159
21,911
authorjapps/zerocode
core/src/main/java/org/jsmart/zerocode/core/runner/ZeroCodePackageRunner.java
ZeroCodePackageRunner.getChildren
@Override protected List<ScenarioSpec> getChildren() { TestPackageRoot rootPackageAnnotation = testClass.getAnnotation(TestPackageRoot.class); JsonTestCases jsonTestCasesAnnotation = testClass.getAnnotation(JsonTestCases.class); validateSuiteAnnotationPresent(rootPackageAnnotation, jsonTestC...
java
@Override protected List<ScenarioSpec> getChildren() { TestPackageRoot rootPackageAnnotation = testClass.getAnnotation(TestPackageRoot.class); JsonTestCases jsonTestCasesAnnotation = testClass.getAnnotation(JsonTestCases.class); validateSuiteAnnotationPresent(rootPackageAnnotation, jsonTestC...
[ "@", "Override", "protected", "List", "<", "ScenarioSpec", ">", "getChildren", "(", ")", "{", "TestPackageRoot", "rootPackageAnnotation", "=", "testClass", ".", "getAnnotation", "(", "TestPackageRoot", ".", "class", ")", ";", "JsonTestCases", "jsonTestCasesAnnotation"...
Returns a list of objects that define the children of this Runner.
[ "Returns", "a", "list", "of", "objects", "that", "define", "the", "children", "of", "this", "Runner", "." ]
d66a3e8778d2eb5e4f0006bfcccfc0922ceb7cef
https://github.com/authorjapps/zerocode/blob/d66a3e8778d2eb5e4f0006bfcccfc0922ceb7cef/core/src/main/java/org/jsmart/zerocode/core/runner/ZeroCodePackageRunner.java#L75-L105
21,912
authorjapps/zerocode
core/src/main/java/org/jsmart/zerocode/core/runner/StepNotificationHandler.java
StepNotificationHandler.maxEntryLengthOf
private int maxEntryLengthOf(List<AssertionReport> failureReportList) { final Integer maxLength = ofNullable(failureReportList).orElse(Collections.emptyList()).stream() .map(report -> report.toString().length()) .max(Comparator.naturalOrder()) ...
java
private int maxEntryLengthOf(List<AssertionReport> failureReportList) { final Integer maxLength = ofNullable(failureReportList).orElse(Collections.emptyList()).stream() .map(report -> report.toString().length()) .max(Comparator.naturalOrder()) ...
[ "private", "int", "maxEntryLengthOf", "(", "List", "<", "AssertionReport", ">", "failureReportList", ")", "{", "final", "Integer", "maxLength", "=", "ofNullable", "(", "failureReportList", ")", ".", "orElse", "(", "Collections", ".", "emptyList", "(", ")", ")", ...
all private functions below
[ "all", "private", "functions", "below" ]
d66a3e8778d2eb5e4f0006bfcccfc0922ceb7cef
https://github.com/authorjapps/zerocode/blob/d66a3e8778d2eb5e4f0006bfcccfc0922ceb7cef/core/src/main/java/org/jsmart/zerocode/core/runner/StepNotificationHandler.java#L80-L87
21,913
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/Tesseract1.java
Tesseract1.setHocr
public void setHocr(boolean hocr) { this.renderedFormat = hocr ? RenderedFormat.HOCR : RenderedFormat.TEXT; prop.setProperty("tessedit_create_hocr", hocr ? "1" : "0"); }
java
public void setHocr(boolean hocr) { this.renderedFormat = hocr ? RenderedFormat.HOCR : RenderedFormat.TEXT; prop.setProperty("tessedit_create_hocr", hocr ? "1" : "0"); }
[ "public", "void", "setHocr", "(", "boolean", "hocr", ")", "{", "this", ".", "renderedFormat", "=", "hocr", "?", "RenderedFormat", ".", "HOCR", ":", "RenderedFormat", ".", "TEXT", ";", "prop", ".", "setProperty", "(", "\"tessedit_create_hocr\"", ",", "hocr", ...
Enables hocr output. @param hocr to enable or disable hocr output
[ "Enables", "hocr", "output", "." ]
cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/Tesseract1.java#L135-L138
21,914
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/Tesseract1.java
Tesseract1.setTessVariable
@Override public void setTessVariable(String key, String value) { prop.setProperty(key, value); }
java
@Override public void setTessVariable(String key, String value) { prop.setProperty(key, value); }
[ "@", "Override", "public", "void", "setTessVariable", "(", "String", "key", ",", "String", "value", ")", "{", "prop", ".", "setProperty", "(", "key", ",", "value", ")", ";", "}" ]
Set the value of Tesseract's internal parameter. @param key variable name, e.g., <code>tessedit_create_hocr</code>, <code>tessedit_char_whitelist</code>, etc. @param value value for corresponding variable, e.g., "1", "0", "0123456789", etc.
[ "Set", "the", "value", "of", "Tesseract", "s", "internal", "parameter", "." ]
cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/Tesseract1.java#L148-L151
21,915
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/Tesseract1.java
Tesseract1.init
protected void init() { handle = TessBaseAPICreate(); StringArray sarray = new StringArray(configList.toArray(new String[0])); PointerByReference configs = new PointerByReference(); configs.setPointer(sarray); TessBaseAPIInit1(handle, datapath, language, ocrEngineMode, configs, c...
java
protected void init() { handle = TessBaseAPICreate(); StringArray sarray = new StringArray(configList.toArray(new String[0])); PointerByReference configs = new PointerByReference(); configs.setPointer(sarray); TessBaseAPIInit1(handle, datapath, language, ocrEngineMode, configs, c...
[ "protected", "void", "init", "(", ")", "{", "handle", "=", "TessBaseAPICreate", "(", ")", ";", "StringArray", "sarray", "=", "new", "StringArray", "(", "configList", ".", "toArray", "(", "new", "String", "[", "0", "]", ")", ")", ";", "PointerByReference", ...
Initializes Tesseract engine.
[ "Initializes", "Tesseract", "engine", "." ]
cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/Tesseract1.java#L406-L415
21,916
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/Tesseract1.java
Tesseract1.setTessVariables
protected void setTessVariables() { Enumeration<?> em = prop.propertyNames(); while (em.hasMoreElements()) { String key = (String) em.nextElement(); TessBaseAPISetVariable(handle, key, prop.getProperty(key)); } }
java
protected void setTessVariables() { Enumeration<?> em = prop.propertyNames(); while (em.hasMoreElements()) { String key = (String) em.nextElement(); TessBaseAPISetVariable(handle, key, prop.getProperty(key)); } }
[ "protected", "void", "setTessVariables", "(", ")", "{", "Enumeration", "<", "?", ">", "em", "=", "prop", ".", "propertyNames", "(", ")", ";", "while", "(", "em", ".", "hasMoreElements", "(", ")", ")", "{", "String", "key", "=", "(", "String", ")", "e...
Sets Tesseract's internal parameters.
[ "Sets", "Tesseract", "s", "internal", "parameters", "." ]
cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/Tesseract1.java#L420-L426
21,917
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/Tesseract1.java
Tesseract1.createDocuments
@Override public void createDocuments(String filename, String outputbase, List<RenderedFormat> formats) throws TesseractException { createDocuments(new String[]{filename}, new String[]{outputbase}, formats); }
java
@Override public void createDocuments(String filename, String outputbase, List<RenderedFormat> formats) throws TesseractException { createDocuments(new String[]{filename}, new String[]{outputbase}, formats); }
[ "@", "Override", "public", "void", "createDocuments", "(", "String", "filename", ",", "String", "outputbase", ",", "List", "<", "RenderedFormat", ">", "formats", ")", "throws", "TesseractException", "{", "createDocuments", "(", "new", "String", "[", "]", "{", ...
Creates documents for given renderer. @param filename input image @param outputbase output filename without extension @param formats types of renderer @throws TesseractException
[ "Creates", "documents", "for", "given", "renderer", "." ]
cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/Tesseract1.java#L579-L582
21,918
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/Tesseract1.java
Tesseract1.getSegmentedRegions
@Override public List<Rectangle> getSegmentedRegions(BufferedImage bi, int pageIteratorLevel) throws TesseractException { init(); setTessVariables(); try { List<Rectangle> list = new ArrayList<Rectangle>(); setImage(bi, null); Boxa boxes = TessBaseAPIGet...
java
@Override public List<Rectangle> getSegmentedRegions(BufferedImage bi, int pageIteratorLevel) throws TesseractException { init(); setTessVariables(); try { List<Rectangle> list = new ArrayList<Rectangle>(); setImage(bi, null); Boxa boxes = TessBaseAPIGet...
[ "@", "Override", "public", "List", "<", "Rectangle", ">", "getSegmentedRegions", "(", "BufferedImage", "bi", ",", "int", "pageIteratorLevel", ")", "throws", "TesseractException", "{", "init", "(", ")", ";", "setTessVariables", "(", ")", ";", "try", "{", "List"...
Gets segmented regions at specified page iterator level. @param bi input image @param pageIteratorLevel TessPageIteratorLevel enum @return list of <code>Rectangle</code> @throws TesseractException
[ "Gets", "segmented", "regions", "at", "specified", "page", "iterator", "level", "." ]
cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/Tesseract1.java#L654-L688
21,919
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/Tesseract1.java
Tesseract1.createDocumentsWithResults
@Override public List<OCRResult> createDocumentsWithResults(String[] filenames, String[] outputbases, List<ITesseract.RenderedFormat> formats, int pageIteratorLevel) throws TesseractException { if (filenames.length != outputbases.length) { throw new RuntimeException("The two arrays must match in...
java
@Override public List<OCRResult> createDocumentsWithResults(String[] filenames, String[] outputbases, List<ITesseract.RenderedFormat> formats, int pageIteratorLevel) throws TesseractException { if (filenames.length != outputbases.length) { throw new RuntimeException("The two arrays must match in...
[ "@", "Override", "public", "List", "<", "OCRResult", ">", "createDocumentsWithResults", "(", "String", "[", "]", "filenames", ",", "String", "[", "]", "outputbases", ",", "List", "<", "ITesseract", ".", "RenderedFormat", ">", "formats", ",", "int", "pageIterat...
Creates documents with OCR results for given renderers at specified page iterator level. @param filenames array of input files @param outputbases array of output filenames without extension @param formats types of renderer @return OCR results @throws TesseractException
[ "Creates", "documents", "with", "OCR", "results", "for", "given", "renderers", "at", "specified", "page", "iterator", "level", "." ]
cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/Tesseract1.java#L747-L787
21,920
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/util/LoadLibs.java
LoadLibs.extractTessResources
public static synchronized File extractTessResources(String resourceName) { File targetPath = null; try { targetPath = new File(TESS4J_TEMP_DIR, resourceName); Enumeration<URL> resources = LoadLibs.class.getClassLoader().getResources(resourceName); while (resources....
java
public static synchronized File extractTessResources(String resourceName) { File targetPath = null; try { targetPath = new File(TESS4J_TEMP_DIR, resourceName); Enumeration<URL> resources = LoadLibs.class.getClassLoader().getResources(resourceName); while (resources....
[ "public", "static", "synchronized", "File", "extractTessResources", "(", "String", "resourceName", ")", "{", "File", "targetPath", "=", "null", ";", "try", "{", "targetPath", "=", "new", "File", "(", "TESS4J_TEMP_DIR", ",", "resourceName", ")", ";", "Enumeration...
Extracts tesseract resources to temp folder. @param resourceName name of file or directory @return target path, which could be file or directory
[ "Extracts", "tesseract", "resources", "to", "temp", "folder", "." ]
cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/util/LoadLibs.java#L104-L120
21,921
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/util/LoadLibs.java
LoadLibs.copyResources
static void copyResources(URL resourceUrl, File targetPath) throws IOException, URISyntaxException { if (resourceUrl == null) { return; } URLConnection urlConnection = resourceUrl.openConnection(); /** * Copy resources either from inside jar or from project folder....
java
static void copyResources(URL resourceUrl, File targetPath) throws IOException, URISyntaxException { if (resourceUrl == null) { return; } URLConnection urlConnection = resourceUrl.openConnection(); /** * Copy resources either from inside jar or from project folder....
[ "static", "void", "copyResources", "(", "URL", "resourceUrl", ",", "File", "targetPath", ")", "throws", "IOException", ",", "URISyntaxException", "{", "if", "(", "resourceUrl", "==", "null", ")", "{", "return", ";", "}", "URLConnection", "urlConnection", "=", ...
Copies resources to target folder. @param resourceUrl @param targetPath @return
[ "Copies", "resources", "to", "target", "folder", "." ]
cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/util/LoadLibs.java#L129-L162
21,922
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/util/LoadLibs.java
LoadLibs.copyJarResourceToPath
static void copyJarResourceToPath(JarURLConnection jarConnection, File destPath) { try (JarFile jarFile = jarConnection.getJarFile()) { String jarConnectionEntryName = jarConnection.getEntryName(); if (!jarConnectionEntryName.endsWith("/")) { jarConnectionEntryName += "/"...
java
static void copyJarResourceToPath(JarURLConnection jarConnection, File destPath) { try (JarFile jarFile = jarConnection.getJarFile()) { String jarConnectionEntryName = jarConnection.getEntryName(); if (!jarConnectionEntryName.endsWith("/")) { jarConnectionEntryName += "/"...
[ "static", "void", "copyJarResourceToPath", "(", "JarURLConnection", "jarConnection", ",", "File", "destPath", ")", "{", "try", "(", "JarFile", "jarFile", "=", "jarConnection", ".", "getJarFile", "(", ")", ")", "{", "String", "jarConnectionEntryName", "=", "jarConn...
Copies resources from the jar file of the current thread and extract it to the destination path. @param jarConnection @param destPath destination file or directory
[ "Copies", "resources", "from", "the", "jar", "file", "of", "the", "current", "thread", "and", "extract", "it", "to", "the", "destination", "path", "." ]
cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/util/LoadLibs.java#L171-L207
21,923
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/util/LoadLibs.java
LoadLibs.copyFromWarToFolder
static void copyFromWarToFolder(VirtualFile virtualFileOrFolder, File targetFolder) throws IOException { if (virtualFileOrFolder.isDirectory() && !virtualFileOrFolder.getName().contains(".")) { if (targetFolder.getName().equalsIgnoreCase(virtualFileOrFolder.getName())) { for (Virtual...
java
static void copyFromWarToFolder(VirtualFile virtualFileOrFolder, File targetFolder) throws IOException { if (virtualFileOrFolder.isDirectory() && !virtualFileOrFolder.getName().contains(".")) { if (targetFolder.getName().equalsIgnoreCase(virtualFileOrFolder.getName())) { for (Virtual...
[ "static", "void", "copyFromWarToFolder", "(", "VirtualFile", "virtualFileOrFolder", ",", "File", "targetFolder", ")", "throws", "IOException", "{", "if", "(", "virtualFileOrFolder", ".", "isDirectory", "(", ")", "&&", "!", "virtualFileOrFolder", ".", "getName", "(",...
Copies resources from WAR to target folder. @param virtualFileOrFolder @param targetFolder @throws IOException
[ "Copies", "resources", "from", "WAR", "to", "target", "folder", "." ]
cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/util/LoadLibs.java#L216-L235
21,924
nguyenq/tess4j
src/main/java/com/recognition/software/jdeskew/ImageDeskew.java
ImageDeskew.getSkewAngle
public double getSkewAngle() { ImageDeskew.HoughLine[] hl; double sum = 0.0; int count = 0; // perform Hough Transformation calc(); // top 20 of the detected lines in the image hl = getTop(20); if (hl.length >= 20) { // average angle of the l...
java
public double getSkewAngle() { ImageDeskew.HoughLine[] hl; double sum = 0.0; int count = 0; // perform Hough Transformation calc(); // top 20 of the detected lines in the image hl = getTop(20); if (hl.length >= 20) { // average angle of the l...
[ "public", "double", "getSkewAngle", "(", ")", "{", "ImageDeskew", ".", "HoughLine", "[", "]", "hl", ";", "double", "sum", "=", "0.0", ";", "int", "count", "=", "0", ";", "// perform Hough Transformation", "calc", "(", ")", ";", "// top 20 of the detected lines...
Calculates the skew angle of the image cImage. @return
[ "Calculates", "the", "skew", "angle", "of", "the", "image", "cImage", "." ]
cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/com/recognition/software/jdeskew/ImageDeskew.java#L60-L80
21,925
nguyenq/tess4j
src/main/java/com/recognition/software/jdeskew/ImageDeskew.java
ImageDeskew.getTop
private ImageDeskew.HoughLine[] getTop(int count) { ImageDeskew.HoughLine[] hl = new ImageDeskew.HoughLine[count]; for (int i = 0; i < count; i++) { hl[i] = new ImageDeskew.HoughLine(); } ImageDeskew.HoughLine tmp; for (int i = 0; i < (this.cHMatrix.length - 1); i+...
java
private ImageDeskew.HoughLine[] getTop(int count) { ImageDeskew.HoughLine[] hl = new ImageDeskew.HoughLine[count]; for (int i = 0; i < count; i++) { hl[i] = new ImageDeskew.HoughLine(); } ImageDeskew.HoughLine tmp; for (int i = 0; i < (this.cHMatrix.length - 1); i+...
[ "private", "ImageDeskew", ".", "HoughLine", "[", "]", "getTop", "(", "int", "count", ")", "{", "ImageDeskew", ".", "HoughLine", "[", "]", "hl", "=", "new", "ImageDeskew", ".", "HoughLine", "[", "count", "]", ";", "for", "(", "int", "i", "=", "0", ";"...
calculate the count lines in the image with most points
[ "calculate", "the", "count", "lines", "in", "the", "image", "with", "most", "points" ]
cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/com/recognition/software/jdeskew/ImageDeskew.java#L83-L118
21,926
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java
ImageIOHelper.setDPIViaAPI
private static IIOMetadata setDPIViaAPI(IIOMetadata imageMetadata, int dpiX, int dpiY) throws IIOInvalidTreeException { // Derive the TIFFDirectory from the metadata. TIFFDirectory dir = TIFFDirectory.createFromMetadata(imageMetadata); // Get {X,Y}Resolution tags. BaselineTI...
java
private static IIOMetadata setDPIViaAPI(IIOMetadata imageMetadata, int dpiX, int dpiY) throws IIOInvalidTreeException { // Derive the TIFFDirectory from the metadata. TIFFDirectory dir = TIFFDirectory.createFromMetadata(imageMetadata); // Get {X,Y}Resolution tags. BaselineTI...
[ "private", "static", "IIOMetadata", "setDPIViaAPI", "(", "IIOMetadata", "imageMetadata", ",", "int", "dpiX", ",", "int", "dpiY", ")", "throws", "IIOInvalidTreeException", "{", "// Derive the TIFFDirectory from the metadata.", "TIFFDirectory", "dir", "=", "TIFFDirectory", ...
Set DPI using API. @param imageMetadata original IIOMetadata @param dpiX horizontal resolution @param dpiY vertical resolution @return modified IIOMetadata @throws IIOInvalidTreeException
[ "Set", "DPI", "using", "API", "." ]
cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java#L215-L251
21,927
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java
ImageIOHelper.getImageFileFormat
public static String getImageFileFormat(File imageFile) { String imageFileName = imageFile.getName(); String imageFormat = imageFileName.substring(imageFileName.lastIndexOf('.') + 1); if (imageFormat.matches("(pbm|pgm|ppm)")) { imageFormat = "pnm"; } else if (imageFormat.matc...
java
public static String getImageFileFormat(File imageFile) { String imageFileName = imageFile.getName(); String imageFormat = imageFileName.substring(imageFileName.lastIndexOf('.') + 1); if (imageFormat.matches("(pbm|pgm|ppm)")) { imageFormat = "pnm"; } else if (imageFormat.matc...
[ "public", "static", "String", "getImageFileFormat", "(", "File", "imageFile", ")", "{", "String", "imageFileName", "=", "imageFile", ".", "getName", "(", ")", ";", "String", "imageFormat", "=", "imageFileName", ".", "substring", "(", "imageFileName", ".", "lastI...
Gets image file format. @param imageFile input image file @return image file format
[ "Gets", "image", "file", "format", "." ]
cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java#L306-L315
21,928
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java
ImageIOHelper.getImageFile
public static File getImageFile(File inputFile) throws IOException { File imageFile = inputFile; if (inputFile.getName().toLowerCase().endsWith(".pdf")) { imageFile = PdfUtilities.convertPdf2Tiff(inputFile); } return imageFile; }
java
public static File getImageFile(File inputFile) throws IOException { File imageFile = inputFile; if (inputFile.getName().toLowerCase().endsWith(".pdf")) { imageFile = PdfUtilities.convertPdf2Tiff(inputFile); } return imageFile; }
[ "public", "static", "File", "getImageFile", "(", "File", "inputFile", ")", "throws", "IOException", "{", "File", "imageFile", "=", "inputFile", ";", "if", "(", "inputFile", ".", "getName", "(", ")", ".", "toLowerCase", "(", ")", ".", "endsWith", "(", "\".p...
Gets image file. Convert to multi-page TIFF if given PDF. @param inputFile input file (common image or PDF) @return image file @throws IOException
[ "Gets", "image", "file", ".", "Convert", "to", "multi", "-", "page", "TIFF", "if", "given", "PDF", "." ]
cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java#L324-L330
21,929
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java
ImageIOHelper.deskewImage
public static File deskewImage(File imageFile, double minimumDeskewThreshold) throws IOException { List<BufferedImage> imageList = getImageList(imageFile); for (int i = 0; i < imageList.size(); i++) { BufferedImage bi = imageList.get(i); ImageDeskew deskew = new ImageDeskew(bi); ...
java
public static File deskewImage(File imageFile, double minimumDeskewThreshold) throws IOException { List<BufferedImage> imageList = getImageList(imageFile); for (int i = 0; i < imageList.size(); i++) { BufferedImage bi = imageList.get(i); ImageDeskew deskew = new ImageDeskew(bi); ...
[ "public", "static", "File", "deskewImage", "(", "File", "imageFile", ",", "double", "minimumDeskewThreshold", ")", "throws", "IOException", "{", "List", "<", "BufferedImage", ">", "imageList", "=", "getImageList", "(", "imageFile", ")", ";", "for", "(", "int", ...
Deskews image. @param imageFile input image @param minimumDeskewThreshold minimum deskew threshold (typically, 0.05d) @return temporary multi-page TIFF image file @throws IOException
[ "Deskews", "image", "." ]
cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java#L604-L621
21,930
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java
ImageIOHelper.readImageData
public static Map<String, String> readImageData(IIOImage oimage) { Map<String, String> dict = new HashMap<String, String>(); IIOMetadata imageMetadata = oimage.getMetadata(); if (imageMetadata != null) { IIOMetadataNode dimNode = (IIOMetadataNode) imageMetadata.getAsTree("javax_imag...
java
public static Map<String, String> readImageData(IIOImage oimage) { Map<String, String> dict = new HashMap<String, String>(); IIOMetadata imageMetadata = oimage.getMetadata(); if (imageMetadata != null) { IIOMetadataNode dimNode = (IIOMetadataNode) imageMetadata.getAsTree("javax_imag...
[ "public", "static", "Map", "<", "String", ",", "String", ">", "readImageData", "(", "IIOImage", "oimage", ")", "{", "Map", "<", "String", ",", "String", ">", "dict", "=", "new", "HashMap", "<", "String", ",", "String", ">", "(", ")", ";", "IIOMetadata"...
Reads image meta data. @param oimage @return a map of meta data
[ "Reads", "image", "meta", "data", "." ]
cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java#L629-L657
21,931
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/util/ImageHelper.java
ImageHelper.convertImageToGrayscale
public static BufferedImage convertImageToGrayscale(BufferedImage image) { BufferedImage tmp = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_BYTE_GRAY); Graphics2D g2 = tmp.createGraphics(); g2.drawImage(image, 0, 0, null); g2.dispose(); return tm...
java
public static BufferedImage convertImageToGrayscale(BufferedImage image) { BufferedImage tmp = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_BYTE_GRAY); Graphics2D g2 = tmp.createGraphics(); g2.drawImage(image, 0, 0, null); g2.dispose(); return tm...
[ "public", "static", "BufferedImage", "convertImageToGrayscale", "(", "BufferedImage", "image", ")", "{", "BufferedImage", "tmp", "=", "new", "BufferedImage", "(", "image", ".", "getWidth", "(", ")", ",", "image", ".", "getHeight", "(", ")", ",", "BufferedImage",...
A simple method to convert an image to gray scale. @param image input image @return a monochrome image
[ "A", "simple", "method", "to", "convert", "an", "image", "to", "gray", "scale", "." ]
cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/util/ImageHelper.java#L128-L134
21,932
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/util/ImageHelper.java
ImageHelper.invertImageColor
public static BufferedImage invertImageColor(BufferedImage image) { BufferedImage tmp = new BufferedImage(image.getWidth(), image.getHeight(), image.getType()); BufferedImageOp invertOp = new LookupOp(new ShortLookupTable(0, invertTable), null); return invertOp.filter(image, tmp); }
java
public static BufferedImage invertImageColor(BufferedImage image) { BufferedImage tmp = new BufferedImage(image.getWidth(), image.getHeight(), image.getType()); BufferedImageOp invertOp = new LookupOp(new ShortLookupTable(0, invertTable), null); return invertOp.filter(image, tmp); }
[ "public", "static", "BufferedImage", "invertImageColor", "(", "BufferedImage", "image", ")", "{", "BufferedImage", "tmp", "=", "new", "BufferedImage", "(", "image", ".", "getWidth", "(", ")", ",", "image", ".", "getHeight", "(", ")", ",", "image", ".", "getT...
Inverts image color. @param image input image @return an inverted-color image
[ "Inverts", "image", "color", "." ]
cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/util/ImageHelper.java#L151-L155
21,933
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/util/ImageHelper.java
ImageHelper.rotateImage
public static BufferedImage rotateImage(BufferedImage image, double angle) { double theta = Math.toRadians(angle); double sin = Math.abs(Math.sin(theta)); double cos = Math.abs(Math.cos(theta)); int w = image.getWidth(); int h = image.getHeight(); int newW = (int) M...
java
public static BufferedImage rotateImage(BufferedImage image, double angle) { double theta = Math.toRadians(angle); double sin = Math.abs(Math.sin(theta)); double cos = Math.abs(Math.cos(theta)); int w = image.getWidth(); int h = image.getHeight(); int newW = (int) M...
[ "public", "static", "BufferedImage", "rotateImage", "(", "BufferedImage", "image", ",", "double", "angle", ")", "{", "double", "theta", "=", "Math", ".", "toRadians", "(", "angle", ")", ";", "double", "sin", "=", "Math", ".", "abs", "(", "Math", ".", "si...
Rotates an image. @param image the original image @param angle the degree of rotation @return a rotated image
[ "Rotates", "an", "image", "." ]
cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/util/ImageHelper.java#L164-L182
21,934
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/util/ImageHelper.java
ImageHelper.getClipboardImage
public static Image getClipboardImage() { Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); try { return (Image) clipboard.getData(DataFlavor.imageFlavor); } catch (Exception e) { return null; } }
java
public static Image getClipboardImage() { Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); try { return (Image) clipboard.getData(DataFlavor.imageFlavor); } catch (Exception e) { return null; } }
[ "public", "static", "Image", "getClipboardImage", "(", ")", "{", "Clipboard", "clipboard", "=", "Toolkit", ".", "getDefaultToolkit", "(", ")", ".", "getSystemClipboard", "(", ")", ";", "try", "{", "return", "(", "Image", ")", "clipboard", ".", "getData", "("...
Gets an image from Clipboard. @return image
[ "Gets", "an", "image", "from", "Clipboard", "." ]
cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/util/ImageHelper.java#L189-L196
21,935
nguyenq/tess4j
src/main/java/com/recognition/software/jdeskew/ImageUtil.java
ImageUtil.rotate
public static BufferedImage rotate(BufferedImage image, double angle, int cx, int cy) { int width = image.getWidth(null); int height = image.getHeight(null); int minX, minY, maxX, maxY; minX = minY = maxX = maxY = 0; int[] corners = {0, 0, width, 0, width, height, 0, hei...
java
public static BufferedImage rotate(BufferedImage image, double angle, int cx, int cy) { int width = image.getWidth(null); int height = image.getHeight(null); int minX, minY, maxX, maxY; minX = minY = maxX = maxY = 0; int[] corners = {0, 0, width, 0, width, height, 0, hei...
[ "public", "static", "BufferedImage", "rotate", "(", "BufferedImage", "image", ",", "double", "angle", ",", "int", "cx", ",", "int", "cy", ")", "{", "int", "width", "=", "image", ".", "getWidth", "(", "null", ")", ";", "int", "height", "=", "image", "."...
Rotates image. @param image source image @param angle by degrees @param cx x-coordinate of pivot point @param cy y-coordinate of pivot point @return rotated image
[ "Rotates", "image", "." ]
cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/com/recognition/software/jdeskew/ImageUtil.java#L83-L137
21,936
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/util/Utils.java
Utils.writeFile
public static void writeFile(byte[] data, File outFile) throws IOException { // create parent dirs when necessary if (outFile.getParentFile() != null) { outFile.getParentFile().mkdirs(); } try (FileOutputStream fos = new FileOutputStream(outFile)) { fos.write(data...
java
public static void writeFile(byte[] data, File outFile) throws IOException { // create parent dirs when necessary if (outFile.getParentFile() != null) { outFile.getParentFile().mkdirs(); } try (FileOutputStream fos = new FileOutputStream(outFile)) { fos.write(data...
[ "public", "static", "void", "writeFile", "(", "byte", "[", "]", "data", ",", "File", "outFile", ")", "throws", "IOException", "{", "// create parent dirs when necessary", "if", "(", "outFile", ".", "getParentFile", "(", ")", "!=", "null", ")", "{", "outFile", ...
Writes byte array to file. @param data byte array @param outFile output file @throws IOException
[ "Writes", "byte", "array", "to", "file", "." ]
cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/util/Utils.java#L38-L46
21,937
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/util/Utils.java
Utils.getConstantName
public static String getConstantName(Object value, Class c) { for (Field f : c.getDeclaredFields()) { int mod = f.getModifiers(); if (Modifier.isStatic(mod) && Modifier.isPublic(mod) && Modifier.isFinal(mod)) { try { if (f.get(null).equals(value)) { ...
java
public static String getConstantName(Object value, Class c) { for (Field f : c.getDeclaredFields()) { int mod = f.getModifiers(); if (Modifier.isStatic(mod) && Modifier.isPublic(mod) && Modifier.isFinal(mod)) { try { if (f.get(null).equals(value)) { ...
[ "public", "static", "String", "getConstantName", "(", "Object", "value", ",", "Class", "c", ")", "{", "for", "(", "Field", "f", ":", "c", ".", "getDeclaredFields", "(", ")", ")", "{", "int", "mod", "=", "f", ".", "getModifiers", "(", ")", ";", "if", ...
Gets user-friendly name of the public static final constant defined in a class or an interface for display purpose. @param value the constant value @param c type of class or interface @return name
[ "Gets", "user", "-", "friendly", "name", "of", "the", "public", "static", "final", "constant", "defined", "in", "a", "class", "or", "an", "interface", "for", "display", "purpose", "." ]
cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/util/Utils.java#L56-L70
21,938
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/Tesseract.java
Tesseract.setImage
protected void setImage(int xsize, int ysize, ByteBuffer buf, Rectangle rect, int bpp) { int bytespp = bpp / 8; int bytespl = (int) Math.ceil(xsize * bpp / 8.0); api.TessBaseAPISetImage(handle, buf, xsize, ysize, bytespp, bytespl); if (rect != null && !rect.isEmpty()) { ...
java
protected void setImage(int xsize, int ysize, ByteBuffer buf, Rectangle rect, int bpp) { int bytespp = bpp / 8; int bytespl = (int) Math.ceil(xsize * bpp / 8.0); api.TessBaseAPISetImage(handle, buf, xsize, ysize, bytespp, bytespl); if (rect != null && !rect.isEmpty()) { ...
[ "protected", "void", "setImage", "(", "int", "xsize", ",", "int", "ysize", ",", "ByteBuffer", "buf", ",", "Rectangle", "rect", ",", "int", "bpp", ")", "{", "int", "bytespp", "=", "bpp", "/", "8", ";", "int", "bytespl", "=", "(", "int", ")", "Math", ...
Sets image to be processed. @param xsize width of image @param ysize height of image @param buf pixel data @param rect the bounding rectangle defines the region of the image to be recognized. A rectangle of zero dimension or <code>null</code> indicates the whole image. @param bpp bits per pixel, represents the bit dep...
[ "Sets", "image", "to", "be", "processed", "." ]
cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/Tesseract.java#L479-L487
21,939
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/Tesseract.java
Tesseract.getOCRText
protected String getOCRText(String filename, int pageNum) { if (filename != null && !filename.isEmpty()) { api.TessBaseAPISetInputName(handle, filename); } Pointer utf8Text = renderedFormat == RenderedFormat.HOCR ? api.TessBaseAPIGetHOCRText(handle, pageNum - 1) : api.TessBaseA...
java
protected String getOCRText(String filename, int pageNum) { if (filename != null && !filename.isEmpty()) { api.TessBaseAPISetInputName(handle, filename); } Pointer utf8Text = renderedFormat == RenderedFormat.HOCR ? api.TessBaseAPIGetHOCRText(handle, pageNum - 1) : api.TessBaseA...
[ "protected", "String", "getOCRText", "(", "String", "filename", ",", "int", "pageNum", ")", "{", "if", "(", "filename", "!=", "null", "&&", "!", "filename", ".", "isEmpty", "(", ")", ")", "{", "api", ".", "TessBaseAPISetInputName", "(", "handle", ",", "f...
Gets recognized text. @param filename input file name. Needed only for reading a UNLV zone file. @param pageNum page number; needed for hocr paging. @return the recognized text
[ "Gets", "recognized", "text", "." ]
cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/Tesseract.java#L497-L506
21,940
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/Tesseract.java
Tesseract.createRenderers
private TessResultRenderer createRenderers(String outputbase, List<RenderedFormat> formats) { TessResultRenderer renderer = null; for (RenderedFormat format : formats) { switch (format) { case TEXT: if (renderer == null) { r...
java
private TessResultRenderer createRenderers(String outputbase, List<RenderedFormat> formats) { TessResultRenderer renderer = null; for (RenderedFormat format : formats) { switch (format) { case TEXT: if (renderer == null) { r...
[ "private", "TessResultRenderer", "createRenderers", "(", "String", "outputbase", ",", "List", "<", "RenderedFormat", ">", "formats", ")", "{", "TessResultRenderer", "renderer", "=", "null", ";", "for", "(", "RenderedFormat", "format", ":", "formats", ")", "{", "...
Creates renderers for given formats. @param outputbase @param formats @return
[ "Creates", "renderers", "for", "given", "formats", "." ]
cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/Tesseract.java#L515-L589
21,941
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/Tesseract.java
Tesseract.getRecognizedWords
private List<Word> getRecognizedWords(int pageIteratorLevel) { List<Word> words = new ArrayList<Word>(); try { TessResultIterator ri = api.TessBaseAPIGetIterator(handle); TessPageIterator pi = api.TessResultIteratorGetPageIterator(ri); api.TessPageIteratorBegin...
java
private List<Word> getRecognizedWords(int pageIteratorLevel) { List<Word> words = new ArrayList<Word>(); try { TessResultIterator ri = api.TessBaseAPIGetIterator(handle); TessPageIterator pi = api.TessResultIteratorGetPageIterator(ri); api.TessPageIteratorBegin...
[ "private", "List", "<", "Word", ">", "getRecognizedWords", "(", "int", "pageIteratorLevel", ")", "{", "List", "<", "Word", ">", "words", "=", "new", "ArrayList", "<", "Word", ">", "(", ")", ";", "try", "{", "TessResultIterator", "ri", "=", "api", ".", ...
Gets result words at specified page iterator level from recognized pages. @param pageIteratorLevel TessPageIteratorLevel enum @return list of <code>Word</code>
[ "Gets", "result", "words", "at", "specified", "page", "iterator", "level", "from", "recognized", "pages", "." ]
cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/Tesseract.java#L818-L848
21,942
youseries/urule
urule-console/src/main/java/com/bstek/urule/console/repository/database/journal/DatabaseJournal.java
DatabaseJournal.initInstanceRevisionAndJanitor
protected void initInstanceRevisionAndJanitor() throws Exception { databaseRevision = new DatabaseRevision(); // Get the local file revision from disk (upgrade; see JCR-1087) long localFileRevision = 0L; if (getRevision() != null) { InstanceRevision currentFileRevision = new...
java
protected void initInstanceRevisionAndJanitor() throws Exception { databaseRevision = new DatabaseRevision(); // Get the local file revision from disk (upgrade; see JCR-1087) long localFileRevision = 0L; if (getRevision() != null) { InstanceRevision currentFileRevision = new...
[ "protected", "void", "initInstanceRevisionAndJanitor", "(", ")", "throws", "Exception", "{", "databaseRevision", "=", "new", "DatabaseRevision", "(", ")", ";", "// Get the local file revision from disk (upgrade; see JCR-1087)", "long", "localFileRevision", "=", "0L", ";", "...
Initialize the instance revision manager and the janitor thread. @throws JournalException on error
[ "Initialize", "the", "instance", "revision", "manager", "and", "the", "janitor", "thread", "." ]
3fa0eb4439e97aa292e744bcbd88a9faa36661d8
https://github.com/youseries/urule/blob/3fa0eb4439e97aa292e744bcbd88a9faa36661d8/urule-console/src/main/java/com/bstek/urule/console/repository/database/journal/DatabaseJournal.java#L306-L331
21,943
youseries/urule
urule-console/src/main/java/com/bstek/urule/console/repository/database/journal/DatabaseJournal.java
DatabaseJournal.append
protected void append(AppendRecord record, InputStream in, int length) throws JournalException { try { conHelper.exec(insertRevisionStmtSQL, record.getRevision(), getId(), record.getProducerId(), new StreamWrapper(in, length)); } catch (SQLException e) { ...
java
protected void append(AppendRecord record, InputStream in, int length) throws JournalException { try { conHelper.exec(insertRevisionStmtSQL, record.getRevision(), getId(), record.getProducerId(), new StreamWrapper(in, length)); } catch (SQLException e) { ...
[ "protected", "void", "append", "(", "AppendRecord", "record", ",", "InputStream", "in", ",", "int", "length", ")", "throws", "JournalException", "{", "try", "{", "conHelper", ".", "exec", "(", "insertRevisionStmtSQL", ",", "record", ".", "getRevision", "(", ")...
We have already saved away the revision for this record.
[ "We", "have", "already", "saved", "away", "the", "revision", "for", "this", "record", "." ]
3fa0eb4439e97aa292e744bcbd88a9faa36661d8
https://github.com/youseries/urule/blob/3fa0eb4439e97aa292e744bcbd88a9faa36661d8/urule-console/src/main/java/com/bstek/urule/console/repository/database/journal/DatabaseJournal.java#L458-L469
21,944
youseries/urule
urule-console/src/main/java/com/bstek/urule/console/repository/database/journal/DatabaseJournal.java
DatabaseJournal.checkLocalRevisionSchema
private void checkLocalRevisionSchema() throws Exception { InputStream localRevisionDDLStream = null; InputStream in = org.apache.jackrabbit.core.journal.DatabaseJournal.class.getResourceAsStream(databaseType + ".ddl"); try { BufferedReader reader = new BufferedReader(new InputStream...
java
private void checkLocalRevisionSchema() throws Exception { InputStream localRevisionDDLStream = null; InputStream in = org.apache.jackrabbit.core.journal.DatabaseJournal.class.getResourceAsStream(databaseType + ".ddl"); try { BufferedReader reader = new BufferedReader(new InputStream...
[ "private", "void", "checkLocalRevisionSchema", "(", ")", "throws", "Exception", "{", "InputStream", "localRevisionDDLStream", "=", "null", ";", "InputStream", "in", "=", "org", ".", "apache", ".", "jackrabbit", ".", "core", ".", "journal", ".", "DatabaseJournal", ...
Checks if the local revision schema objects exist and creates them if they don't exist yet. @throws Exception if an error occurs
[ "Checks", "if", "the", "local", "revision", "schema", "objects", "exist", "and", "creates", "them", "if", "they", "don", "t", "exist", "yet", "." ]
3fa0eb4439e97aa292e744bcbd88a9faa36661d8
https://github.com/youseries/urule/blob/3fa0eb4439e97aa292e744bcbd88a9faa36661d8/urule-console/src/main/java/com/bstek/urule/console/repository/database/journal/DatabaseJournal.java#L483-L506
21,945
youseries/urule
urule-console/src/main/java/com/bstek/urule/console/repository/database/DbPersistenceManager.java
DbPersistenceManager.getNameIndex
public StringIndex getNameIndex() { try { if (nameIndex == null) { FileSystemResource res = new FileSystemResource(context.getFileSystem(), RES_NAME_INDEX); if (res.exists()) { nameIndex = super.getNameIndex(); } else { ...
java
public StringIndex getNameIndex() { try { if (nameIndex == null) { FileSystemResource res = new FileSystemResource(context.getFileSystem(), RES_NAME_INDEX); if (res.exists()) { nameIndex = super.getNameIndex(); } else { ...
[ "public", "StringIndex", "getNameIndex", "(", ")", "{", "try", "{", "if", "(", "nameIndex", "==", "null", ")", "{", "FileSystemResource", "res", "=", "new", "FileSystemResource", "(", "context", ".", "getFileSystem", "(", ")", ",", "RES_NAME_INDEX", ")", ";"...
Returns the local name index @return the local name index @throws IllegalStateException if an error occurs.
[ "Returns", "the", "local", "name", "index" ]
3fa0eb4439e97aa292e744bcbd88a9faa36661d8
https://github.com/youseries/urule/blob/3fa0eb4439e97aa292e744bcbd88a9faa36661d8/urule-console/src/main/java/com/bstek/urule/console/repository/database/DbPersistenceManager.java#L611-L629
21,946
youseries/urule
urule-console/src/main/java/com/bstek/urule/console/repository/database/DbPersistenceManager.java
DbPersistenceManager.getKey
protected Object[] getKey(NodeId id) { if (getStorageModel() == SM_BINARY_KEYS) { return new Object[] { id.getRawBytes() }; } else { return new Object[] { id.getMostSignificantBits(), id.getLeastSignificantBits() }; } }
java
protected Object[] getKey(NodeId id) { if (getStorageModel() == SM_BINARY_KEYS) { return new Object[] { id.getRawBytes() }; } else { return new Object[] { id.getMostSignificantBits(), id.getLeastSignificantBits() }; } }
[ "protected", "Object", "[", "]", "getKey", "(", "NodeId", "id", ")", "{", "if", "(", "getStorageModel", "(", ")", "==", "SM_BINARY_KEYS", ")", "{", "return", "new", "Object", "[", "]", "{", "id", ".", "getRawBytes", "(", ")", "}", ";", "}", "else", ...
Constructs a parameter list for a PreparedStatement for the given node identifier. @param id the node id @return a list of Objects
[ "Constructs", "a", "parameter", "list", "for", "a", "PreparedStatement", "for", "the", "given", "node", "identifier", "." ]
3fa0eb4439e97aa292e744bcbd88a9faa36661d8
https://github.com/youseries/urule/blob/3fa0eb4439e97aa292e744bcbd88a9faa36661d8/urule-console/src/main/java/com/bstek/urule/console/repository/database/DbPersistenceManager.java#L710-L717
21,947
youseries/urule
urule-console/src/main/java/com/bstek/urule/console/repository/database/DbPersistenceManager.java
DbPersistenceManager.readBundle
private NodePropBundle readBundle(NodeId id, ResultSet rs, int column) throws SQLException { try { InputStream in; if (rs.getMetaData().getColumnType(column) == Types.BLOB) { in = rs.getBlob(column).getBinaryStream(); } else { in = ...
java
private NodePropBundle readBundle(NodeId id, ResultSet rs, int column) throws SQLException { try { InputStream in; if (rs.getMetaData().getColumnType(column) == Types.BLOB) { in = rs.getBlob(column).getBinaryStream(); } else { in = ...
[ "private", "NodePropBundle", "readBundle", "(", "NodeId", "id", ",", "ResultSet", "rs", ",", "int", "column", ")", "throws", "SQLException", "{", "try", "{", "InputStream", "in", ";", "if", "(", "rs", ".", "getMetaData", "(", ")", ".", "getColumnType", "("...
Reads and parses a bundle from the BLOB in the given column of the current row of the given result set. This is a helper method to circumvent issues JCR-1039 and JCR-1474. @param id bundle identifier @param rs result set @param column BLOB column @return parsed bundle @throws SQLException if the bundle can not be read...
[ "Reads", "and", "parses", "a", "bundle", "from", "the", "BLOB", "in", "the", "given", "column", "of", "the", "current", "row", "of", "the", "given", "result", "set", ".", "This", "is", "a", "helper", "method", "to", "circumvent", "issues", "JCR", "-", ...
3fa0eb4439e97aa292e744bcbd88a9faa36661d8
https://github.com/youseries/urule/blob/3fa0eb4439e97aa292e744bcbd88a9faa36661d8/urule-console/src/main/java/com/bstek/urule/console/repository/database/DbPersistenceManager.java#L895-L915
21,948
youseries/urule
urule-console/src/main/java/com/bstek/urule/console/repository/database/DbPersistenceManager.java
DbPersistenceManager.buildSQLStatements
protected void buildSQLStatements() { // prepare statements if (getStorageModel() == SM_BINARY_KEYS) { bundleInsertSQL = "insert into " + schemaObjectPrefix + "BUNDLE (BUNDLE_DATA, NODE_ID) values (?, ?)"; bundleUpdateSQL = "update " + schemaObjectPrefix + "BUNDLE set BUNDLE_DATA...
java
protected void buildSQLStatements() { // prepare statements if (getStorageModel() == SM_BINARY_KEYS) { bundleInsertSQL = "insert into " + schemaObjectPrefix + "BUNDLE (BUNDLE_DATA, NODE_ID) values (?, ?)"; bundleUpdateSQL = "update " + schemaObjectPrefix + "BUNDLE set BUNDLE_DATA...
[ "protected", "void", "buildSQLStatements", "(", ")", "{", "// prepare statements", "if", "(", "getStorageModel", "(", ")", "==", "SM_BINARY_KEYS", ")", "{", "bundleInsertSQL", "=", "\"insert into \"", "+", "schemaObjectPrefix", "+", "\"BUNDLE (BUNDLE_DATA, NODE_ID) values...
Initializes the SQL strings.
[ "Initializes", "the", "SQL", "strings", "." ]
3fa0eb4439e97aa292e744bcbd88a9faa36661d8
https://github.com/youseries/urule/blob/3fa0eb4439e97aa292e744bcbd88a9faa36661d8/urule-console/src/main/java/com/bstek/urule/console/repository/database/DbPersistenceManager.java#L1084-L1136
21,949
youseries/urule
urule-console/src/main/java/com/bstek/urule/console/repository/database/journal/DatabaseRecordIterator.java
DatabaseRecordIterator.fetchRecord
private void fetchRecord() throws SQLException { if (rs.next()) { long revision = rs.getLong(1); String journalId = rs.getString(2); String producerId = rs.getString(3); DataInputStream dataIn = new DataInputStream(rs.getBinaryStream(4)); record = new ...
java
private void fetchRecord() throws SQLException { if (rs.next()) { long revision = rs.getLong(1); String journalId = rs.getString(2); String producerId = rs.getString(3); DataInputStream dataIn = new DataInputStream(rs.getBinaryStream(4)); record = new ...
[ "private", "void", "fetchRecord", "(", ")", "throws", "SQLException", "{", "if", "(", "rs", ".", "next", "(", ")", ")", "{", "long", "revision", "=", "rs", ".", "getLong", "(", "1", ")", ";", "String", "journalId", "=", "rs", ".", "getString", "(", ...
Fetch the next record.
[ "Fetch", "the", "next", "record", "." ]
3fa0eb4439e97aa292e744bcbd88a9faa36661d8
https://github.com/youseries/urule/blob/3fa0eb4439e97aa292e744bcbd88a9faa36661d8/urule-console/src/main/java/com/bstek/urule/console/repository/database/journal/DatabaseRecordIterator.java#L128-L138
21,950
youseries/urule
urule-console/src/main/java/com/bstek/urule/console/repository/database/journal/DatabaseRecordIterator.java
DatabaseRecordIterator.close
private static void close(ReadRecord record) { if (record != null) { try { record.close(); } catch (IOException e) { String msg = "Error while closing record."; log.warn(msg, e); } } }
java
private static void close(ReadRecord record) { if (record != null) { try { record.close(); } catch (IOException e) { String msg = "Error while closing record."; log.warn(msg, e); } } }
[ "private", "static", "void", "close", "(", "ReadRecord", "record", ")", "{", "if", "(", "record", "!=", "null", ")", "{", "try", "{", "record", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "String", "msg", "=", "\"E...
Close a record. @param record record
[ "Close", "a", "record", "." ]
3fa0eb4439e97aa292e744bcbd88a9faa36661d8
https://github.com/youseries/urule/blob/3fa0eb4439e97aa292e744bcbd88a9faa36661d8/urule-console/src/main/java/com/bstek/urule/console/repository/database/journal/DatabaseRecordIterator.java#L145-L154
21,951
youseries/urule
urule-console/src/main/java/com/bstek/urule/console/repository/database/journal/MSSqlDatabaseJournal.java
MSSqlDatabaseJournal.setTableSpace
public void setTableSpace(String tableSpace) { if (tableSpace != null && tableSpace.length() > 0) { this.tableSpace = "on " + tableSpace.trim(); } else { this.tableSpace = ""; } }
java
public void setTableSpace(String tableSpace) { if (tableSpace != null && tableSpace.length() > 0) { this.tableSpace = "on " + tableSpace.trim(); } else { this.tableSpace = ""; } }
[ "public", "void", "setTableSpace", "(", "String", "tableSpace", ")", "{", "if", "(", "tableSpace", "!=", "null", "&&", "tableSpace", ".", "length", "(", ")", ">", "0", ")", "{", "this", ".", "tableSpace", "=", "\"on \"", "+", "tableSpace", ".", "trim", ...
Sets the MS SQL table space. @param tableSpace the MS SQL table space.
[ "Sets", "the", "MS", "SQL", "table", "space", "." ]
3fa0eb4439e97aa292e744bcbd88a9faa36661d8
https://github.com/youseries/urule/blob/3fa0eb4439e97aa292e744bcbd88a9faa36661d8/urule-console/src/main/java/com/bstek/urule/console/repository/database/journal/MSSqlDatabaseJournal.java#L59-L65
21,952
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric_ca/sdk/EnrollmentRequest.java
EnrollmentRequest.addAttrReq
public AttrReq addAttrReq(String name) throws InvalidArgumentException { if (name == null || name.isEmpty()) { throw new InvalidArgumentException("name may not be null or empty."); } return new AttrReq(name); }
java
public AttrReq addAttrReq(String name) throws InvalidArgumentException { if (name == null || name.isEmpty()) { throw new InvalidArgumentException("name may not be null or empty."); } return new AttrReq(name); }
[ "public", "AttrReq", "addAttrReq", "(", "String", "name", ")", "throws", "InvalidArgumentException", "{", "if", "(", "name", "==", "null", "||", "name", ".", "isEmpty", "(", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "\"name may not be null ...
Add attribute to certificate. @param name Name of attribute. @return Attribute added. @throws InvalidArgumentException
[ "Add", "attribute", "to", "certificate", "." ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric_ca/sdk/EnrollmentRequest.java#L199-L205
21,953
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric_ca/sdk/helper/Util.java
Util.dateToString
public static String dateToString(Date date) { final TimeZone utc = TimeZone.getTimeZone("UTC"); SimpleDateFormat tformat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX"); tformat.setTimeZone(utc); return tformat.format(date); }
java
public static String dateToString(Date date) { final TimeZone utc = TimeZone.getTimeZone("UTC"); SimpleDateFormat tformat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX"); tformat.setTimeZone(utc); return tformat.format(date); }
[ "public", "static", "String", "dateToString", "(", "Date", "date", ")", "{", "final", "TimeZone", "utc", "=", "TimeZone", ".", "getTimeZone", "(", "\"UTC\"", ")", ";", "SimpleDateFormat", "tformat", "=", "new", "SimpleDateFormat", "(", "\"yyyy-MM-dd'T'HH:mm:ss.SSS...
Converts Date type to String based on RFC3339 formatting @param date @return String
[ "Converts", "Date", "type", "to", "String", "based", "on", "RFC3339", "formatting" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric_ca/sdk/helper/Util.java#L15-L21
21,954
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/idemix/WeakBB.java
WeakBB.weakBBSign
public static ECP weakBBSign(BIG sk, BIG m) { BIG exp = IdemixUtils.modAdd(sk, m, IdemixUtils.GROUP_ORDER); exp.invmodp(IdemixUtils.GROUP_ORDER); return IdemixUtils.genG1.mul(exp); }
java
public static ECP weakBBSign(BIG sk, BIG m) { BIG exp = IdemixUtils.modAdd(sk, m, IdemixUtils.GROUP_ORDER); exp.invmodp(IdemixUtils.GROUP_ORDER); return IdemixUtils.genG1.mul(exp); }
[ "public", "static", "ECP", "weakBBSign", "(", "BIG", "sk", ",", "BIG", "m", ")", "{", "BIG", "exp", "=", "IdemixUtils", ".", "modAdd", "(", "sk", ",", "m", ",", "IdemixUtils", ".", "GROUP_ORDER", ")", ";", "exp", ".", "invmodp", "(", "IdemixUtils", "...
Produces a WBB signature for a give message @param sk Secret key @param m Message @return Signature
[ "Produces", "a", "WBB", "signature", "for", "a", "give", "message" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/idemix/WeakBB.java#L71-L76
21,955
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/idemix/WeakBB.java
WeakBB.weakBBVerify
public static boolean weakBBVerify(ECP2 pk, ECP sig, BIG m) { ECP2 p = new ECP2(); p.copy(pk); p.add(IdemixUtils.genG2.mul(m)); p.affine(); return PAIR.fexp(PAIR.ate(p, sig)).equals(IdemixUtils.genGT); }
java
public static boolean weakBBVerify(ECP2 pk, ECP sig, BIG m) { ECP2 p = new ECP2(); p.copy(pk); p.add(IdemixUtils.genG2.mul(m)); p.affine(); return PAIR.fexp(PAIR.ate(p, sig)).equals(IdemixUtils.genGT); }
[ "public", "static", "boolean", "weakBBVerify", "(", "ECP2", "pk", ",", "ECP", "sig", ",", "BIG", "m", ")", "{", "ECP2", "p", "=", "new", "ECP2", "(", ")", ";", "p", ".", "copy", "(", "pk", ")", ";", "p", ".", "add", "(", "IdemixUtils", ".", "ge...
Verify a WBB signature for a certain message @param pk Public key @param sig Signature @param m Message @return True iff valid
[ "Verify", "a", "WBB", "signature", "for", "a", "certain", "message" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/idemix/WeakBB.java#L86-L93
21,956
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/idemix/IdemixCredRequest.java
IdemixCredRequest.check
boolean check(IdemixIssuerPublicKey ipk) { if (nym == null || issuerNonce == null || proofC == null || proofS == null || ipk == null) { return false; } ECP t = ipk.getHsk().mul(proofS); t.sub(nym.mul(proofC)); ...
java
boolean check(IdemixIssuerPublicKey ipk) { if (nym == null || issuerNonce == null || proofC == null || proofS == null || ipk == null) { return false; } ECP t = ipk.getHsk().mul(proofS); t.sub(nym.mul(proofC)); ...
[ "boolean", "check", "(", "IdemixIssuerPublicKey", "ipk", ")", "{", "if", "(", "nym", "==", "null", "||", "issuerNonce", "==", "null", "||", "proofC", "==", "null", "||", "proofS", "==", "null", "||", "ipk", "==", "null", ")", "{", "return", "false", ";...
Cryptographically verify the IdemixCredRequest @param ipk the issuer public key @return true iff valid
[ "Cryptographically", "verify", "the", "IdemixCredRequest" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/idemix/IdemixCredRequest.java#L137-L163
21,957
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/idemix/IdemixCredRequest.java
IdemixCredRequest.toJson
public String toJson() { StringWriter stringWriter = new StringWriter(); JsonWriter jsonWriter = Json.createWriter(new PrintWriter(stringWriter)); jsonWriter.writeObject(toJsonObject()); jsonWriter.close(); return stringWriter.toString(); }
java
public String toJson() { StringWriter stringWriter = new StringWriter(); JsonWriter jsonWriter = Json.createWriter(new PrintWriter(stringWriter)); jsonWriter.writeObject(toJsonObject()); jsonWriter.close(); return stringWriter.toString(); }
[ "public", "String", "toJson", "(", ")", "{", "StringWriter", "stringWriter", "=", "new", "StringWriter", "(", ")", ";", "JsonWriter", "jsonWriter", "=", "Json", ".", "createWriter", "(", "new", "PrintWriter", "(", "stringWriter", ")", ")", ";", "jsonWriter", ...
Convert the enrollment request to a JSON string
[ "Convert", "the", "enrollment", "request", "to", "a", "JSON", "string" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/idemix/IdemixCredRequest.java#L166-L172
21,958
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/LifecycleInstallChaincodeProposalResponse.java
LifecycleInstallChaincodeProposalResponse.getPackageId
public String getPackageId() throws ProposalException { if (Status.SUCCESS != getStatus()) { throw new ProposalException(format("Status of install proposal did not ret ok for %s, %s ", getPeer(), getStatus())); } ByteString payload = getProposalResponse().getResponse().getPayload(); ...
java
public String getPackageId() throws ProposalException { if (Status.SUCCESS != getStatus()) { throw new ProposalException(format("Status of install proposal did not ret ok for %s, %s ", getPeer(), getStatus())); } ByteString payload = getProposalResponse().getResponse().getPayload(); ...
[ "public", "String", "getPackageId", "(", ")", "throws", "ProposalException", "{", "if", "(", "Status", ".", "SUCCESS", "!=", "getStatus", "(", ")", ")", "{", "throw", "new", "ProposalException", "(", "format", "(", "\"Status of install proposal did not ret ok for %s...
The packageId the identifies this chaincode change. @return the package id. @throws ProposalException
[ "The", "packageId", "the", "identifies", "this", "chaincode", "change", "." ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/LifecycleInstallChaincodeProposalResponse.java#L34-L46
21,959
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/idemix/IdemixIssuerPublicKey.java
IdemixIssuerPublicKey.check
public boolean check() { // check formalities of IdemixIssuerPublicKey if (AttributeNames == null || Hsk == null || HRand == null || HAttrs == null || BarG1 == null || BarG1.is_infinity() || BarG2 == null || HAttrs.length < AttributeNames.length) { return fals...
java
public boolean check() { // check formalities of IdemixIssuerPublicKey if (AttributeNames == null || Hsk == null || HRand == null || HAttrs == null || BarG1 == null || BarG1.is_infinity() || BarG2 == null || HAttrs.length < AttributeNames.length) { return fals...
[ "public", "boolean", "check", "(", ")", "{", "// check formalities of IdemixIssuerPublicKey", "if", "(", "AttributeNames", "==", "null", "||", "Hsk", "==", "null", "||", "HRand", "==", "null", "||", "HAttrs", "==", "null", "||", "BarG1", "==", "null", "||", ...
check whether the issuer public key is correct @return true iff valid
[ "check", "whether", "the", "issuer", "public", "key", "is", "correct" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/idemix/IdemixIssuerPublicKey.java#L163-L195
21,960
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/LifecycleQueryApprovalStatusProposalResponse.java
LifecycleQueryApprovalStatusProposalResponse.getApprovalMap
public Map<String, Boolean> getApprovalMap() throws ProposalException { Lifecycle.QueryApprovalStatusResults rs = getApprovalStatusResults(); if (rs == null) { return Collections.emptyMap(); } return rs.getApprovedMap(); }
java
public Map<String, Boolean> getApprovalMap() throws ProposalException { Lifecycle.QueryApprovalStatusResults rs = getApprovalStatusResults(); if (rs == null) { return Collections.emptyMap(); } return rs.getApprovedMap(); }
[ "public", "Map", "<", "String", ",", "Boolean", ">", "getApprovalMap", "(", ")", "throws", "ProposalException", "{", "Lifecycle", ".", "QueryApprovalStatusResults", "rs", "=", "getApprovalStatusResults", "(", ")", ";", "if", "(", "rs", "==", "null", ")", "{", ...
A map of approved and not approved. The key contains name of org the value a Boolean if approved. @return @throws ProposalException
[ "A", "map", "of", "approved", "and", "not", "approved", ".", "The", "key", "contains", "name", "of", "org", "the", "value", "a", "Boolean", "if", "approved", "." ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/LifecycleQueryApprovalStatusProposalResponse.java#L101-L108
21,961
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.getPeerNames
public Collection<String> getPeerNames() { if (peers == null) { return Collections.EMPTY_SET; } else { return new HashSet<>(peers.keySet()); } }
java
public Collection<String> getPeerNames() { if (peers == null) { return Collections.EMPTY_SET; } else { return new HashSet<>(peers.keySet()); } }
[ "public", "Collection", "<", "String", ">", "getPeerNames", "(", ")", "{", "if", "(", "peers", "==", "null", ")", "{", "return", "Collections", ".", "EMPTY_SET", ";", "}", "else", "{", "return", "new", "HashSet", "<>", "(", "peers", ".", "keySet", "(",...
Names of Peers found @return Collection of peer names found.
[ "Names", "of", "Peers", "found" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L85-L91
21,962
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.getOrdererNames
public Collection<String> getOrdererNames() { if (orderers == null) { return Collections.EMPTY_SET; } else { return new HashSet<>(orderers.keySet()); } }
java
public Collection<String> getOrdererNames() { if (orderers == null) { return Collections.EMPTY_SET; } else { return new HashSet<>(orderers.keySet()); } }
[ "public", "Collection", "<", "String", ">", "getOrdererNames", "(", ")", "{", "if", "(", "orderers", "==", "null", ")", "{", "return", "Collections", ".", "EMPTY_SET", ";", "}", "else", "{", "return", "new", "HashSet", "<>", "(", "orderers", ".", "keySet...
Names of Orderers found @return Collection of peer names found.
[ "Names", "of", "Orderers", "found" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L98-L104
21,963
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.setPeerProperties
public void setPeerProperties(String name, Properties properties) throws InvalidArgumentException { setNodeProperties("Peer", name, peers, properties); }
java
public void setPeerProperties(String name, Properties properties) throws InvalidArgumentException { setNodeProperties("Peer", name, peers, properties); }
[ "public", "void", "setPeerProperties", "(", "String", "name", ",", "Properties", "properties", ")", "throws", "InvalidArgumentException", "{", "setNodeProperties", "(", "\"Peer\"", ",", "name", ",", "peers", ",", "properties", ")", ";", "}" ]
Set a specific peer's properties. @param name The name of the peer's property to set. @param properties The properties to set. @throws InvalidArgumentException
[ "Set", "a", "specific", "peer", "s", "properties", "." ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L176-L178
21,964
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.setOrdererProperties
public void setOrdererProperties(String name, Properties properties) throws InvalidArgumentException { setNodeProperties("Orderer", name, orderers, properties); }
java
public void setOrdererProperties(String name, Properties properties) throws InvalidArgumentException { setNodeProperties("Orderer", name, orderers, properties); }
[ "public", "void", "setOrdererProperties", "(", "String", "name", ",", "Properties", "properties", ")", "throws", "InvalidArgumentException", "{", "setNodeProperties", "(", "\"Orderer\"", ",", "name", ",", "orderers", ",", "properties", ")", ";", "}" ]
Set a specific orderer's properties. @param name The name of the orderer's property to set. @param properties The properties to set. @throws InvalidArgumentException
[ "Set", "a", "specific", "orderer", "s", "properties", "." ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L187-L189
21,965
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.fromYamlFile
public static NetworkConfig fromYamlFile(File configFile) throws InvalidArgumentException, IOException, NetworkConfigurationException { return fromFile(configFile, false); }
java
public static NetworkConfig fromYamlFile(File configFile) throws InvalidArgumentException, IOException, NetworkConfigurationException { return fromFile(configFile, false); }
[ "public", "static", "NetworkConfig", "fromYamlFile", "(", "File", "configFile", ")", "throws", "InvalidArgumentException", ",", "IOException", ",", "NetworkConfigurationException", "{", "return", "fromFile", "(", "configFile", ",", "false", ")", ";", "}" ]
Creates a new NetworkConfig instance configured with details supplied in a YAML file. @param configFile The file containing the network configuration @return A new NetworkConfig instance @throws InvalidArgumentException @throws IOException
[ "Creates", "a", "new", "NetworkConfig", "instance", "configured", "with", "details", "supplied", "in", "a", "YAML", "file", "." ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L242-L244
21,966
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.fromJsonFile
public static NetworkConfig fromJsonFile(File configFile) throws InvalidArgumentException, IOException, NetworkConfigurationException { return fromFile(configFile, true); }
java
public static NetworkConfig fromJsonFile(File configFile) throws InvalidArgumentException, IOException, NetworkConfigurationException { return fromFile(configFile, true); }
[ "public", "static", "NetworkConfig", "fromJsonFile", "(", "File", "configFile", ")", "throws", "InvalidArgumentException", ",", "IOException", ",", "NetworkConfigurationException", "{", "return", "fromFile", "(", "configFile", ",", "true", ")", ";", "}" ]
Creates a new NetworkConfig instance configured with details supplied in a JSON file. @param configFile The file containing the network configuration @return A new NetworkConfig instance @throws InvalidArgumentException @throws IOException
[ "Creates", "a", "new", "NetworkConfig", "instance", "configured", "with", "details", "supplied", "in", "a", "JSON", "file", "." ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L254-L256
21,967
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.fromYamlStream
public static NetworkConfig fromYamlStream(InputStream configStream) throws InvalidArgumentException, NetworkConfigurationException { logger.trace("NetworkConfig.fromYamlStream..."); // Sanity check if (configStream == null) { throw new InvalidArgumentException("configStream must b...
java
public static NetworkConfig fromYamlStream(InputStream configStream) throws InvalidArgumentException, NetworkConfigurationException { logger.trace("NetworkConfig.fromYamlStream..."); // Sanity check if (configStream == null) { throw new InvalidArgumentException("configStream must b...
[ "public", "static", "NetworkConfig", "fromYamlStream", "(", "InputStream", "configStream", ")", "throws", "InvalidArgumentException", ",", "NetworkConfigurationException", "{", "logger", ".", "trace", "(", "\"NetworkConfig.fromYamlStream...\"", ")", ";", "// Sanity check", ...
Creates a new NetworkConfig instance configured with details supplied in YAML format @param configStream A stream opened on a YAML document containing network configuration details @return A new NetworkConfig instance @throws InvalidArgumentException
[ "Creates", "a", "new", "NetworkConfig", "instance", "configured", "with", "details", "supplied", "in", "YAML", "format" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L265-L283
21,968
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.fromJsonStream
public static NetworkConfig fromJsonStream(InputStream configStream) throws InvalidArgumentException, NetworkConfigurationException { logger.trace("NetworkConfig.fromJsonStream..."); // Sanity check if (configStream == null) { throw new InvalidArgumentException("configStream must b...
java
public static NetworkConfig fromJsonStream(InputStream configStream) throws InvalidArgumentException, NetworkConfigurationException { logger.trace("NetworkConfig.fromJsonStream..."); // Sanity check if (configStream == null) { throw new InvalidArgumentException("configStream must b...
[ "public", "static", "NetworkConfig", "fromJsonStream", "(", "InputStream", "configStream", ")", "throws", "InvalidArgumentException", ",", "NetworkConfigurationException", "{", "logger", ".", "trace", "(", "\"NetworkConfig.fromJsonStream...\"", ")", ";", "// Sanity check", ...
Creates a new NetworkConfig instance configured with details supplied in JSON format @param configStream A stream opened on a JSON document containing network configuration details @return A new NetworkConfig instance @throws InvalidArgumentException
[ "Creates", "a", "new", "NetworkConfig", "instance", "configured", "with", "details", "supplied", "in", "JSON", "format" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L292-L308
21,969
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.fromJsonObject
public static NetworkConfig fromJsonObject(JsonObject jsonConfig) throws InvalidArgumentException, NetworkConfigurationException { // Sanity check if (jsonConfig == null) { throw new InvalidArgumentException("jsonConfig must be specified"); } if (logger.isTraceEnabled()) { ...
java
public static NetworkConfig fromJsonObject(JsonObject jsonConfig) throws InvalidArgumentException, NetworkConfigurationException { // Sanity check if (jsonConfig == null) { throw new InvalidArgumentException("jsonConfig must be specified"); } if (logger.isTraceEnabled()) { ...
[ "public", "static", "NetworkConfig", "fromJsonObject", "(", "JsonObject", "jsonConfig", ")", "throws", "InvalidArgumentException", ",", "NetworkConfigurationException", "{", "// Sanity check", "if", "(", "jsonConfig", "==", "null", ")", "{", "throw", "new", "InvalidArgu...
Creates a new NetworkConfig instance configured with details supplied in a JSON object @param jsonConfig JSON object containing network configuration details @return A new NetworkConfig instance @throws InvalidArgumentException
[ "Creates", "a", "new", "NetworkConfig", "instance", "configured", "with", "details", "supplied", "in", "a", "JSON", "object" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L317-L329
21,970
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.fromFile
private static NetworkConfig fromFile(File configFile, boolean isJson) throws InvalidArgumentException, IOException, NetworkConfigurationException { // Sanity check if (configFile == null) { throw new InvalidArgumentException("configFile must be specified"); } if (logger.is...
java
private static NetworkConfig fromFile(File configFile, boolean isJson) throws InvalidArgumentException, IOException, NetworkConfigurationException { // Sanity check if (configFile == null) { throw new InvalidArgumentException("configFile must be specified"); } if (logger.is...
[ "private", "static", "NetworkConfig", "fromFile", "(", "File", "configFile", ",", "boolean", "isJson", ")", "throws", "InvalidArgumentException", ",", "IOException", ",", "NetworkConfigurationException", "{", "// Sanity check", "if", "(", "configFile", "==", "null", "...
Loads a NetworkConfig object from a Json or Yaml file
[ "Loads", "a", "NetworkConfig", "object", "from", "a", "Json", "or", "Yaml", "file" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L332-L351
21,971
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.load
private static NetworkConfig load(JsonObject jsonConfig) throws InvalidArgumentException, NetworkConfigurationException { // Sanity check if (jsonConfig == null) { throw new InvalidArgumentException("config must be specified"); } return new NetworkConfig(jsonConfig); }
java
private static NetworkConfig load(JsonObject jsonConfig) throws InvalidArgumentException, NetworkConfigurationException { // Sanity check if (jsonConfig == null) { throw new InvalidArgumentException("config must be specified"); } return new NetworkConfig(jsonConfig); }
[ "private", "static", "NetworkConfig", "load", "(", "JsonObject", "jsonConfig", ")", "throws", "InvalidArgumentException", ",", "NetworkConfigurationException", "{", "// Sanity check", "if", "(", "jsonConfig", "==", "null", ")", "{", "throw", "new", "InvalidArgumentExcep...
Returns a new NetworkConfig instance and populates it from the specified JSON object @param jsonConfig The JSON object containing the config details @return A populated NetworkConfig instance @throws InvalidArgumentException
[ "Returns", "a", "new", "NetworkConfig", "instance", "and", "populates", "it", "from", "the", "specified", "JSON", "object" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L360-L368
21,972
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.getPeerOrgInfos
public Map<String, OrgInfo> getPeerOrgInfos(final String peerName) throws InvalidArgumentException { if (Utils.isNullOrEmpty(peerName)) { throw new InvalidArgumentException("peerName can not be null or empty."); } if (organizations == null || organizations.isEmpty()) { r...
java
public Map<String, OrgInfo> getPeerOrgInfos(final String peerName) throws InvalidArgumentException { if (Utils.isNullOrEmpty(peerName)) { throw new InvalidArgumentException("peerName can not be null or empty."); } if (organizations == null || organizations.isEmpty()) { r...
[ "public", "Map", "<", "String", ",", "OrgInfo", ">", "getPeerOrgInfos", "(", "final", "String", "peerName", ")", "throws", "InvalidArgumentException", "{", "if", "(", "Utils", ".", "isNullOrEmpty", "(", "peerName", ")", ")", "{", "throw", "new", "InvalidArgume...
Find organizations for a peer. @param peerName name of peer @return returns map of orgName to {@link OrgInfo} that the peer belongs to. @throws InvalidArgumentException
[ "Find", "organizations", "for", "a", "peer", "." ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L389-L407
21,973
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.getPeerAdmin
public UserInfo getPeerAdmin(String orgName) throws NetworkConfigurationException { OrgInfo org = getOrganizationInfo(orgName); if (org == null) { throw new NetworkConfigurationException(format("Organization %s is not defined", orgName)); } return org.getPeerAdmin(); }
java
public UserInfo getPeerAdmin(String orgName) throws NetworkConfigurationException { OrgInfo org = getOrganizationInfo(orgName); if (org == null) { throw new NetworkConfigurationException(format("Organization %s is not defined", orgName)); } return org.getPeerAdmin(); }
[ "public", "UserInfo", "getPeerAdmin", "(", "String", "orgName", ")", "throws", "NetworkConfigurationException", "{", "OrgInfo", "org", "=", "getOrganizationInfo", "(", "orgName", ")", ";", "if", "(", "org", "==", "null", ")", "{", "throw", "new", "NetworkConfigu...
Returns the admin user associated with the specified organization @param orgName The name of the organization @return The admin user details @throws NetworkConfigurationException
[ "Returns", "the", "admin", "user", "associated", "with", "the", "specified", "organization" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L427-L435
21,974
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.createAllOrderers
private void createAllOrderers() throws NetworkConfigurationException { // Sanity check if (orderers != null) { throw new NetworkConfigurationException("INTERNAL ERROR: orderers has already been initialized!"); } orderers = new HashMap<>(); // orderers is a JSON ob...
java
private void createAllOrderers() throws NetworkConfigurationException { // Sanity check if (orderers != null) { throw new NetworkConfigurationException("INTERNAL ERROR: orderers has already been initialized!"); } orderers = new HashMap<>(); // orderers is a JSON ob...
[ "private", "void", "createAllOrderers", "(", ")", "throws", "NetworkConfigurationException", "{", "// Sanity check", "if", "(", "orderers", "!=", "null", ")", "{", "throw", "new", "NetworkConfigurationException", "(", "\"INTERNAL ERROR: orderers has already been initialized!\...
Creates Node instances representing all the orderers defined in the config file
[ "Creates", "Node", "instances", "representing", "all", "the", "orderers", "defined", "in", "the", "config", "file" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L501-L531
21,975
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.createAllPeers
private void createAllPeers() throws NetworkConfigurationException { // Sanity checks if (peers != null) { throw new NetworkConfigurationException("INTERNAL ERROR: peers has already been initialized!"); } peers = new HashMap<>(); // peers is a JSON object containin...
java
private void createAllPeers() throws NetworkConfigurationException { // Sanity checks if (peers != null) { throw new NetworkConfigurationException("INTERNAL ERROR: peers has already been initialized!"); } peers = new HashMap<>(); // peers is a JSON object containin...
[ "private", "void", "createAllPeers", "(", ")", "throws", "NetworkConfigurationException", "{", "// Sanity checks", "if", "(", "peers", "!=", "null", ")", "{", "throw", "new", "NetworkConfigurationException", "(", "\"INTERNAL ERROR: peers has already been initialized!\"", ")...
Creates Node instances representing all the peers defined in the config file
[ "Creates", "Node", "instances", "representing", "all", "the", "peers", "defined", "in", "the", "config", "file" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L534-L566
21,976
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.findCertificateAuthorities
private Map<String, JsonObject> findCertificateAuthorities() throws NetworkConfigurationException { Map<String, JsonObject> ret = new HashMap<>(); JsonObject jsonCertificateAuthorities = getJsonObject(jsonConfig, "certificateAuthorities"); if (null != jsonCertificateAuthorities) { ...
java
private Map<String, JsonObject> findCertificateAuthorities() throws NetworkConfigurationException { Map<String, JsonObject> ret = new HashMap<>(); JsonObject jsonCertificateAuthorities = getJsonObject(jsonConfig, "certificateAuthorities"); if (null != jsonCertificateAuthorities) { ...
[ "private", "Map", "<", "String", ",", "JsonObject", ">", "findCertificateAuthorities", "(", ")", "throws", "NetworkConfigurationException", "{", "Map", "<", "String", ",", "JsonObject", ">", "ret", "=", "new", "HashMap", "<>", "(", ")", ";", "JsonObject", "jso...
Produce a map from tag to jsonobject for the CA
[ "Produce", "a", "map", "from", "tag", "to", "jsonobject", "for", "the", "CA" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L569-L588
21,977
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.createAllOrganizations
private void createAllOrganizations(Map<String, JsonObject> foundCertificateAuthorities) throws NetworkConfigurationException { // Sanity check if (organizations != null) { throw new NetworkConfigurationException("INTERNAL ERROR: organizations has already been initialized!"); } ...
java
private void createAllOrganizations(Map<String, JsonObject> foundCertificateAuthorities) throws NetworkConfigurationException { // Sanity check if (organizations != null) { throw new NetworkConfigurationException("INTERNAL ERROR: organizations has already been initialized!"); } ...
[ "private", "void", "createAllOrganizations", "(", "Map", "<", "String", ",", "JsonObject", ">", "foundCertificateAuthorities", ")", "throws", "NetworkConfigurationException", "{", "// Sanity check", "if", "(", "organizations", "!=", "null", ")", "{", "throw", "new", ...
Creates JsonObjects representing all the Organizations defined in the config file
[ "Creates", "JsonObjects", "representing", "all", "the", "Organizations", "defined", "in", "the", "config", "file" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L591-L618
21,978
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.getOrderer
private Orderer getOrderer(HFClient client, String ordererName) throws InvalidArgumentException { Orderer orderer = null; Node o = orderers.get(ordererName); if (o != null) { orderer = client.newOrderer(o.getName(), o.getUrl(), o.getProperties()); } return orderer; ...
java
private Orderer getOrderer(HFClient client, String ordererName) throws InvalidArgumentException { Orderer orderer = null; Node o = orderers.get(ordererName); if (o != null) { orderer = client.newOrderer(o.getName(), o.getUrl(), o.getProperties()); } return orderer; ...
[ "private", "Orderer", "getOrderer", "(", "HFClient", "client", ",", "String", "ordererName", ")", "throws", "InvalidArgumentException", "{", "Orderer", "orderer", "=", "null", ";", "Node", "o", "=", "orderers", ".", "get", "(", "ordererName", ")", ";", "if", ...
Returns a new Orderer instance for the specified orderer name
[ "Returns", "a", "new", "Orderer", "instance", "for", "the", "specified", "orderer", "name" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L793-L800
21,979
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.createNode
private Node createNode(String nodeName, JsonObject jsonNode, String urlPropName) throws NetworkConfigurationException { // jsonNode. // if (jsonNode.isNull(urlPropName)) { // return null; // } String url = jsonNode.getString(urlPropName, null); if (url == null) { ...
java
private Node createNode(String nodeName, JsonObject jsonNode, String urlPropName) throws NetworkConfigurationException { // jsonNode. // if (jsonNode.isNull(urlPropName)) { // return null; // } String url = jsonNode.getString(urlPropName, null); if (url == null) { ...
[ "private", "Node", "createNode", "(", "String", "nodeName", ",", "JsonObject", "jsonNode", ",", "String", "urlPropName", ")", "throws", "NetworkConfigurationException", "{", "// jsonNode.", "// if (jsonNode.isNull(urlPropName)) {", "// return null;", "...
Creates a new Node instance from a JSON object
[ "Creates", "a", "new", "Node", "instance", "from", "a", "JSON", "object" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L803-L835
21,980
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.createOrg
private OrgInfo createOrg(String orgName, JsonObject jsonOrg, Map<String, JsonObject> foundCertificateAuthorities) throws NetworkConfigurationException { String msgPrefix = format("Organization %s", orgName); String mspId = getJsonValueAsString(jsonOrg.get("mspid")); OrgInfo org = new OrgInfo...
java
private OrgInfo createOrg(String orgName, JsonObject jsonOrg, Map<String, JsonObject> foundCertificateAuthorities) throws NetworkConfigurationException { String msgPrefix = format("Organization %s", orgName); String mspId = getJsonValueAsString(jsonOrg.get("mspid")); OrgInfo org = new OrgInfo...
[ "private", "OrgInfo", "createOrg", "(", "String", "orgName", ",", "JsonObject", "jsonOrg", ",", "Map", "<", "String", ",", "JsonObject", ">", "foundCertificateAuthorities", ")", "throws", "NetworkConfigurationException", "{", "String", "msgPrefix", "=", "format", "(...
Creates a new OrgInfo instance from a JSON object
[ "Creates", "a", "new", "OrgInfo", "instance", "from", "a", "JSON", "object" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L855-L917
21,981
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.createCA
private CAInfo createCA(String name, JsonObject jsonCA, OrgInfo org) throws NetworkConfigurationException { String url = getJsonValueAsString(jsonCA.get("url")); Properties httpOptions = extractProperties(jsonCA, "httpOptions"); String enrollId = null; String enrollSecret = null; ...
java
private CAInfo createCA(String name, JsonObject jsonCA, OrgInfo org) throws NetworkConfigurationException { String url = getJsonValueAsString(jsonCA.get("url")); Properties httpOptions = extractProperties(jsonCA, "httpOptions"); String enrollId = null; String enrollSecret = null; ...
[ "private", "CAInfo", "createCA", "(", "String", "name", ",", "JsonObject", "jsonCA", ",", "OrgInfo", "org", ")", "throws", "NetworkConfigurationException", "{", "String", "url", "=", "getJsonValueAsString", "(", "jsonCA", ".", "get", "(", "\"url\"", ")", ")", ...
Creates a new CAInfo instance from a JSON object
[ "Creates", "a", "new", "CAInfo", "instance", "from", "a", "JSON", "object" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L967-L1005
21,982
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.extractProperties
private static Properties extractProperties(JsonObject json, String fieldName) { Properties props = new Properties(); // Extract any other grpc options JsonObject options = getJsonObject(json, fieldName); if (options != null) { for (Entry<String, JsonValue> entry : options....
java
private static Properties extractProperties(JsonObject json, String fieldName) { Properties props = new Properties(); // Extract any other grpc options JsonObject options = getJsonObject(json, fieldName); if (options != null) { for (Entry<String, JsonValue> entry : options....
[ "private", "static", "Properties", "extractProperties", "(", "JsonObject", "json", ",", "String", "fieldName", ")", "{", "Properties", "props", "=", "new", "Properties", "(", ")", ";", "// Extract any other grpc options", "JsonObject", "options", "=", "getJsonObject",...
Extracts all defined properties of the specified field and returns a Properties object
[ "Extracts", "all", "defined", "properties", "of", "the", "specified", "field", "and", "returns", "a", "Properties", "object" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L1008-L1022
21,983
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.getPeer
private Peer getPeer(HFClient client, String peerName) throws InvalidArgumentException { Peer peer = null; Node p = peers.get(peerName); if (p != null) { peer = client.newPeer(p.getName(), p.getUrl(), p.getProperties()); } return peer; }
java
private Peer getPeer(HFClient client, String peerName) throws InvalidArgumentException { Peer peer = null; Node p = peers.get(peerName); if (p != null) { peer = client.newPeer(p.getName(), p.getUrl(), p.getProperties()); } return peer; }
[ "private", "Peer", "getPeer", "(", "HFClient", "client", ",", "String", "peerName", ")", "throws", "InvalidArgumentException", "{", "Peer", "peer", "=", "null", ";", "Node", "p", "=", "peers", ".", "get", "(", "peerName", ")", ";", "if", "(", "p", "!=", ...
Returns a new Peer instance for the specified peer name
[ "Returns", "a", "new", "Peer", "instance", "for", "the", "specified", "peer", "name" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L1025-L1032
21,984
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.getJsonValue
private static String getJsonValue(JsonValue value) { String s = null; if (value != null) { s = getJsonValueAsString(value); if (s == null) { s = getJsonValueAsNumberString(value); } if (s == null) { Boolean b = getJsonValue...
java
private static String getJsonValue(JsonValue value) { String s = null; if (value != null) { s = getJsonValueAsString(value); if (s == null) { s = getJsonValueAsNumberString(value); } if (s == null) { Boolean b = getJsonValue...
[ "private", "static", "String", "getJsonValue", "(", "JsonValue", "value", ")", "{", "String", "s", "=", "null", ";", "if", "(", "value", "!=", "null", ")", "{", "s", "=", "getJsonValueAsString", "(", "value", ")", ";", "if", "(", "s", "==", "null", "...
If it's anything else it returns null
[ "If", "it", "s", "anything", "else", "it", "returns", "null" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L1039-L1054
21,985
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.getJsonValueAsObject
private static JsonObject getJsonValueAsObject(JsonValue value) { return (value != null && value.getValueType() == ValueType.OBJECT) ? value.asJsonObject() : null; }
java
private static JsonObject getJsonValueAsObject(JsonValue value) { return (value != null && value.getValueType() == ValueType.OBJECT) ? value.asJsonObject() : null; }
[ "private", "static", "JsonObject", "getJsonValueAsObject", "(", "JsonValue", "value", ")", "{", "return", "(", "value", "!=", "null", "&&", "value", ".", "getValueType", "(", ")", "==", "ValueType", ".", "OBJECT", ")", "?", "value", ".", "asJsonObject", "(",...
Returns the specified JsonValue as a JsonObject, or null if it's not an object
[ "Returns", "the", "specified", "JsonValue", "as", "a", "JsonObject", "or", "null", "if", "it", "s", "not", "an", "object" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L1057-L1059
21,986
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.getJsonValueAsArray
private static JsonArray getJsonValueAsArray(JsonValue value) { return (value != null && value.getValueType() == ValueType.ARRAY) ? value.asJsonArray() : null; }
java
private static JsonArray getJsonValueAsArray(JsonValue value) { return (value != null && value.getValueType() == ValueType.ARRAY) ? value.asJsonArray() : null; }
[ "private", "static", "JsonArray", "getJsonValueAsArray", "(", "JsonValue", "value", ")", "{", "return", "(", "value", "!=", "null", "&&", "value", ".", "getValueType", "(", ")", "==", "ValueType", ".", "ARRAY", ")", "?", "value", ".", "asJsonArray", "(", "...
Returns the specified JsonValue as a JsonArray, or null if it's not an array
[ "Returns", "the", "specified", "JsonValue", "as", "a", "JsonArray", "or", "null", "if", "it", "s", "not", "an", "array" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L1062-L1064
21,987
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.getJsonValueAsList
private static List<JsonObject> getJsonValueAsList(JsonValue value) { if (value != null) { if (value.getValueType() == ValueType.ARRAY) { return value.asJsonArray().getValuesAs(JsonObject.class); } else if (value.getValueType() == ValueType.OBJECT) { List...
java
private static List<JsonObject> getJsonValueAsList(JsonValue value) { if (value != null) { if (value.getValueType() == ValueType.ARRAY) { return value.asJsonArray().getValuesAs(JsonObject.class); } else if (value.getValueType() == ValueType.OBJECT) { List...
[ "private", "static", "List", "<", "JsonObject", ">", "getJsonValueAsList", "(", "JsonValue", "value", ")", "{", "if", "(", "value", "!=", "null", ")", "{", "if", "(", "value", ".", "getValueType", "(", ")", "==", "ValueType", ".", "ARRAY", ")", "{", "r...
Returns the specified JsonValue as a List. Allows single or array
[ "Returns", "the", "specified", "JsonValue", "as", "a", "List", ".", "Allows", "single", "or", "array" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L1067-L1080
21,988
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.getJsonValueAsBoolean
private static Boolean getJsonValueAsBoolean(JsonValue value) { if (value != null) { if (value.getValueType() == ValueType.TRUE) { return true; } else if (value.getValueType() == ValueType.FALSE) { return false; } } return null;...
java
private static Boolean getJsonValueAsBoolean(JsonValue value) { if (value != null) { if (value.getValueType() == ValueType.TRUE) { return true; } else if (value.getValueType() == ValueType.FALSE) { return false; } } return null;...
[ "private", "static", "Boolean", "getJsonValueAsBoolean", "(", "JsonValue", "value", ")", "{", "if", "(", "value", "!=", "null", ")", "{", "if", "(", "value", ".", "getValueType", "(", ")", "==", "ValueType", ".", "TRUE", ")", "{", "return", "true", ";", ...
Returns the specified JsonValue as a Boolean, or null if it's not a boolean
[ "Returns", "the", "specified", "JsonValue", "as", "a", "Boolean", "or", "null", "if", "it", "s", "not", "a", "boolean" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L1093-L1102
21,989
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.getJsonObject
private static JsonObject getJsonObject(JsonObject object, String propName) { JsonObject obj = null; JsonValue val = object.get(propName); if (val != null && val.getValueType() == ValueType.OBJECT) { obj = val.asJsonObject(); } return obj; }
java
private static JsonObject getJsonObject(JsonObject object, String propName) { JsonObject obj = null; JsonValue val = object.get(propName); if (val != null && val.getValueType() == ValueType.OBJECT) { obj = val.asJsonObject(); } return obj; }
[ "private", "static", "JsonObject", "getJsonObject", "(", "JsonObject", "object", ",", "String", "propName", ")", "{", "JsonObject", "obj", "=", "null", ";", "JsonValue", "val", "=", "object", ".", "get", "(", "propName", ")", ";", "if", "(", "val", "!=", ...
Returns the specified property as a JsonObject
[ "Returns", "the", "specified", "property", "as", "a", "JsonObject" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L1105-L1112
21,990
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java
NetworkConfig.getChannelNames
public Set<String> getChannelNames() { Set<String> ret = Collections.EMPTY_SET; JsonObject channels = getJsonObject(jsonConfig, "channels"); if (channels != null) { final Set<String> channelNames = channels.keySet(); if (channelNames != null && !channelNames.isEmpty()) {...
java
public Set<String> getChannelNames() { Set<String> ret = Collections.EMPTY_SET; JsonObject channels = getJsonObject(jsonConfig, "channels"); if (channels != null) { final Set<String> channelNames = channels.keySet(); if (channelNames != null && !channelNames.isEmpty()) {...
[ "public", "Set", "<", "String", ">", "getChannelNames", "(", ")", "{", "Set", "<", "String", ">", "ret", "=", "Collections", ".", "EMPTY_SET", ";", "JsonObject", "channels", "=", "getJsonObject", "(", "jsonConfig", ",", "\"channels\"", ")", ";", "if", "(",...
Get the channel names found. @return A set of the channel names found in the configuration file or empty set if none found.
[ "Get", "the", "channel", "names", "found", "." ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L1120-L1131
21,991
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/UpgradeProposalRequest.java
UpgradeProposalRequest.setTransientMap
public void setTransientMap(Map<String, byte[]> transientMap) throws InvalidArgumentException { if (null == transientMap) { throw new InvalidArgumentException("Transient map may not be set to null"); } this.transientMap = transientMap; }
java
public void setTransientMap(Map<String, byte[]> transientMap) throws InvalidArgumentException { if (null == transientMap) { throw new InvalidArgumentException("Transient map may not be set to null"); } this.transientMap = transientMap; }
[ "public", "void", "setTransientMap", "(", "Map", "<", "String", ",", "byte", "[", "]", ">", "transientMap", ")", "throws", "InvalidArgumentException", "{", "if", "(", "null", "==", "transientMap", ")", "{", "throw", "new", "InvalidArgumentException", "(", "\"T...
Transient data added to the proposal that is not added to the ledger. @param transientMap Map of strings to bytes that's added to the proposal @throws InvalidArgumentException if the argument is null.
[ "Transient", "data", "added", "to", "the", "proposal", "that", "is", "not", "added", "to", "the", "ledger", "." ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/UpgradeProposalRequest.java#L37-L44
21,992
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/LifecycleChaincodeEndorsementPolicy.java
LifecycleChaincodeEndorsementPolicy.fromStream
public static LifecycleChaincodeEndorsementPolicy fromStream(InputStream inputStream) throws IOException { return new LifecycleChaincodeEndorsementPolicy(ByteString.copyFrom(IOUtils.toByteArray(inputStream))); }
java
public static LifecycleChaincodeEndorsementPolicy fromStream(InputStream inputStream) throws IOException { return new LifecycleChaincodeEndorsementPolicy(ByteString.copyFrom(IOUtils.toByteArray(inputStream))); }
[ "public", "static", "LifecycleChaincodeEndorsementPolicy", "fromStream", "(", "InputStream", "inputStream", ")", "throws", "IOException", "{", "return", "new", "LifecycleChaincodeEndorsementPolicy", "(", "ByteString", ".", "copyFrom", "(", "IOUtils", ".", "toByteArray", "...
Construct a chaincode endorsement policy from a stream. @param inputStream @throws IOException
[ "Construct", "a", "chaincode", "endorsement", "policy", "from", "a", "stream", "." ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/LifecycleChaincodeEndorsementPolicy.java#L262-L264
21,993
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/LifecycleApproveChaincodeDefinitionForMyOrgRequest.java
LifecycleApproveChaincodeDefinitionForMyOrgRequest.setChaincodeName
public void setChaincodeName(String chaincodeName) throws InvalidArgumentException { if (Utils.isNullOrEmpty(chaincodeName)) { throw new InvalidArgumentException("The chaincodeName parameter can not be null or empty."); } this.chaincodeName = chaincodeName; }
java
public void setChaincodeName(String chaincodeName) throws InvalidArgumentException { if (Utils.isNullOrEmpty(chaincodeName)) { throw new InvalidArgumentException("The chaincodeName parameter can not be null or empty."); } this.chaincodeName = chaincodeName; }
[ "public", "void", "setChaincodeName", "(", "String", "chaincodeName", ")", "throws", "InvalidArgumentException", "{", "if", "(", "Utils", ".", "isNullOrEmpty", "(", "chaincodeName", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "\"The chaincodeName p...
The name of the chaincode to approve. @param chaincodeName
[ "The", "name", "of", "the", "chaincode", "to", "approve", "." ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/LifecycleApproveChaincodeDefinitionForMyOrgRequest.java#L109-L114
21,994
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/LifecycleApproveChaincodeDefinitionForMyOrgRequest.java
LifecycleApproveChaincodeDefinitionForMyOrgRequest.setChaincodeVersion
public void setChaincodeVersion(String chaincodeVersion) throws InvalidArgumentException { if (Utils.isNullOrEmpty(chaincodeVersion)) { throw new InvalidArgumentException("The chaincodeVersion parameter can not be null or empty."); } this.chaincodeVersion = chaincodeVersion; }
java
public void setChaincodeVersion(String chaincodeVersion) throws InvalidArgumentException { if (Utils.isNullOrEmpty(chaincodeVersion)) { throw new InvalidArgumentException("The chaincodeVersion parameter can not be null or empty."); } this.chaincodeVersion = chaincodeVersion; }
[ "public", "void", "setChaincodeVersion", "(", "String", "chaincodeVersion", ")", "throws", "InvalidArgumentException", "{", "if", "(", "Utils", ".", "isNullOrEmpty", "(", "chaincodeVersion", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "\"The chainc...
The version of the chaincode to approve. @param chaincodeVersion the version.
[ "The", "version", "of", "the", "chaincode", "to", "approve", "." ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/LifecycleApproveChaincodeDefinitionForMyOrgRequest.java#L127-L133
21,995
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/LifecycleApproveChaincodeDefinitionForMyOrgRequest.java
LifecycleApproveChaincodeDefinitionForMyOrgRequest.setChaincodeEndorsementPlugin
public void setChaincodeEndorsementPlugin(String chaincodeEndorsementPlugin) throws InvalidArgumentException { if (Utils.isNullOrEmpty(chaincodeEndorsementPlugin)) { throw new InvalidArgumentException("The getChaincodeEndorsementPlugin parameter can not be null or empty."); } this.ch...
java
public void setChaincodeEndorsementPlugin(String chaincodeEndorsementPlugin) throws InvalidArgumentException { if (Utils.isNullOrEmpty(chaincodeEndorsementPlugin)) { throw new InvalidArgumentException("The getChaincodeEndorsementPlugin parameter can not be null or empty."); } this.ch...
[ "public", "void", "setChaincodeEndorsementPlugin", "(", "String", "chaincodeEndorsementPlugin", ")", "throws", "InvalidArgumentException", "{", "if", "(", "Utils", ".", "isNullOrEmpty", "(", "chaincodeEndorsementPlugin", ")", ")", "{", "throw", "new", "InvalidArgumentExce...
This is the chaincode endorsement plugin. Should default, not needing set. ONLY set if there is a specific endorsement is set for your organization @param chaincodeEndorsementPlugin @throws InvalidArgumentException
[ "This", "is", "the", "chaincode", "endorsement", "plugin", ".", "Should", "default", "not", "needing", "set", ".", "ONLY", "set", "if", "there", "is", "a", "specific", "endorsement", "is", "set", "for", "your", "organization" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/LifecycleApproveChaincodeDefinitionForMyOrgRequest.java#L207-L212
21,996
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/LifecycleApproveChaincodeDefinitionForMyOrgRequest.java
LifecycleApproveChaincodeDefinitionForMyOrgRequest.setChaincodeValidationPlugin
public void setChaincodeValidationPlugin(String chaincodeValidationPlugin) throws InvalidArgumentException { if (Utils.isNullOrEmpty(chaincodeValidationPlugin)) { throw new InvalidArgumentException("The getChaincodeValidationPlugin parameter can not be null or empty."); } this.chainc...
java
public void setChaincodeValidationPlugin(String chaincodeValidationPlugin) throws InvalidArgumentException { if (Utils.isNullOrEmpty(chaincodeValidationPlugin)) { throw new InvalidArgumentException("The getChaincodeValidationPlugin parameter can not be null or empty."); } this.chainc...
[ "public", "void", "setChaincodeValidationPlugin", "(", "String", "chaincodeValidationPlugin", ")", "throws", "InvalidArgumentException", "{", "if", "(", "Utils", ".", "isNullOrEmpty", "(", "chaincodeValidationPlugin", ")", ")", "{", "throw", "new", "InvalidArgumentExcepti...
This is the chaincode validation plugin. Should default, not needing set. ONLY set if there is a specific validation is set for your organization @param chaincodeValidationPlugin @throws InvalidArgumentException
[ "This", "is", "the", "chaincode", "validation", "plugin", ".", "Should", "default", "not", "needing", "set", ".", "ONLY", "set", "if", "there", "is", "a", "specific", "validation", "is", "set", "for", "your", "organization" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/LifecycleApproveChaincodeDefinitionForMyOrgRequest.java#L220-L225
21,997
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/UpdateChannelConfiguration.java
UpdateChannelConfiguration.setUpdateChannelConfiguration
public void setUpdateChannelConfiguration(byte[] updateChannelConfigurationAsBytes) throws InvalidArgumentException { if (updateChannelConfigurationAsBytes == null) { throw new InvalidArgumentException("UpdateChannelConfiguration updateChannelConfigurationAsBytes must be non-null"); } ...
java
public void setUpdateChannelConfiguration(byte[] updateChannelConfigurationAsBytes) throws InvalidArgumentException { if (updateChannelConfigurationAsBytes == null) { throw new InvalidArgumentException("UpdateChannelConfiguration updateChannelConfigurationAsBytes must be non-null"); } ...
[ "public", "void", "setUpdateChannelConfiguration", "(", "byte", "[", "]", "updateChannelConfigurationAsBytes", ")", "throws", "InvalidArgumentException", "{", "if", "(", "updateChannelConfigurationAsBytes", "==", "null", ")", "{", "throw", "new", "InvalidArgumentException",...
sets the UpdateChannelConfiguration from a byte array @param updateChannelConfigurationAsBytes the byte array containing the serialized channel configuration
[ "sets", "the", "UpdateChannelConfiguration", "from", "a", "byte", "array" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/UpdateChannelConfiguration.java#L84-L90
21,998
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/Peer.java
Peer.setChannel
void setChannel(Channel channel) throws InvalidArgumentException { if (null != this.channel) { throw new InvalidArgumentException(format("Can not add peer %s to channel %s because it already belongs to channel %s.", name, channel.getName(), this.channel.getName())); } ...
java
void setChannel(Channel channel) throws InvalidArgumentException { if (null != this.channel) { throw new InvalidArgumentException(format("Can not add peer %s to channel %s because it already belongs to channel %s.", name, channel.getName(), this.channel.getName())); } ...
[ "void", "setChannel", "(", "Channel", "channel", ")", "throws", "InvalidArgumentException", "{", "if", "(", "null", "!=", "this", ".", "channel", ")", "{", "throw", "new", "InvalidArgumentException", "(", "format", "(", "\"Can not add peer %s to channel %s because it ...
Set the channel the peer is on. @param channel
[ "Set", "the", "channel", "the", "peer", "is", "on", "." ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/Peer.java#L175-L186
21,999
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/Peer.java
Peer.setPeerEventingServiceDisconnected
public PeerEventingServiceDisconnected setPeerEventingServiceDisconnected(PeerEventingServiceDisconnected newPeerEventingServiceDisconnectedHandler) { PeerEventingServiceDisconnected ret = disconnectedHandler; disconnectedHandler = newPeerEventingServiceDisconnectedHandler; return ret; }
java
public PeerEventingServiceDisconnected setPeerEventingServiceDisconnected(PeerEventingServiceDisconnected newPeerEventingServiceDisconnectedHandler) { PeerEventingServiceDisconnected ret = disconnectedHandler; disconnectedHandler = newPeerEventingServiceDisconnectedHandler; return ret; }
[ "public", "PeerEventingServiceDisconnected", "setPeerEventingServiceDisconnected", "(", "PeerEventingServiceDisconnected", "newPeerEventingServiceDisconnectedHandler", ")", "{", "PeerEventingServiceDisconnected", "ret", "=", "disconnectedHandler", ";", "disconnectedHandler", "=", "newP...
Set class to handle peer eventing service disconnects @param newPeerEventingServiceDisconnectedHandler New handler to replace. If set to null no retry will take place. @return the old handler.
[ "Set", "class", "to", "handle", "peer", "eventing", "service", "disconnects" ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/Peer.java#L588-L592