repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
pravega/pravega | controller/src/main/java/io/pravega/controller/store/stream/records/RecordHelper.java | RecordHelper.canScaleFor | public static boolean canScaleFor(final List<Long> segmentsToSeal, final EpochRecord currentEpoch) {
"""
Method to check that segments to seal are present in current epoch.
@param segmentsToSeal segments to seal
@param currentEpoch current epoch record
@return true if a scale operation can be performed, false... | java | public static boolean canScaleFor(final List<Long> segmentsToSeal, final EpochRecord currentEpoch) {
return segmentsToSeal.stream().allMatch(x -> currentEpoch.getSegment(x) != null);
} | [
"public",
"static",
"boolean",
"canScaleFor",
"(",
"final",
"List",
"<",
"Long",
">",
"segmentsToSeal",
",",
"final",
"EpochRecord",
"currentEpoch",
")",
"{",
"return",
"segmentsToSeal",
".",
"stream",
"(",
")",
".",
"allMatch",
"(",
"x",
"->",
"currentEpoch",... | Method to check that segments to seal are present in current epoch.
@param segmentsToSeal segments to seal
@param currentEpoch current epoch record
@return true if a scale operation can be performed, false otherwise | [
"Method",
"to",
"check",
"that",
"segments",
"to",
"seal",
"are",
"present",
"in",
"current",
"epoch",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/records/RecordHelper.java#L71-L73 |
Impetus/Kundera | src/kundera-mongo/src/main/java/com/impetus/client/mongodb/schemamanager/MongoDBSchemaManager.java | MongoDBSchemaManager.initiateClient | protected boolean initiateClient() {
"""
initiate client method initiates the client.
@return boolean value ie client started or not.
"""
for (String host : hosts)
{
if (host == null || !StringUtils.isNumeric(port) || port.isEmpty())
{
logger.error("Ho... | java | protected boolean initiateClient()
{
for (String host : hosts)
{
if (host == null || !StringUtils.isNumeric(port) || port.isEmpty())
{
logger.error("Host or port should not be null / port should be numeric");
throw new IllegalArgumentException(... | [
"protected",
"boolean",
"initiateClient",
"(",
")",
"{",
"for",
"(",
"String",
"host",
":",
"hosts",
")",
"{",
"if",
"(",
"host",
"==",
"null",
"||",
"!",
"StringUtils",
".",
"isNumeric",
"(",
"port",
")",
"||",
"port",
".",
"isEmpty",
"(",
")",
")",... | initiate client method initiates the client.
@return boolean value ie client started or not. | [
"initiate",
"client",
"method",
"initiates",
"the",
"client",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-mongo/src/main/java/com/impetus/client/mongodb/schemamanager/MongoDBSchemaManager.java#L303-L330 |
oboehm/jfachwert | src/main/java/de/jfachwert/post/Adresse.java | Adresse.validate | public static void validate(Ort ort, String strasse, String hausnummer) {
"""
Validiert die uebergebene Adresse auf moegliche Fehler.
@param ort der Ort
@param strasse die Strasse
@param hausnummer die Hausnummer
"""
if (StringUtils.isBlank(strasse)) {
throw new InvalidValueE... | java | public static void validate(Ort ort, String strasse, String hausnummer) {
if (StringUtils.isBlank(strasse)) {
throw new InvalidValueException(strasse, "street");
}
validate(ort, strasse, hausnummer, VALIDATOR);
} | [
"public",
"static",
"void",
"validate",
"(",
"Ort",
"ort",
",",
"String",
"strasse",
",",
"String",
"hausnummer",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"strasse",
")",
")",
"{",
"throw",
"new",
"InvalidValueException",
"(",
"strasse",
",... | Validiert die uebergebene Adresse auf moegliche Fehler.
@param ort der Ort
@param strasse die Strasse
@param hausnummer die Hausnummer | [
"Validiert",
"die",
"uebergebene",
"Adresse",
"auf",
"moegliche",
"Fehler",
"."
] | train | https://github.com/oboehm/jfachwert/blob/67b513d29e3114c7aee65cd1ea7a5b7e540b0d1b/src/main/java/de/jfachwert/post/Adresse.java#L187-L192 |
cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/AtomSymbol.java | AtomSymbol.alignTo | AtomSymbol alignTo(SymbolAlignment alignment) {
"""
Create a new atom symbol (from this symbol) but with the specified
alignment.
@param alignment element alignment
@return new atom symbol
"""
return new AtomSymbol(element, adjuncts, annotationAdjuncts, alignment, hull);
} | java | AtomSymbol alignTo(SymbolAlignment alignment) {
return new AtomSymbol(element, adjuncts, annotationAdjuncts, alignment, hull);
} | [
"AtomSymbol",
"alignTo",
"(",
"SymbolAlignment",
"alignment",
")",
"{",
"return",
"new",
"AtomSymbol",
"(",
"element",
",",
"adjuncts",
",",
"annotationAdjuncts",
",",
"alignment",
",",
"hull",
")",
";",
"}"
] | Create a new atom symbol (from this symbol) but with the specified
alignment.
@param alignment element alignment
@return new atom symbol | [
"Create",
"a",
"new",
"atom",
"symbol",
"(",
"from",
"this",
"symbol",
")",
"but",
"with",
"the",
"specified",
"alignment",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/AtomSymbol.java#L117-L119 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/serde/binary/BinarySerde.java | BinarySerde.writeArrayToOutputStream | public static void writeArrayToOutputStream(INDArray arr, OutputStream outputStream) {
"""
Write an array to an output stream.
@param arr the array to write
@param outputStream the output stream to write to
"""
ByteBuffer buffer = BinarySerde.toByteBuffer(arr);
try (WritableByteChannel channe... | java | public static void writeArrayToOutputStream(INDArray arr, OutputStream outputStream) {
ByteBuffer buffer = BinarySerde.toByteBuffer(arr);
try (WritableByteChannel channel = Channels.newChannel(outputStream)) {
channel.write(buffer);
} catch (IOException e) {
e.printStackT... | [
"public",
"static",
"void",
"writeArrayToOutputStream",
"(",
"INDArray",
"arr",
",",
"OutputStream",
"outputStream",
")",
"{",
"ByteBuffer",
"buffer",
"=",
"BinarySerde",
".",
"toByteBuffer",
"(",
"arr",
")",
";",
"try",
"(",
"WritableByteChannel",
"channel",
"=",... | Write an array to an output stream.
@param arr the array to write
@param outputStream the output stream to write to | [
"Write",
"an",
"array",
"to",
"an",
"output",
"stream",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/serde/binary/BinarySerde.java#L260-L267 |
tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/ui/UTCDateTimeRangeController.java | UTCDateTimeRangeController.setCombinedValue | private void setCombinedValue(UTCDateBox date, UTCTimeBox time, long value, boolean setTimeValue) {
"""
This allows us to treat a datetime as a single value, making it
easy for comparison and adjustment. We don't actually expose
this because the timezone issues make it too confusing to
clients.
@param setTim... | java | private void setCombinedValue(UTCDateBox date, UTCTimeBox time, long value, boolean setTimeValue) {
date.setValue(datePartMillis(value), false);
if (setTimeValue) {
time.setValue(timePartMillis(value), false);
}
} | [
"private",
"void",
"setCombinedValue",
"(",
"UTCDateBox",
"date",
",",
"UTCTimeBox",
"time",
",",
"long",
"value",
",",
"boolean",
"setTimeValue",
")",
"{",
"date",
".",
"setValue",
"(",
"datePartMillis",
"(",
"value",
")",
",",
"false",
")",
";",
"if",
"(... | This allows us to treat a datetime as a single value, making it
easy for comparison and adjustment. We don't actually expose
this because the timezone issues make it too confusing to
clients.
@param setTimeValue
Sometimes we don't want to set the time value
explicitly. Generally this is the case when we
haven't specif... | [
"This",
"allows",
"us",
"to",
"treat",
"a",
"datetime",
"as",
"a",
"single",
"value",
"making",
"it",
"easy",
"for",
"comparison",
"and",
"adjustment",
".",
"We",
"don",
"t",
"actually",
"expose",
"this",
"because",
"the",
"timezone",
"issues",
"make",
"it... | train | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/ui/UTCDateTimeRangeController.java#L234-L239 |
jOOQ/jOOL | jOOL-java-8/src/main/java/org/jooq/lambda/Agg.java | Agg.maxAll | public static <T extends Comparable<? super T>> Collector<T, ?, Seq<T>> maxAll() {
"""
Get a {@link Collector} that calculates the <code>MAX()</code> function, producing multiple results.
"""
return maxAllBy(t -> t, naturalOrder());
} | java | public static <T extends Comparable<? super T>> Collector<T, ?, Seq<T>> maxAll() {
return maxAllBy(t -> t, naturalOrder());
} | [
"public",
"static",
"<",
"T",
"extends",
"Comparable",
"<",
"?",
"super",
"T",
">",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"Seq",
"<",
"T",
">",
">",
"maxAll",
"(",
")",
"{",
"return",
"maxAllBy",
"(",
"t",
"->",
"t",
",",
"naturalOrder",
"("... | Get a {@link Collector} that calculates the <code>MAX()</code> function, producing multiple results. | [
"Get",
"a",
"{"
] | train | https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Agg.java#L329-L331 |
apache/reef | lang/java/reef-runtime-multi/src/main/java/org/apache/reef/runtime/multi/client/MultiRuntimeDefinitionBuilder.java | MultiRuntimeDefinitionBuilder.addRuntime | public MultiRuntimeDefinitionBuilder addRuntime(final Configuration config, final String runtimeName) {
"""
Adds runtime configuration module to the builder.
@param config The configuration module
@param runtimeName The name of the runtime
@return The builder instance
"""
Validate.notNull(config, "runti... | java | public MultiRuntimeDefinitionBuilder addRuntime(final Configuration config, final String runtimeName){
Validate.notNull(config, "runtime configuration module should not be null");
Validate.isTrue(StringUtils.isNotBlank(runtimeName),
"runtimeName should be non empty and non blank string");
final ... | [
"public",
"MultiRuntimeDefinitionBuilder",
"addRuntime",
"(",
"final",
"Configuration",
"config",
",",
"final",
"String",
"runtimeName",
")",
"{",
"Validate",
".",
"notNull",
"(",
"config",
",",
"\"runtime configuration module should not be null\"",
")",
";",
"Validate",
... | Adds runtime configuration module to the builder.
@param config The configuration module
@param runtimeName The name of the runtime
@return The builder instance | [
"Adds",
"runtime",
"configuration",
"module",
"to",
"the",
"builder",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-multi/src/main/java/org/apache/reef/runtime/multi/client/MultiRuntimeDefinitionBuilder.java#L55-L62 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/af_config_info.java | af_config_info.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
af_config_info_responses result = (af_config_info_responses) service.ge... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
af_config_info_responses result = (af_config_info_responses) service.get_payload_formatter().string_to_resource(af_config_info_responses.class, response);
if(result.errorcode != 0)
{
if (result.er... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"af_config_info_responses",
"result",
"=",
"(",
"af_config_info_responses",
")",
"service",
".",
"get_payload_... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/af_config_info.java#L262-L279 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.putAt | public static void putAt(List self, EmptyRange range, Collection value) {
"""
A helper method to allow lists to work with subscript operators.
<pre class="groovyTestCase">
def list = ["a", true]
{@code list[1..<1] = [4, 3, 2]}
assert list == ["a", 4, 3, 2, true]
</pre>
@param self a List
@param range the... | java | public static void putAt(List self, EmptyRange range, Collection value) {
putAt(self, range, (Object)value);
} | [
"public",
"static",
"void",
"putAt",
"(",
"List",
"self",
",",
"EmptyRange",
"range",
",",
"Collection",
"value",
")",
"{",
"putAt",
"(",
"self",
",",
"range",
",",
"(",
"Object",
")",
"value",
")",
";",
"}"
] | A helper method to allow lists to work with subscript operators.
<pre class="groovyTestCase">
def list = ["a", true]
{@code list[1..<1] = [4, 3, 2]}
assert list == ["a", 4, 3, 2, true]
</pre>
@param self a List
@param range the (in this case empty) subset of the list to set
@param value the Collection of values
@sinc... | [
"A",
"helper",
"method",
"to",
"allow",
"lists",
"to",
"work",
"with",
"subscript",
"operators",
".",
"<pre",
"class",
"=",
"groovyTestCase",
">",
"def",
"list",
"=",
"[",
"a",
"true",
"]",
"{",
"@code",
"list",
"[",
"1",
"..",
"<1",
"]",
"=",
"[",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L8012-L8014 |
apache/spark | sql/catalyst/src/main/java/org/apache/spark/sql/util/CaseInsensitiveStringMap.java | CaseInsensitiveStringMap.getDouble | public double getDouble(String key, double defaultValue) {
"""
Returns the double value to which the specified key is mapped,
or defaultValue if there is no mapping for the key. The key match is case-insensitive.
"""
String value = get(key);
return value == null ? defaultValue : Double.parseDouble(val... | java | public double getDouble(String key, double defaultValue) {
String value = get(key);
return value == null ? defaultValue : Double.parseDouble(value);
} | [
"public",
"double",
"getDouble",
"(",
"String",
"key",
",",
"double",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"get",
"(",
"key",
")",
";",
"return",
"value",
"==",
"null",
"?",
"defaultValue",
":",
"Double",
".",
"parseDouble",
"(",
"value",
")... | Returns the double value to which the specified key is mapped,
or defaultValue if there is no mapping for the key. The key match is case-insensitive. | [
"Returns",
"the",
"double",
"value",
"to",
"which",
"the",
"specified",
"key",
"is",
"mapped",
"or",
"defaultValue",
"if",
"there",
"is",
"no",
"mapping",
"for",
"the",
"key",
".",
"The",
"key",
"match",
"is",
"case",
"-",
"insensitive",
"."
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/catalyst/src/main/java/org/apache/spark/sql/util/CaseInsensitiveStringMap.java#L170-L173 |
ronmamo/reflections | src/main/java/org/reflections/Store.java | Store.getAll | public Iterable<String> getAll(String index, String key) {
"""
recursively get the values stored for the given {@code index} and {@code keys}, not including keys
"""
return getAllIncluding(index, get(index, key), new IterableChain<String>());
} | java | public Iterable<String> getAll(String index, String key) {
return getAllIncluding(index, get(index, key), new IterableChain<String>());
} | [
"public",
"Iterable",
"<",
"String",
">",
"getAll",
"(",
"String",
"index",
",",
"String",
"key",
")",
"{",
"return",
"getAllIncluding",
"(",
"index",
",",
"get",
"(",
"index",
",",
"key",
")",
",",
"new",
"IterableChain",
"<",
"String",
">",
"(",
")",... | recursively get the values stored for the given {@code index} and {@code keys}, not including keys | [
"recursively",
"get",
"the",
"values",
"stored",
"for",
"the",
"given",
"{"
] | train | https://github.com/ronmamo/reflections/blob/084cf4a759a06d88e88753ac00397478c2e0ed52/src/main/java/org/reflections/Store.java#L91-L93 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/util/JsonUtil.java | JsonUtil.getLong | public static long getLong(JsonObject object, String field) {
"""
Returns a field in a Json object as a long.
Throws IllegalArgumentException if the field value is null.
@param object the Json Object
@param field the field in the Json object to return
@return the Json field value as a long
"""
fi... | java | public static long getLong(JsonObject object, String field) {
final JsonValue value = object.get(field);
throwExceptionIfNull(value, field);
return value.asLong();
} | [
"public",
"static",
"long",
"getLong",
"(",
"JsonObject",
"object",
",",
"String",
"field",
")",
"{",
"final",
"JsonValue",
"value",
"=",
"object",
".",
"get",
"(",
"field",
")",
";",
"throwExceptionIfNull",
"(",
"value",
",",
"field",
")",
";",
"return",
... | Returns a field in a Json object as a long.
Throws IllegalArgumentException if the field value is null.
@param object the Json Object
@param field the field in the Json object to return
@return the Json field value as a long | [
"Returns",
"a",
"field",
"in",
"a",
"Json",
"object",
"as",
"a",
"long",
".",
"Throws",
"IllegalArgumentException",
"if",
"the",
"field",
"value",
"is",
"null",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/JsonUtil.java#L76-L80 |
deeplearning4j/deeplearning4j | datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java | ArrowConverter.readFromFile | public static Pair<Schema,ArrowWritableRecordBatch> readFromFile(FileInputStream input) throws IOException {
"""
Read a datavec schema and record set
from the given arrow file.
@param input the input to read
@return the associated datavec schema and record
"""
BufferAllocator allocator = new RootAll... | java | public static Pair<Schema,ArrowWritableRecordBatch> readFromFile(FileInputStream input) throws IOException {
BufferAllocator allocator = new RootAllocator(Long.MAX_VALUE);
Schema retSchema = null;
ArrowWritableRecordBatch ret = null;
SeekableReadChannel channel = new SeekableReadChannel(... | [
"public",
"static",
"Pair",
"<",
"Schema",
",",
"ArrowWritableRecordBatch",
">",
"readFromFile",
"(",
"FileInputStream",
"input",
")",
"throws",
"IOException",
"{",
"BufferAllocator",
"allocator",
"=",
"new",
"RootAllocator",
"(",
"Long",
".",
"MAX_VALUE",
")",
";... | Read a datavec schema and record set
from the given arrow file.
@param input the input to read
@return the associated datavec schema and record | [
"Read",
"a",
"datavec",
"schema",
"and",
"record",
"set",
"from",
"the",
"given",
"arrow",
"file",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java#L360-L379 |
alibaba/canal | dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/RowsLogBuffer.java | RowsLogBuffer.nextValue | public final Serializable nextValue(final String columName, final int columnIndex, final int type, final int meta) {
"""
Extracting next field value from packed buffer.
@see mysql-5.1.60/sql/log_event.cc -
Rows_log_event::print_verbose_one_row
"""
return nextValue(columName, columnIndex, type, met... | java | public final Serializable nextValue(final String columName, final int columnIndex, final int type, final int meta) {
return nextValue(columName, columnIndex, type, meta, false);
} | [
"public",
"final",
"Serializable",
"nextValue",
"(",
"final",
"String",
"columName",
",",
"final",
"int",
"columnIndex",
",",
"final",
"int",
"type",
",",
"final",
"int",
"meta",
")",
"{",
"return",
"nextValue",
"(",
"columName",
",",
"columnIndex",
",",
"ty... | Extracting next field value from packed buffer.
@see mysql-5.1.60/sql/log_event.cc -
Rows_log_event::print_verbose_one_row | [
"Extracting",
"next",
"field",
"value",
"from",
"packed",
"buffer",
"."
] | train | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/RowsLogBuffer.java#L104-L106 |
mojohaus/jaxb2-maven-plugin | src/main/java/org/codehaus/mojo/jaxb2/schemageneration/postprocessing/javadoc/DomHelper.java | DomHelper.getFieldLocation | public static FieldLocation getFieldLocation(final Node aNode, final Set<FieldLocation> fieldLocations) {
"""
Retrieves a FieldLocation from the supplied Set, provided that the FieldLocation matches the supplied Node.
@param aNode The non-null Node.
@param fieldLocations The Set of known/found FieldLo... | java | public static FieldLocation getFieldLocation(final Node aNode, final Set<FieldLocation> fieldLocations) {
FieldLocation toReturn = null;
if (aNode != null) {
if (CLASS_FIELD_METHOD_ELEMENT_NAMES.contains(aNode.getLocalName().toLowerCase())) {
// This is a ComplexType whic... | [
"public",
"static",
"FieldLocation",
"getFieldLocation",
"(",
"final",
"Node",
"aNode",
",",
"final",
"Set",
"<",
"FieldLocation",
">",
"fieldLocations",
")",
"{",
"FieldLocation",
"toReturn",
"=",
"null",
";",
"if",
"(",
"aNode",
"!=",
"null",
")",
"{",
"if... | Retrieves a FieldLocation from the supplied Set, provided that the FieldLocation matches the supplied Node.
@param aNode The non-null Node.
@param fieldLocations The Set of known/found FieldLocation instances.
@return The FieldLocation corresponding to the supplied DOM Node. | [
"Retrieves",
"a",
"FieldLocation",
"from",
"the",
"supplied",
"Set",
"provided",
"that",
"the",
"FieldLocation",
"matches",
"the",
"supplied",
"Node",
"."
] | train | https://github.com/mojohaus/jaxb2-maven-plugin/blob/e3c4e47943b15282e5a6e850bbfb1588d8452a0a/src/main/java/org/codehaus/mojo/jaxb2/schemageneration/postprocessing/javadoc/DomHelper.java#L281-L300 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/runtime/JCuda.java | JCuda.cudaMemRangeGetAttributes | public static int cudaMemRangeGetAttributes(Pointer data[], long dataSizes[], int attributes[], long numAttributes, Pointer devPtr, long count) {
"""
Query attributes of a given memory range.<br>
<br>
Query attributes of the memory range starting at devPtr with a size of
count bytes. The memory range must refer... | java | public static int cudaMemRangeGetAttributes(Pointer data[], long dataSizes[], int attributes[], long numAttributes, Pointer devPtr, long count)
{
return checkResult(cudaMemRangeGetAttributesNative(data, dataSizes, attributes, numAttributes, devPtr, count));
} | [
"public",
"static",
"int",
"cudaMemRangeGetAttributes",
"(",
"Pointer",
"data",
"[",
"]",
",",
"long",
"dataSizes",
"[",
"]",
",",
"int",
"attributes",
"[",
"]",
",",
"long",
"numAttributes",
",",
"Pointer",
"devPtr",
",",
"long",
"count",
")",
"{",
"retur... | Query attributes of a given memory range.<br>
<br>
Query attributes of the memory range starting at devPtr with a size of
count bytes. The memory range must refer to managed memory allocated via
cudaMallocManaged or declared via __managed__ variables. The attributes
array will be interpreted to have numAttributes entri... | [
"Query",
"attributes",
"of",
"a",
"given",
"memory",
"range",
".",
"<br",
">",
"<br",
">",
"Query",
"attributes",
"of",
"the",
"memory",
"range",
"starting",
"at",
"devPtr",
"with",
"a",
"size",
"of",
"count",
"bytes",
".",
"The",
"memory",
"range",
"mus... | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/runtime/JCuda.java#L8981-L8984 |
igniterealtime/Smack | smack-debug/src/main/java/org/jivesoftware/smackx/debugger/EnhancedDebuggerWindow.java | EnhancedDebuggerWindow.userHasLogged | static synchronized void userHasLogged(EnhancedDebugger debugger, String user) {
"""
Notification that a user has logged in to the server. A new title will be set
to the tab of the given debugger.
@param debugger the debugger whose connection logged in to the server
@param user the user@host/resource that... | java | static synchronized void userHasLogged(EnhancedDebugger debugger, String user) {
int index = getInstance().tabbedPane.indexOfComponent(debugger.tabbedPane);
getInstance().tabbedPane.setTitleAt(
index,
user);
getInstance().tabbedPane.setIconAt(
inde... | [
"static",
"synchronized",
"void",
"userHasLogged",
"(",
"EnhancedDebugger",
"debugger",
",",
"String",
"user",
")",
"{",
"int",
"index",
"=",
"getInstance",
"(",
")",
".",
"tabbedPane",
".",
"indexOfComponent",
"(",
"debugger",
".",
"tabbedPane",
")",
";",
"ge... | Notification that a user has logged in to the server. A new title will be set
to the tab of the given debugger.
@param debugger the debugger whose connection logged in to the server
@param user the user@host/resource that has just logged in | [
"Notification",
"that",
"a",
"user",
"has",
"logged",
"in",
"to",
"the",
"server",
".",
"A",
"new",
"title",
"will",
"be",
"set",
"to",
"the",
"tab",
"of",
"the",
"given",
"debugger",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-debug/src/main/java/org/jivesoftware/smackx/debugger/EnhancedDebuggerWindow.java#L159-L167 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ModelConstraints.java | ModelConstraints.checkKeyModifications | private void checkKeyModifications(ModelDef modelDef, String checkLevel) throws ConstraintException {
"""
Checks the modifications of fields used as foreignkeys in references/collections or the corresponding primarykeys,
e.g. that the jdbc-type is not changed etc.
@param modelDef The model to check
@param c... | java | private void checkKeyModifications(ModelDef modelDef, String checkLevel) throws ConstraintException
{
if (CHECKLEVEL_NONE.equals(checkLevel))
{
return;
}
ClassDescriptorDef classDef;
FieldDescriptorDef fieldDef;
// we check for every inherited ... | [
"private",
"void",
"checkKeyModifications",
"(",
"ModelDef",
"modelDef",
",",
"String",
"checkLevel",
")",
"throws",
"ConstraintException",
"{",
"if",
"(",
"CHECKLEVEL_NONE",
".",
"equals",
"(",
"checkLevel",
")",
")",
"{",
"return",
";",
"}",
"ClassDescriptorDef"... | Checks the modifications of fields used as foreignkeys in references/collections or the corresponding primarykeys,
e.g. that the jdbc-type is not changed etc.
@param modelDef The model to check
@param checkLevel The current check level (this constraint is checked in basic and strict)
@throws ConstraintException If s... | [
"Checks",
"the",
"modifications",
"of",
"fields",
"used",
"as",
"foreignkeys",
"in",
"references",
"/",
"collections",
"or",
"the",
"corresponding",
"primarykeys",
"e",
".",
"g",
".",
"that",
"the",
"jdbc",
"-",
"type",
"is",
"not",
"changed",
"etc",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ModelConstraints.java#L715-L738 |
pravega/pravega | controller/src/main/java/io/pravega/controller/store/checkpoint/ZKCheckpointStore.java | ZKCheckpointStore.updateReaderGroupData | private void updateReaderGroupData(String path, Function<ReaderGroupData, ReaderGroupData> updater) throws Exception {
"""
Updates the reader group data at specified path by applying the updater method on the existing data.
It repeatedly invokes conditional update on specified path until is succeeds or max attemp... | java | private void updateReaderGroupData(String path, Function<ReaderGroupData, ReaderGroupData> updater) throws Exception {
final long initialMillis = 100L;
final int multiplier = 2;
final int attempts = 10;
final long maxDelay = 2000;
Stat stat = new Stat();
Retry.withExpBa... | [
"private",
"void",
"updateReaderGroupData",
"(",
"String",
"path",
",",
"Function",
"<",
"ReaderGroupData",
",",
"ReaderGroupData",
">",
"updater",
")",
"throws",
"Exception",
"{",
"final",
"long",
"initialMillis",
"=",
"100L",
";",
"final",
"int",
"multiplier",
... | Updates the reader group data at specified path by applying the updater method on the existing data.
It repeatedly invokes conditional update on specified path until is succeeds or max attempts (10) are exhausted.
@param path Reader group node path.
@param updater Function to obtain the new data value from existing da... | [
"Updates",
"the",
"reader",
"group",
"data",
"at",
"specified",
"path",
"by",
"applying",
"the",
"updater",
"method",
"on",
"the",
"existing",
"data",
".",
"It",
"repeatedly",
"invokes",
"conditional",
"update",
"on",
"specified",
"path",
"until",
"is",
"succe... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/checkpoint/ZKCheckpointStore.java#L244-L267 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/ProjectApi.java | ProjectApi.shareProject | public void shareProject(Object projectIdOrPath, Integer groupId, AccessLevel accessLevel, Date expiresAt)
throws GitLabApiException {
"""
Share a project with the specified group.
<pre><code>POST /projects/:id/share</code></pre>
@param projectIdOrPath projectIdOrPath the project in the form of a... | java | public void shareProject(Object projectIdOrPath, Integer groupId, AccessLevel accessLevel, Date expiresAt)
throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm()
.withParam("group_id", groupId, true)
.withParam("group_access", accessLevel, true)
... | [
"public",
"void",
"shareProject",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"groupId",
",",
"AccessLevel",
"accessLevel",
",",
"Date",
"expiresAt",
")",
"throws",
"GitLabApiException",
"{",
"GitLabApiForm",
"formData",
"=",
"new",
"GitLabApiForm",
"(",
")",
... | Share a project with the specified group.
<pre><code>POST /projects/:id/share</code></pre>
@param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
@param groupId the ID of the group to share with, required
@param accessLevel the permissions level t... | [
"Share",
"a",
"project",
"with",
"the",
"specified",
"group",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ProjectApi.java#L2082-L2089 |
deeplearning4j/deeplearning4j | datavec/datavec-spark/src/main/java/org/datavec/spark/transform/utils/SparkUtils.java | SparkUtils.writeObjectToFile | public static void writeObjectToFile(String path, Object toWrite, JavaSparkContext sc) throws IOException {
"""
Write an object to HDFS (or local) using default Java object serialization
@param path Path to write the object to
@param toWrite Object to write
@param sc Spark context
"""
... | java | public static void writeObjectToFile(String path, Object toWrite, JavaSparkContext sc) throws IOException {
writeObjectToFile(path, toWrite, sc.sc());
} | [
"public",
"static",
"void",
"writeObjectToFile",
"(",
"String",
"path",
",",
"Object",
"toWrite",
",",
"JavaSparkContext",
"sc",
")",
"throws",
"IOException",
"{",
"writeObjectToFile",
"(",
"path",
",",
"toWrite",
",",
"sc",
".",
"sc",
"(",
")",
")",
";",
... | Write an object to HDFS (or local) using default Java object serialization
@param path Path to write the object to
@param toWrite Object to write
@param sc Spark context | [
"Write",
"an",
"object",
"to",
"HDFS",
"(",
"or",
"local",
")",
"using",
"default",
"Java",
"object",
"serialization"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-spark/src/main/java/org/datavec/spark/transform/utils/SparkUtils.java#L144-L146 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/IntegrationAccountsInner.java | IntegrationAccountsInner.listKeyVaultKeysAsync | public Observable<List<KeyVaultKeyInner>> listKeyVaultKeysAsync(String resourceGroupName, String integrationAccountName, ListKeyVaultKeysDefinition listKeyVaultKeys) {
"""
Gets the integration account's Key Vault keys.
@param resourceGroupName The resource group name.
@param integrationAccountName The integrat... | java | public Observable<List<KeyVaultKeyInner>> listKeyVaultKeysAsync(String resourceGroupName, String integrationAccountName, ListKeyVaultKeysDefinition listKeyVaultKeys) {
return listKeyVaultKeysWithServiceResponseAsync(resourceGroupName, integrationAccountName, listKeyVaultKeys).map(new Func1<ServiceResponse<List<... | [
"public",
"Observable",
"<",
"List",
"<",
"KeyVaultKeyInner",
">",
">",
"listKeyVaultKeysAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"integrationAccountName",
",",
"ListKeyVaultKeysDefinition",
"listKeyVaultKeys",
")",
"{",
"return",
"listKeyVaultKeysWithServ... | Gets the integration account's Key Vault keys.
@param resourceGroupName The resource group name.
@param integrationAccountName The integration account name.
@param listKeyVaultKeys The key vault parameters.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the List<... | [
"Gets",
"the",
"integration",
"account",
"s",
"Key",
"Vault",
"keys",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/IntegrationAccountsInner.java#L1059-L1066 |
SeaCloudsEU/SeaCloudsPlatform | sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/AgreementRest.java | AgreementRest.createAgreement | @POST
@Consumes(MediaType.APPLICATION_XML)
@Produces(MediaType.APPLICATION_XML)
public Response createAgreement(@Context HttpHeaders hh,@Context UriInfo uriInfo, String payload) {
"""
Creates a new agreement
<pre>
POST /agreements
Request:
POST /agreements HTTP/1.1
Accept: application/xml
... | java | @POST
@Consumes(MediaType.APPLICATION_XML)
@Produces(MediaType.APPLICATION_XML)
public Response createAgreement(@Context HttpHeaders hh,@Context UriInfo uriInfo, String payload){
logger.debug("StartOf createAgreement - Insert /agreements");
String location = null;
try{
A... | [
"@",
"POST",
"@",
"Consumes",
"(",
"MediaType",
".",
"APPLICATION_XML",
")",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_XML",
")",
"public",
"Response",
"createAgreement",
"(",
"@",
"Context",
"HttpHeaders",
"hh",
",",
"@",
"Context",
"UriInfo",
"uri... | Creates a new agreement
<pre>
POST /agreements
Request:
POST /agreements HTTP/1.1
Accept: application/xml
Response:
HTTP/1.1 201 Created
Content-type: application/xml
Location: http://.../agreements/$uuid
{@code
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<message code="201" message= "The agreement has... | [
"Creates",
"a",
"new",
"agreement"
] | train | https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/AgreementRest.java#L246-L266 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATMainConsumer.java | CATMainConsumer.requestMsgs | public void requestMsgs(int requestNumber, int receiveBytes, int requestedBytes) {
"""
Requests more messages for this consumer. This call
is delegated to the sub consumer if one exists or the
<code>CATConsumer</code> version is used.
@param requestNumber The request number which replies should be sent to.
@... | java | public void requestMsgs(int requestNumber, int receiveBytes, int requestedBytes)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "requestMsgs",
new Object[]
{
... | [
"public",
"void",
"requestMsgs",
"(",
"int",
"requestNumber",
",",
"int",
"receiveBytes",
",",
"int",
"requestedBytes",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".... | Requests more messages for this consumer. This call
is delegated to the sub consumer if one exists or the
<code>CATConsumer</code> version is used.
@param requestNumber The request number which replies should be sent to.
@param receiveBytes
@param requestedBytes | [
"Requests",
"more",
"messages",
"for",
"this",
"consumer",
".",
"This",
"call",
"is",
"delegated",
"to",
"the",
"sub",
"consumer",
"if",
"one",
"exists",
"or",
"the",
"<code",
">",
"CATConsumer<",
"/",
"code",
">",
"version",
"is",
"used",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATMainConsumer.java#L1032-L1052 |
googleapis/google-http-java-client | google-http-client-xml/src/main/java/com/google/api/client/xml/XmlNamespaceDictionary.java | XmlNamespaceDictionary.getNamespaceUriForAliasHandlingUnknown | String getNamespaceUriForAliasHandlingUnknown(boolean errorOnUnknown, String alias) {
"""
Returns the namespace URI to use for serialization for a given namespace alias, possibly using
a predictable made-up namespace URI if the alias is not recognized.
<p>Specifically, if the namespace alias is not recognized,... | java | String getNamespaceUriForAliasHandlingUnknown(boolean errorOnUnknown, String alias) {
String result = getUriForAlias(alias);
if (result == null) {
Preconditions.checkArgument(
!errorOnUnknown, "unrecognized alias: %s", alias.length() == 0 ? "(default)" : alias);
return "http://unknown/" + ... | [
"String",
"getNamespaceUriForAliasHandlingUnknown",
"(",
"boolean",
"errorOnUnknown",
",",
"String",
"alias",
")",
"{",
"String",
"result",
"=",
"getUriForAlias",
"(",
"alias",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"Preconditions",
".",
"checkAr... | Returns the namespace URI to use for serialization for a given namespace alias, possibly using
a predictable made-up namespace URI if the alias is not recognized.
<p>Specifically, if the namespace alias is not recognized, the namespace URI returned will be
{@code "http://unknown/"} plus the alias, unless {@code errorO... | [
"Returns",
"the",
"namespace",
"URI",
"to",
"use",
"for",
"serialization",
"for",
"a",
"given",
"namespace",
"alias",
"possibly",
"using",
"a",
"predictable",
"made",
"-",
"up",
"namespace",
"URI",
"if",
"the",
"alias",
"is",
"not",
"recognized",
"."
] | train | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client-xml/src/main/java/com/google/api/client/xml/XmlNamespaceDictionary.java#L288-L296 |
haifengl/smile | data/src/main/java/smile/data/BinarySparseDataset.java | BinarySparseDataset.toSparseMatrix | public SparseMatrix toSparseMatrix() {
"""
Convert into Harwell-Boeing column-compressed sparse matrix format.
"""
int[] pos = new int[numColumns];
int[] colIndex = new int[numColumns + 1];
for (int i = 0; i < numColumns; i++) {
colIndex[i + 1] = colIndex[i] + colSize[i];
... | java | public SparseMatrix toSparseMatrix() {
int[] pos = new int[numColumns];
int[] colIndex = new int[numColumns + 1];
for (int i = 0; i < numColumns; i++) {
colIndex[i + 1] = colIndex[i] + colSize[i];
}
int nrows = size();
int[] rowIndex = new int[n];
dou... | [
"public",
"SparseMatrix",
"toSparseMatrix",
"(",
")",
"{",
"int",
"[",
"]",
"pos",
"=",
"new",
"int",
"[",
"numColumns",
"]",
";",
"int",
"[",
"]",
"colIndex",
"=",
"new",
"int",
"[",
"numColumns",
"+",
"1",
"]",
";",
"for",
"(",
"int",
"i",
"=",
... | Convert into Harwell-Boeing column-compressed sparse matrix format. | [
"Convert",
"into",
"Harwell",
"-",
"Boeing",
"column",
"-",
"compressed",
"sparse",
"matrix",
"format",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/data/src/main/java/smile/data/BinarySparseDataset.java#L165-L187 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/math/Fraction.java | Fraction.getFraction | public static Fraction getFraction(String str) {
"""
<p>Creates a Fraction from a <code>String</code>.</p>
<p>The formats accepted are:</p>
<ol>
<li><code>double</code> String containing a dot</li>
<li>'X Y/Z'</li>
<li>'Y/Z'</li>
<li>'X' (a simple whole number)</li>
</ol>
<p>and a .</p>
@param str ... | java | public static Fraction getFraction(String str) {
Validate.isTrue(str != null, "The string must not be null");
// parse double format
int pos = str.indexOf('.');
if (pos >= 0) {
return getFraction(Double.parseDouble(str));
}
// parse X Y/Z format
pos =... | [
"public",
"static",
"Fraction",
"getFraction",
"(",
"String",
"str",
")",
"{",
"Validate",
".",
"isTrue",
"(",
"str",
"!=",
"null",
",",
"\"The string must not be null\"",
")",
";",
"// parse double format",
"int",
"pos",
"=",
"str",
".",
"indexOf",
"(",
"'",
... | <p>Creates a Fraction from a <code>String</code>.</p>
<p>The formats accepted are:</p>
<ol>
<li><code>double</code> String containing a dot</li>
<li>'X Y/Z'</li>
<li>'Y/Z'</li>
<li>'X' (a simple whole number)</li>
</ol>
<p>and a .</p>
@param str the string to parse, must not be <code>null</code>
@return the new <co... | [
"<p",
">",
"Creates",
"a",
"Fraction",
"from",
"a",
"<code",
">",
"String<",
"/",
"code",
">",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/math/Fraction.java#L317-L348 |
cycorp/api-suite | core-api/src/main/java/com/cyc/kb/exception/StaleKbObjectException.java | StaleKbObjectException.fromThrowable | public static StaleKbObjectException fromThrowable(String message, Throwable cause) {
"""
Converts a Throwable to a StaleKbObjectException with the specified detail message. If the
Throwable is a StaleKbObjectException and if the Throwable's message is identical to the
one supplied, the Throwable will be passed ... | java | public static StaleKbObjectException fromThrowable(String message, Throwable cause) {
return (cause instanceof StaleKbObjectException && Objects.equals(message, cause.getMessage()))
? (StaleKbObjectException) cause
: new StaleKbObjectException(message, cause);
} | [
"public",
"static",
"StaleKbObjectException",
"fromThrowable",
"(",
"String",
"message",
",",
"Throwable",
"cause",
")",
"{",
"return",
"(",
"cause",
"instanceof",
"StaleKbObjectException",
"&&",
"Objects",
".",
"equals",
"(",
"message",
",",
"cause",
".",
"getMes... | Converts a Throwable to a StaleKbObjectException with the specified detail message. If the
Throwable is a StaleKbObjectException and if the Throwable's message is identical to the
one supplied, the Throwable will be passed through unmodified; otherwise, it will be wrapped in
a new StaleKbObjectException with the detail... | [
"Converts",
"a",
"Throwable",
"to",
"a",
"StaleKbObjectException",
"with",
"the",
"specified",
"detail",
"message",
".",
"If",
"the",
"Throwable",
"is",
"a",
"StaleKbObjectException",
"and",
"if",
"the",
"Throwable",
"s",
"message",
"is",
"identical",
"to",
"the... | train | https://github.com/cycorp/api-suite/blob/1d52affabc4635e3715a059e38741712cbdbf2d5/core-api/src/main/java/com/cyc/kb/exception/StaleKbObjectException.java#L75-L79 |
qiniu/java-sdk | src/main/java/com/qiniu/storage/BucketManager.java | BucketManager.changeHeaders | public Response changeHeaders(String bucket, String key, Map<String, String> headers)
throws QiniuException {
"""
修改文件的元数据
@param bucket 空间名称
@param key 文件名称
@param headers 需要修改的文件元数据
@throws QiniuException
@link https://developer.qiniu.com/kodo/api/1252/chgm
"""
String resource... | java | public Response changeHeaders(String bucket, String key, Map<String, String> headers)
throws QiniuException {
String resource = encodedEntry(bucket, key);
String path = String.format("/chgm/%s", resource);
for (String k : headers.keySet()) {
String encodedMetaValue = UrlS... | [
"public",
"Response",
"changeHeaders",
"(",
"String",
"bucket",
",",
"String",
"key",
",",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
")",
"throws",
"QiniuException",
"{",
"String",
"resource",
"=",
"encodedEntry",
"(",
"bucket",
",",
"key",
")",
... | 修改文件的元数据
@param bucket 空间名称
@param key 文件名称
@param headers 需要修改的文件元数据
@throws QiniuException
@link https://developer.qiniu.com/kodo/api/1252/chgm | [
"修改文件的元数据"
] | train | https://github.com/qiniu/java-sdk/blob/6c05f3fb718403a496c725b048e9241f80171499/src/main/java/com/qiniu/storage/BucketManager.java#L290-L299 |
cdk/cdk | legacy/src/main/java/org/openscience/cdk/smsd/algorithm/vflib/builder/VFQueryBuilder.java | VFQueryBuilder.addNode | public INode addNode(VFAtomMatcher matcher, IAtom atom) {
"""
Add and return a node for a query atom
@param matcher
@param atom
@return added Node
"""
NodeBuilder node = new NodeBuilder(matcher);
nodesList.add(node);
nodeBondMap.put(node, atom);
return node;
} | java | public INode addNode(VFAtomMatcher matcher, IAtom atom) {
NodeBuilder node = new NodeBuilder(matcher);
nodesList.add(node);
nodeBondMap.put(node, atom);
return node;
} | [
"public",
"INode",
"addNode",
"(",
"VFAtomMatcher",
"matcher",
",",
"IAtom",
"atom",
")",
"{",
"NodeBuilder",
"node",
"=",
"new",
"NodeBuilder",
"(",
"matcher",
")",
";",
"nodesList",
".",
"add",
"(",
"node",
")",
";",
"nodeBondMap",
".",
"put",
"(",
"no... | Add and return a node for a query atom
@param matcher
@param atom
@return added Node | [
"Add",
"and",
"return",
"a",
"node",
"for",
"a",
"query",
"atom"
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/smsd/algorithm/vflib/builder/VFQueryBuilder.java#L152-L157 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/route/RouteClient.java | RouteClient.getRoute | public GetRouteResponse getRoute(String routeTableId, String vpcId) {
"""
Get the detail information of route table for specific route table or/and vpc
@param routeTableId id of route table, routeTableId and vpcId cannot be empty at the same time
@param vpcId vpcId, routeTableId and vpcId cannot be empty at the ... | java | public GetRouteResponse getRoute(String routeTableId, String vpcId) {
GetRouteRequest request = new GetRouteRequest();
if (Strings.isNullOrEmpty(vpcId) && Strings.isNullOrEmpty(routeTableId)) {
throw new IllegalArgumentException("routeTableId and vpcId should not be empty at the same time");... | [
"public",
"GetRouteResponse",
"getRoute",
"(",
"String",
"routeTableId",
",",
"String",
"vpcId",
")",
"{",
"GetRouteRequest",
"request",
"=",
"new",
"GetRouteRequest",
"(",
")",
";",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"vpcId",
")",
"&&",
"Strings... | Get the detail information of route table for specific route table or/and vpc
@param routeTableId id of route table, routeTableId and vpcId cannot be empty at the same time
@param vpcId vpcId, routeTableId and vpcId cannot be empty at the same time
@return A route table detail model for the specific route table or/and... | [
"Get",
"the",
"detail",
"information",
"of",
"route",
"table",
"for",
"specific",
"route",
"table",
"or",
"/",
"and",
"vpc"
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/route/RouteClient.java#L176-L188 |
forge/core | javaee/scaffold-faces/src/main/java/org/jboss/forge/addon/scaffold/faces/freemarker/FreemarkerTemplateProcessor.java | FreemarkerTemplateProcessor.processTemplate | public static String processTemplate(Map<Object, Object> map, Template template) {
"""
Processes the provided data model with the specified Freemarker template
@param map the data model to use for template processing.
@param template The Freemarker {@link Template} to be processed.
@return The text output aft... | java | public static String processTemplate(Map<Object, Object> map, Template template)
{
Writer output = new StringWriter();
try
{
template.process(map, output);
output.flush();
}
catch (IOException ioEx)
{
throw new RuntimeException(ioEx);
}
catch... | [
"public",
"static",
"String",
"processTemplate",
"(",
"Map",
"<",
"Object",
",",
"Object",
">",
"map",
",",
"Template",
"template",
")",
"{",
"Writer",
"output",
"=",
"new",
"StringWriter",
"(",
")",
";",
"try",
"{",
"template",
".",
"process",
"(",
"map... | Processes the provided data model with the specified Freemarker template
@param map the data model to use for template processing.
@param template The Freemarker {@link Template} to be processed.
@return The text output after successfully processing the template | [
"Processes",
"the",
"provided",
"data",
"model",
"with",
"the",
"specified",
"Freemarker",
"template"
] | train | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/javaee/scaffold-faces/src/main/java/org/jboss/forge/addon/scaffold/faces/freemarker/FreemarkerTemplateProcessor.java#L80-L97 |
lightblueseas/jcommons-lang | src/main/java/de/alpharogroup/lang/AnnotationExtensions.java | AnnotationExtensions.isAnnotationPresentInSuperClassesOrInterfaces | public static boolean isAnnotationPresentInSuperClassesOrInterfaces(
final Class<?> componentClass, final Class<? extends Annotation> annotationClass) {
"""
Checks if is annotation present through making a lookup if the given annotation class is
present in the given class or in one of the super classes.
@par... | java | public static boolean isAnnotationPresentInSuperClassesOrInterfaces(
final Class<?> componentClass, final Class<? extends Annotation> annotationClass)
{
return getAnnotation(componentClass, annotationClass) != null;
} | [
"public",
"static",
"boolean",
"isAnnotationPresentInSuperClassesOrInterfaces",
"(",
"final",
"Class",
"<",
"?",
">",
"componentClass",
",",
"final",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClass",
")",
"{",
"return",
"getAnnotation",
"(",
"compo... | Checks if is annotation present through making a lookup if the given annotation class is
present in the given class or in one of the super classes.
@param componentClass
the component class
@param annotationClass
the annotation class
@return true, if is annotation present | [
"Checks",
"if",
"is",
"annotation",
"present",
"through",
"making",
"a",
"lookup",
"if",
"the",
"given",
"annotation",
"class",
"is",
"present",
"in",
"the",
"given",
"class",
"or",
"in",
"one",
"of",
"the",
"super",
"classes",
"."
] | train | https://github.com/lightblueseas/jcommons-lang/blob/000e1f198e949ec3e721fd0fc3f5946e945232a3/src/main/java/de/alpharogroup/lang/AnnotationExtensions.java#L249-L253 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.rightShiftUnsigned | public static Number rightShiftUnsigned(Number self, Number operand) {
"""
Implementation of the right shift (unsigned) operator for integral types. Non integral
Number types throw UnsupportedOperationException.
@param self a Number object
@param operand the shift distance by which to right shift (unsigne... | java | public static Number rightShiftUnsigned(Number self, Number operand) {
return NumberMath.rightShiftUnsigned(self, operand);
} | [
"public",
"static",
"Number",
"rightShiftUnsigned",
"(",
"Number",
"self",
",",
"Number",
"operand",
")",
"{",
"return",
"NumberMath",
".",
"rightShiftUnsigned",
"(",
"self",
",",
"operand",
")",
";",
"}"
] | Implementation of the right shift (unsigned) operator for integral types. Non integral
Number types throw UnsupportedOperationException.
@param self a Number object
@param operand the shift distance by which to right shift (unsigned) the number
@return the resulting number
@since 1.5.0 | [
"Implementation",
"of",
"the",
"right",
"shift",
"(",
"unsigned",
")",
"operator",
"for",
"integral",
"types",
".",
"Non",
"integral",
"Number",
"types",
"throw",
"UnsupportedOperationException",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L13595-L13597 |
nikhaldi/android-view-selector | src/main/java/com/nikhaldimann/viewselector/attributes/ViewAttributes.java | ViewAttributes.callGetter | public static Object callGetter(View view, String methodName) {
"""
Calls the given method by name on the given view, assuming that it's a getter,
i.e., it doesn't have arguments.
@return the result of the method call
@throws AttributeAccessException when the method doesn't exist or can't be
called for various... | java | public static Object callGetter(View view, String methodName) {
try {
Method method = view.getClass().getMethod(methodName);
return method.invoke(view);
} catch (SecurityException ex) {
throw new AttributeAccessException(ex);
} catch (NoSuchMethodException ex)... | [
"public",
"static",
"Object",
"callGetter",
"(",
"View",
"view",
",",
"String",
"methodName",
")",
"{",
"try",
"{",
"Method",
"method",
"=",
"view",
".",
"getClass",
"(",
")",
".",
"getMethod",
"(",
"methodName",
")",
";",
"return",
"method",
".",
"invok... | Calls the given method by name on the given view, assuming that it's a getter,
i.e., it doesn't have arguments.
@return the result of the method call
@throws AttributeAccessException when the method doesn't exist or can't be
called for various reasons | [
"Calls",
"the",
"given",
"method",
"by",
"name",
"on",
"the",
"given",
"view",
"assuming",
"that",
"it",
"s",
"a",
"getter",
"i",
".",
"e",
".",
"it",
"doesn",
"t",
"have",
"arguments",
"."
] | train | https://github.com/nikhaldi/android-view-selector/blob/d3e4bf05f6111d116c6b0c1a8c51396e8bfae9b5/src/main/java/com/nikhaldimann/viewselector/attributes/ViewAttributes.java#L41-L54 |
icode/ameba | src/main/java/ameba/websocket/internal/EndpointMeta.java | EndpointMeta.checkMessageSize | protected static void checkMessageSize(Object message, long maxMessageSize) {
"""
<p>checkMessageSize.</p>
@param message a {@link java.lang.Object} object.
@param maxMessageSize a long.
"""
if (maxMessageSize != -1) {
final long messageSize =
(message instanc... | java | protected static void checkMessageSize(Object message, long maxMessageSize) {
if (maxMessageSize != -1) {
final long messageSize =
(message instanceof String ? ((String) message).getBytes(Charset.defaultCharset()).length
: ((ByteBuffer) message).remain... | [
"protected",
"static",
"void",
"checkMessageSize",
"(",
"Object",
"message",
",",
"long",
"maxMessageSize",
")",
"{",
"if",
"(",
"maxMessageSize",
"!=",
"-",
"1",
")",
"{",
"final",
"long",
"messageSize",
"=",
"(",
"message",
"instanceof",
"String",
"?",
"("... | <p>checkMessageSize.</p>
@param message a {@link java.lang.Object} object.
@param maxMessageSize a long. | [
"<p",
">",
"checkMessageSize",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/websocket/internal/EndpointMeta.java#L52-L64 |
FlyingHe/UtilsMaven | src/main/java/com/github/flyinghe/tools/ImgCompressUtils.java | ImgCompressUtils.encodeImg | private static void encodeImg(String desFile, BufferedImage desImg, Float quality) {
"""
采用JPEG编码图片
@param desFile 指定压缩后图片存放地址,包括图片名称
@param desImg 编码源图片
@param quality 编码质量
@throws Exception
"""
FileOutputStream out = null;
try {
if (quality != null) {
if (qu... | java | private static void encodeImg(String desFile, BufferedImage desImg, Float quality) {
FileOutputStream out = null;
try {
if (quality != null) {
if (quality > 1.0 || quality < 0.0) {
throw new Exception("quality参数指定值不正确");
}
}
... | [
"private",
"static",
"void",
"encodeImg",
"(",
"String",
"desFile",
",",
"BufferedImage",
"desImg",
",",
"Float",
"quality",
")",
"{",
"FileOutputStream",
"out",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"quality",
"!=",
"null",
")",
"{",
"if",
"(",
"qual... | 采用JPEG编码图片
@param desFile 指定压缩后图片存放地址,包括图片名称
@param desImg 编码源图片
@param quality 编码质量
@throws Exception | [
"采用JPEG编码图片"
] | train | https://github.com/FlyingHe/UtilsMaven/blob/d9605b7bfe0c28a05289252e12d163e114080b4a/src/main/java/com/github/flyinghe/tools/ImgCompressUtils.java#L146-L173 |
wcm-io-caravan/caravan-hal | resource/src/main/java/io/wcm/caravan/hal/resource/HalResource.java | HalResource.renameEmbedded | public HalResource renameEmbedded(String relToRename, String newRel) {
"""
Changes the rel of embedded resources
@param relToRename the rel that you want to change
@param newRel the new rel for all embedded items
@return HAL resource
"""
List<HalResource> resources = getEmbedded(relToRename);
return... | java | public HalResource renameEmbedded(String relToRename, String newRel) {
List<HalResource> resources = getEmbedded(relToRename);
return removeEmbedded(relToRename).addEmbedded(newRel, resources);
} | [
"public",
"HalResource",
"renameEmbedded",
"(",
"String",
"relToRename",
",",
"String",
"newRel",
")",
"{",
"List",
"<",
"HalResource",
">",
"resources",
"=",
"getEmbedded",
"(",
"relToRename",
")",
";",
"return",
"removeEmbedded",
"(",
"relToRename",
")",
".",
... | Changes the rel of embedded resources
@param relToRename the rel that you want to change
@param newRel the new rel for all embedded items
@return HAL resource | [
"Changes",
"the",
"rel",
"of",
"embedded",
"resources"
] | train | https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/resource/src/main/java/io/wcm/caravan/hal/resource/HalResource.java#L508-L511 |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/CommonSteps.java | CommonSteps.checkElementVisible | @Conditioned
@Et("Je vérifie que '(.*)-(.*)' est visible[\\.|\\?]")
@And("I check that '(.*)-(.*)' is visible[\\.|\\?]")
public void checkElementVisible(String page, String elementName, List<GherkinStepCondition> conditions) throws FailureException, TechnicalException {
"""
Checks if an html element... | java | @Conditioned
@Et("Je vérifie que '(.*)-(.*)' est visible[\\.|\\?]")
@And("I check that '(.*)-(.*)' is visible[\\.|\\?]")
public void checkElementVisible(String page, String elementName, List<GherkinStepCondition> conditions) throws FailureException, TechnicalException {
checkElementVisible(Page.... | [
"@",
"Conditioned",
"@",
"Et",
"(",
"\"Je vérifie que '(.*)-(.*)' est visible[\\\\.|\\\\?]\")",
"\r",
"@",
"And",
"(",
"\"I check that '(.*)-(.*)' is visible[\\\\.|\\\\?]\"",
")",
"public",
"void",
"checkElementVisible",
"(",
"String",
"page",
",",
"String",
"elementName",
... | Checks if an html element is visible.
@param page
The concerned page of elementName
@param elementName
The key of the PageElement to check
@param conditions
list of 'expected' values condition and 'actual' values ({@link com.github.noraui.gherkin.GherkinStepCondition}).
@throws TechnicalException
is throws if you have... | [
"Checks",
"if",
"an",
"html",
"element",
"is",
"visible",
"."
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/CommonSteps.java#L711-L716 |
joniles/mpxj | src/main/java/net/sf/mpxj/ganttproject/GanttProjectReader.java | GanttProjectReader.setWorkingDays | private void setWorkingDays(ProjectCalendar mpxjCalendar, Calendars gpCalendar) {
"""
Add working days and working time to a calendar.
@param mpxjCalendar MPXJ calendar
@param gpCalendar GanttProject calendar
"""
DayTypes dayTypes = gpCalendar.getDayTypes();
DefaultWeek defaultWeek = dayTypes.g... | java | private void setWorkingDays(ProjectCalendar mpxjCalendar, Calendars gpCalendar)
{
DayTypes dayTypes = gpCalendar.getDayTypes();
DefaultWeek defaultWeek = dayTypes.getDefaultWeek();
if (defaultWeek == null)
{
mpxjCalendar.setWorkingDay(Day.SUNDAY, false);
mpxjCalendar.setWork... | [
"private",
"void",
"setWorkingDays",
"(",
"ProjectCalendar",
"mpxjCalendar",
",",
"Calendars",
"gpCalendar",
")",
"{",
"DayTypes",
"dayTypes",
"=",
"gpCalendar",
".",
"getDayTypes",
"(",
")",
";",
"DefaultWeek",
"defaultWeek",
"=",
"dayTypes",
".",
"getDefaultWeek",... | Add working days and working time to a calendar.
@param mpxjCalendar MPXJ calendar
@param gpCalendar GanttProject calendar | [
"Add",
"working",
"days",
"and",
"working",
"time",
"to",
"a",
"calendar",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ganttproject/GanttProjectReader.java#L239-L273 |
cloudendpoints/endpoints-management-java | endpoints-control/src/main/java/com/google/api/control/model/PathTemplate.java | PathTemplate.validate | public void validate(String path, String exceptionMessagePrefix) {
"""
Throws a ValidationException if the template doesn't match the path. The exceptionMessagePrefix
parameter will be prepended to the ValidationException message.
"""
if (!matches(path)) {
throw new ValidationException(
St... | java | public void validate(String path, String exceptionMessagePrefix) {
if (!matches(path)) {
throw new ValidationException(
String.format(
"%s: Parameter \"%s\" must be in the form \"%s\"",
exceptionMessagePrefix, path, this.toString()));
}
} | [
"public",
"void",
"validate",
"(",
"String",
"path",
",",
"String",
"exceptionMessagePrefix",
")",
"{",
"if",
"(",
"!",
"matches",
"(",
"path",
")",
")",
"{",
"throw",
"new",
"ValidationException",
"(",
"String",
".",
"format",
"(",
"\"%s: Parameter \\\"%s\\\"... | Throws a ValidationException if the template doesn't match the path. The exceptionMessagePrefix
parameter will be prepended to the ValidationException message. | [
"Throws",
"a",
"ValidationException",
"if",
"the",
"template",
"doesn",
"t",
"match",
"the",
"path",
".",
"The",
"exceptionMessagePrefix",
"parameter",
"will",
"be",
"prepended",
"to",
"the",
"ValidationException",
"message",
"."
] | train | https://github.com/cloudendpoints/endpoints-management-java/blob/5bbf20ddadbbd51b890049e3c338c28abe2c9f94/endpoints-control/src/main/java/com/google/api/control/model/PathTemplate.java#L375-L382 |
spring-projects/spring-data-solr | src/main/java/org/springframework/data/solr/core/query/Criteria.java | Criteria.near | public Criteria near(Box box) {
"""
Creates new {@link Predicate} for {@code !bbox} with exact coordinates
@param box
@return
"""
predicates.add(new Predicate(OperationKey.NEAR, new Object[] { box }));
return this;
} | java | public Criteria near(Box box) {
predicates.add(new Predicate(OperationKey.NEAR, new Object[] { box }));
return this;
} | [
"public",
"Criteria",
"near",
"(",
"Box",
"box",
")",
"{",
"predicates",
".",
"add",
"(",
"new",
"Predicate",
"(",
"OperationKey",
".",
"NEAR",
",",
"new",
"Object",
"[",
"]",
"{",
"box",
"}",
")",
")",
";",
"return",
"this",
";",
"}"
] | Creates new {@link Predicate} for {@code !bbox} with exact coordinates
@param box
@return | [
"Creates",
"new",
"{",
"@link",
"Predicate",
"}",
"for",
"{",
"@code",
"!bbox",
"}",
"with",
"exact",
"coordinates"
] | train | https://github.com/spring-projects/spring-data-solr/blob/20be5cb82498b70134dfda6c1a91ad21f8e657e0/src/main/java/org/springframework/data/solr/core/query/Criteria.java#L527-L530 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/filter/Filter.java | Filter.andNotExists | public final Filter<S> andNotExists(String propertyName, Filter<?> subFilter) {
"""
Returns a combined filter instance that accepts records which are only
accepted by this filter and the "not exists" test applied to a join.
@param propertyName join property name, which may be a chained property
@param subFilt... | java | public final Filter<S> andNotExists(String propertyName, Filter<?> subFilter) {
ChainedProperty<S> prop = new FilterParser<S>(mType, propertyName).parseChainedProperty();
return and(ExistsFilter.build(prop, subFilter, true));
} | [
"public",
"final",
"Filter",
"<",
"S",
">",
"andNotExists",
"(",
"String",
"propertyName",
",",
"Filter",
"<",
"?",
">",
"subFilter",
")",
"{",
"ChainedProperty",
"<",
"S",
">",
"prop",
"=",
"new",
"FilterParser",
"<",
"S",
">",
"(",
"mType",
",",
"pro... | Returns a combined filter instance that accepts records which are only
accepted by this filter and the "not exists" test applied to a join.
@param propertyName join property name, which may be a chained property
@param subFilter sub-filter to apply to join, which may be null to test
for any not existing
@return canoni... | [
"Returns",
"a",
"combined",
"filter",
"instance",
"that",
"accepts",
"records",
"which",
"are",
"only",
"accepted",
"by",
"this",
"filter",
"and",
"the",
"not",
"exists",
"test",
"applied",
"to",
"a",
"join",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/filter/Filter.java#L320-L323 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.getChar | public static char getChar(MemorySegment[] segments, int offset) {
"""
get char from segments.
@param segments target segments.
@param offset value offset.
"""
if (inFirstSegment(segments, offset, 2)) {
return segments[0].getChar(offset);
} else {
return getCharMultiSegments(segments, offset);
... | java | public static char getChar(MemorySegment[] segments, int offset) {
if (inFirstSegment(segments, offset, 2)) {
return segments[0].getChar(offset);
} else {
return getCharMultiSegments(segments, offset);
}
} | [
"public",
"static",
"char",
"getChar",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"2",
")",
")",
"{",
"return",
"segments",
"[",
"0",
"]",
".",
"getChar"... | get char from segments.
@param segments target segments.
@param offset value offset. | [
"get",
"char",
"from",
"segments",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L956-L962 |
prestodb/presto | presto-spi/src/main/java/com/facebook/presto/spi/type/MapType.java | MapType.createMapBlockInternal | public static Block createMapBlockInternal(
TypeManager typeManager,
Type keyType,
int startOffset,
int positionCount,
Optional<boolean[]> mapIsNull,
int[] offsets,
Block keyBlock,
Block valueBlock,
HashTables ha... | java | public static Block createMapBlockInternal(
TypeManager typeManager,
Type keyType,
int startOffset,
int positionCount,
Optional<boolean[]> mapIsNull,
int[] offsets,
Block keyBlock,
Block valueBlock,
HashTables ha... | [
"public",
"static",
"Block",
"createMapBlockInternal",
"(",
"TypeManager",
"typeManager",
",",
"Type",
"keyType",
",",
"int",
"startOffset",
",",
"int",
"positionCount",
",",
"Optional",
"<",
"boolean",
"[",
"]",
">",
"mapIsNull",
",",
"int",
"[",
"]",
"offset... | Create a map block directly without per element validations.
<p>
Internal use by com.facebook.presto.spi.Block only. | [
"Create",
"a",
"map",
"block",
"directly",
"without",
"per",
"element",
"validations",
".",
"<p",
">",
"Internal",
"use",
"by",
"com",
".",
"facebook",
".",
"presto",
".",
"spi",
".",
"Block",
"only",
"."
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-spi/src/main/java/com/facebook/presto/spi/type/MapType.java#L273-L288 |
alkacon/opencms-core | src/org/opencms/ui/dialogs/CmsSecureExportDialog.java | CmsSecureExportDialog.saveData | protected void saveData() throws CmsException {
"""
Touches the selected files.<p>
@throws CmsException if something goes wrong
"""
CmsObject cms = m_context.getCms();
for (CmsResource resource : m_context.getResources()) {
CmsLockActionRecord actionRecord = null;
tr... | java | protected void saveData() throws CmsException {
CmsObject cms = m_context.getCms();
for (CmsResource resource : m_context.getResources()) {
CmsLockActionRecord actionRecord = null;
try {
actionRecord = CmsLockUtil.ensureLock(m_context.getCms(), resource);
... | [
"protected",
"void",
"saveData",
"(",
")",
"throws",
"CmsException",
"{",
"CmsObject",
"cms",
"=",
"m_context",
".",
"getCms",
"(",
")",
";",
"for",
"(",
"CmsResource",
"resource",
":",
"m_context",
".",
"getResources",
"(",
")",
")",
"{",
"CmsLockActionReco... | Touches the selected files.<p>
@throws CmsException if something goes wrong | [
"Touches",
"the",
"selected",
"files",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/dialogs/CmsSecureExportDialog.java#L240-L272 |
apache/flink | flink-core/src/main/java/org/apache/flink/util/StringUtils.java | StringUtils.writeString | public static void writeString(@Nonnull String str, DataOutputView out) throws IOException {
"""
Writes a String to the given output.
The written string can be read with {@link #readString(DataInputView)}.
@param str The string to write
@param out The output to write to
@throws IOException Thrown, if the w... | java | public static void writeString(@Nonnull String str, DataOutputView out) throws IOException {
checkNotNull(str);
StringValue.writeString(str, out);
} | [
"public",
"static",
"void",
"writeString",
"(",
"@",
"Nonnull",
"String",
"str",
",",
"DataOutputView",
"out",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"str",
")",
";",
"StringValue",
".",
"writeString",
"(",
"str",
",",
"out",
")",
";",
"}"... | Writes a String to the given output.
The written string can be read with {@link #readString(DataInputView)}.
@param str The string to write
@param out The output to write to
@throws IOException Thrown, if the writing or the serialization fails. | [
"Writes",
"a",
"String",
"to",
"the",
"given",
"output",
".",
"The",
"written",
"string",
"can",
"be",
"read",
"with",
"{",
"@link",
"#readString",
"(",
"DataInputView",
")",
"}",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/StringUtils.java#L293-L296 |
alkacon/opencms-core | src/org/opencms/configuration/CmsConfigurationManager.java | CmsConfigurationManager.transformConfiguration | InputSource transformConfiguration(URL url, I_CmsXmlConfiguration config)
throws TransformerException, IOException, SAXException, ParserConfigurationException {
"""
Transforms the given configuration using an XSLT transformation.<p>
@param url the URL of the base folder
@param config the configuration obje... | java | InputSource transformConfiguration(URL url, I_CmsXmlConfiguration config)
throws TransformerException, IOException, SAXException, ParserConfigurationException {
String configPath = CmsStringUtil.joinPaths(url.getFile(), config.getXmlFileName());
String transformPath = getTransformationPath();
... | [
"InputSource",
"transformConfiguration",
"(",
"URL",
"url",
",",
"I_CmsXmlConfiguration",
"config",
")",
"throws",
"TransformerException",
",",
"IOException",
",",
"SAXException",
",",
"ParserConfigurationException",
"{",
"String",
"configPath",
"=",
"CmsStringUtil",
".",... | Transforms the given configuration using an XSLT transformation.<p>
@param url the URL of the base folder
@param config the configuration object
@return the InputSource to feed the configuration digester
@throws TransformerException if the transformation fails
@throws IOException if an error occurs while reading the... | [
"Transforms",
"the",
"given",
"configuration",
"using",
"an",
"XSLT",
"transformation",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/configuration/CmsConfigurationManager.java#L513-L566 |
cojen/Cojen | src/main/java/org/cojen/classfile/MethodDesc.java | MethodDesc.forArguments | public static MethodDesc forArguments(TypeDesc ret, TypeDesc[] params) {
"""
Acquire a MethodDesc from a set of arguments.
@param ret return type of method; null implies void
@param params parameters to method; null implies none
"""
if (ret == null) {
ret = TypeDesc.VOID;
}
... | java | public static MethodDesc forArguments(TypeDesc ret, TypeDesc[] params) {
if (ret == null) {
ret = TypeDesc.VOID;
}
if (params == null || params.length == 0) {
params = EMPTY_PARAMS;
}
return intern(new MethodDesc(ret, params));
} | [
"public",
"static",
"MethodDesc",
"forArguments",
"(",
"TypeDesc",
"ret",
",",
"TypeDesc",
"[",
"]",
"params",
")",
"{",
"if",
"(",
"ret",
"==",
"null",
")",
"{",
"ret",
"=",
"TypeDesc",
".",
"VOID",
";",
"}",
"if",
"(",
"params",
"==",
"null",
"||",... | Acquire a MethodDesc from a set of arguments.
@param ret return type of method; null implies void
@param params parameters to method; null implies none | [
"Acquire",
"a",
"MethodDesc",
"from",
"a",
"set",
"of",
"arguments",
"."
] | train | https://github.com/cojen/Cojen/blob/ddee9a0fde83870b97e0ed04c58270aa665f3a62/src/main/java/org/cojen/classfile/MethodDesc.java#L52-L60 |
lightblueseas/file-worker | src/main/java/de/alpharogroup/file/read/ReadFileExtensions.java | ReadFileExtensions.readLinesInList | public static List<String> readLinesInList(final File input)
throws FileNotFoundException, IOException {
"""
Reads every line from the File and puts them to the List.
@param input
The File from where the input comes.
@return The List with all lines from the file.
@throws FileNotFoundException
is thrown if... | java | public static List<String> readLinesInList(final File input)
throws FileNotFoundException, IOException
{
return readLinesInList(input, false);
} | [
"public",
"static",
"List",
"<",
"String",
">",
"readLinesInList",
"(",
"final",
"File",
"input",
")",
"throws",
"FileNotFoundException",
",",
"IOException",
"{",
"return",
"readLinesInList",
"(",
"input",
",",
"false",
")",
";",
"}"
] | Reads every line from the File and puts them to the List.
@param input
The File from where the input comes.
@return The List with all lines from the file.
@throws FileNotFoundException
is thrown if the given file is not found.
@throws IOException
Signals that an I/O exception has occurred. | [
"Reads",
"every",
"line",
"from",
"the",
"File",
"and",
"puts",
"them",
"to",
"the",
"List",
"."
] | train | https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/read/ReadFileExtensions.java#L222-L226 |
lightblue-platform/lightblue-migrator | migrator/src/main/java/com/redhat/lightblue/migrator/ConsistencyCheckerController.java | ConsistencyCheckerController.getEndDate | public Date getEndDate(Date startDate, long period) {
"""
Returns the end date given the start date end the period. The end date is
startDate+period, but only if endDate is at least one period ago. That
is, we always leave the last incomplete period unprocessed.
Override this to control the job generation alg... | java | public Date getEndDate(Date startDate, long period) {
long now = getNow().getTime();
long endDate = startDate.getTime() + period;
if (now - period > endDate) {
return new Date(endDate);
} else {
return null;
}
} | [
"public",
"Date",
"getEndDate",
"(",
"Date",
"startDate",
",",
"long",
"period",
")",
"{",
"long",
"now",
"=",
"getNow",
"(",
")",
".",
"getTime",
"(",
")",
";",
"long",
"endDate",
"=",
"startDate",
".",
"getTime",
"(",
")",
"+",
"period",
";",
"if",... | Returns the end date given the start date end the period. The end date is
startDate+period, but only if endDate is at least one period ago. That
is, we always leave the last incomplete period unprocessed.
Override this to control the job generation algorithm | [
"Returns",
"the",
"end",
"date",
"given",
"the",
"start",
"date",
"end",
"the",
"period",
".",
"The",
"end",
"date",
"is",
"startDate",
"+",
"period",
"but",
"only",
"if",
"endDate",
"is",
"at",
"least",
"one",
"period",
"ago",
".",
"That",
"is",
"we",... | train | https://github.com/lightblue-platform/lightblue-migrator/blob/ec20748557b40d1f7851e1816d1b76dae48d2027/migrator/src/main/java/com/redhat/lightblue/migrator/ConsistencyCheckerController.java#L68-L76 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/transform/TransformerRegistry.java | TransformerRegistry.addSubsystem | void addSubsystem(final OperationTransformerRegistry registry, final String name, final ModelVersion version) {
"""
Add a new subsystem to a given registry.
@param registry the registry
@param name the subsystem name
@param version the version
"""
final OperationTransformerRegistry profile = regis... | java | void addSubsystem(final OperationTransformerRegistry registry, final String name, final ModelVersion version) {
final OperationTransformerRegistry profile = registry.getChild(PathAddress.pathAddress(PROFILE));
final OperationTransformerRegistry server = registry.getChild(PathAddress.pathAddress(HOST, SE... | [
"void",
"addSubsystem",
"(",
"final",
"OperationTransformerRegistry",
"registry",
",",
"final",
"String",
"name",
",",
"final",
"ModelVersion",
"version",
")",
"{",
"final",
"OperationTransformerRegistry",
"profile",
"=",
"registry",
".",
"getChild",
"(",
"PathAddress... | Add a new subsystem to a given registry.
@param registry the registry
@param name the subsystem name
@param version the version | [
"Add",
"a",
"new",
"subsystem",
"to",
"a",
"given",
"registry",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/transform/TransformerRegistry.java#L248-L256 |
jpush/jmessage-api-java-client | src/main/java/cn/jmessage/api/crossapp/CrossAppClient.java | CrossAppClient.setCrossNoDisturb | public ResponseWrapper setCrossNoDisturb(String username, CrossNoDisturb[] array)
throws APIConnectionException, APIRequestException {
"""
Set cross app no disturb
https://docs.jiguang.cn/jmessage/server/rest_api_im/#api_1
@param username Necessary
@param array CrossNoDisturb array
@return No conte... | java | public ResponseWrapper setCrossNoDisturb(String username, CrossNoDisturb[] array)
throws APIConnectionException, APIRequestException {
StringUtils.checkUsername(username);
CrossNoDisturbPayload payload = new CrossNoDisturbPayload.Builder()
.setCrossNoDistrub(array)
... | [
"public",
"ResponseWrapper",
"setCrossNoDisturb",
"(",
"String",
"username",
",",
"CrossNoDisturb",
"[",
"]",
"array",
")",
"throws",
"APIConnectionException",
",",
"APIRequestException",
"{",
"StringUtils",
".",
"checkUsername",
"(",
"username",
")",
";",
"CrossNoDis... | Set cross app no disturb
https://docs.jiguang.cn/jmessage/server/rest_api_im/#api_1
@param username Necessary
@param array CrossNoDisturb array
@return No content
@throws APIConnectionException connect exception
@throws APIRequestException request exception | [
"Set",
"cross",
"app",
"no",
"disturb",
"https",
":",
"//",
"docs",
".",
"jiguang",
".",
"cn",
"/",
"jmessage",
"/",
"server",
"/",
"rest_api_im",
"/",
"#api_1"
] | train | https://github.com/jpush/jmessage-api-java-client/blob/767f5fb15e9fe5a546c00f6e68b64f6dd53c617c/src/main/java/cn/jmessage/api/crossapp/CrossAppClient.java#L132-L139 |
FasterXML/woodstox | src/main/java/com/ctc/wstx/dtd/DTDNmTokenAttr.java | DTDNmTokenAttr.validateDefault | @Override
public void validateDefault(InputProblemReporter rep, boolean normalize)
throws XMLStreamException {
"""
Method called by the validator
to ask attribute to verify that the default it has (if any) is
valid for such type.
"""
String def = validateDefaultNmToken(rep, normalize);
... | java | @Override
public void validateDefault(InputProblemReporter rep, boolean normalize)
throws XMLStreamException
{
String def = validateDefaultNmToken(rep, normalize);
if (normalize) {
mDefValue.setValue(def);
}
} | [
"@",
"Override",
"public",
"void",
"validateDefault",
"(",
"InputProblemReporter",
"rep",
",",
"boolean",
"normalize",
")",
"throws",
"XMLStreamException",
"{",
"String",
"def",
"=",
"validateDefaultNmToken",
"(",
"rep",
",",
"normalize",
")",
";",
"if",
"(",
"n... | Method called by the validator
to ask attribute to verify that the default it has (if any) is
valid for such type. | [
"Method",
"called",
"by",
"the",
"validator",
"to",
"ask",
"attribute",
"to",
"verify",
"that",
"the",
"default",
"it",
"has",
"(",
"if",
"any",
")",
"is",
"valid",
"for",
"such",
"type",
"."
] | train | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/dtd/DTDNmTokenAttr.java#L103-L111 |
Waikato/moa | moa/src/main/java/moa/classifiers/lazy/neighboursearch/kdtrees/MedianOfWidestDimension.java | MedianOfWidestDimension.select | public int select(int attIdx, int[] indices, int left, int right, int k) {
"""
Implements computation of the kth-smallest element according
to Manber's "Introduction to Algorithms".
@param attIdx The dimension/attribute of the instances in
which to find the kth-smallest element.
@param indices The master ind... | java | public int select(int attIdx, int[] indices, int left, int right, int k) {
if (left == right) {
return left;
} else {
int middle = partition(attIdx, indices, left, right);
if ((middle - left + 1) >= k) {
return select(attIdx, indices, left, middle, k);
} else {
retur... | [
"public",
"int",
"select",
"(",
"int",
"attIdx",
",",
"int",
"[",
"]",
"indices",
",",
"int",
"left",
",",
"int",
"right",
",",
"int",
"k",
")",
"{",
"if",
"(",
"left",
"==",
"right",
")",
"{",
"return",
"left",
";",
"}",
"else",
"{",
"int",
"m... | Implements computation of the kth-smallest element according
to Manber's "Introduction to Algorithms".
@param attIdx The dimension/attribute of the instances in
which to find the kth-smallest element.
@param indices The master index array containing indices of
the instances.
@param left The begining index of the porti... | [
"Implements",
"computation",
"of",
"the",
"kth",
"-",
"smallest",
"element",
"according",
"to",
"Manber",
"s",
"Introduction",
"to",
"Algorithms",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/lazy/neighboursearch/kdtrees/MedianOfWidestDimension.java#L175-L187 |
oaqa/uima-ecd | src/main/java/edu/cmu/lti/oaqa/ecd/driver/SimplePipelineRev803.java | SimplePipelineRev803.runPipeline | public static void runPipeline(final JCas jCas, final AnalysisEngineDescription... descs)
throws UIMAException, IOException {
"""
Run a sequence of {@link AnalysisEngine analysis engines} over a {@link JCas}. The result of
the analysis can be read from the JCas.
@param jCas
the jCas to process
@param d... | java | public static void runPipeline(final JCas jCas, final AnalysisEngineDescription... descs)
throws UIMAException, IOException {
runPipeline(jCas.getCas(), descs);
} | [
"public",
"static",
"void",
"runPipeline",
"(",
"final",
"JCas",
"jCas",
",",
"final",
"AnalysisEngineDescription",
"...",
"descs",
")",
"throws",
"UIMAException",
",",
"IOException",
"{",
"runPipeline",
"(",
"jCas",
".",
"getCas",
"(",
")",
",",
"descs",
")",... | Run a sequence of {@link AnalysisEngine analysis engines} over a {@link JCas}. The result of
the analysis can be read from the JCas.
@param jCas
the jCas to process
@param descs
a sequence of analysis engines to run on the jCas
@throws UIMAException
@throws IOException | [
"Run",
"a",
"sequence",
"of",
"{",
"@link",
"AnalysisEngine",
"analysis",
"engines",
"}",
"over",
"a",
"{",
"@link",
"JCas",
"}",
".",
"The",
"result",
"of",
"the",
"analysis",
"can",
"be",
"read",
"from",
"the",
"JCas",
"."
] | train | https://github.com/oaqa/uima-ecd/blob/09a0ae26647490b43affc36ab3a01100702b989f/src/main/java/edu/cmu/lti/oaqa/ecd/driver/SimplePipelineRev803.java#L208-L211 |
lionsoul2014/jcseg | jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/core/ADictionary.java | ADictionary.resetPrefixLength | public static boolean resetPrefixLength(JcsegTaskConfig config, ADictionary dic, int mixLength) {
"""
check and reset the value of {@link ADictionary#mixPrefixLength}
@param config
@param dic
@param mixLength
@return boolean
"""
if ( mixLength <= config.MAX_LENGTH
&& mixLe... | java | public static boolean resetPrefixLength(JcsegTaskConfig config, ADictionary dic, int mixLength)
{
if ( mixLength <= config.MAX_LENGTH
&& mixLength > dic.mixPrefixLength ) {
dic.mixPrefixLength = mixLength;
return true;
}
return false;
} | [
"public",
"static",
"boolean",
"resetPrefixLength",
"(",
"JcsegTaskConfig",
"config",
",",
"ADictionary",
"dic",
",",
"int",
"mixLength",
")",
"{",
"if",
"(",
"mixLength",
"<=",
"config",
".",
"MAX_LENGTH",
"&&",
"mixLength",
">",
"dic",
".",
"mixPrefixLength",
... | check and reset the value of {@link ADictionary#mixPrefixLength}
@param config
@param dic
@param mixLength
@return boolean | [
"check",
"and",
"reset",
"the",
"value",
"of",
"{",
"@link",
"ADictionary#mixPrefixLength",
"}"
] | train | https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/core/ADictionary.java#L833-L842 |
cybazeitalia/emaze-dysfunctional | src/main/java/net/emaze/dysfunctional/Searches.java | Searches.findOne | public static <E> E findOne(Iterator<E> iterator, Predicate<E> predicate) {
"""
Searches the only matching element returning it.
@param <E> the element type parameter
@param iterator the iterator to be searched
@param predicate the predicate to be applied to each element
@throws IllegalStateException if more... | java | public static <E> E findOne(Iterator<E> iterator, Predicate<E> predicate) {
final Iterator<E> filtered = new FilteringIterator<E>(iterator, predicate);
return new OneElement<E>().apply(filtered);
} | [
"public",
"static",
"<",
"E",
">",
"E",
"findOne",
"(",
"Iterator",
"<",
"E",
">",
"iterator",
",",
"Predicate",
"<",
"E",
">",
"predicate",
")",
"{",
"final",
"Iterator",
"<",
"E",
">",
"filtered",
"=",
"new",
"FilteringIterator",
"<",
"E",
">",
"("... | Searches the only matching element returning it.
@param <E> the element type parameter
@param iterator the iterator to be searched
@param predicate the predicate to be applied to each element
@throws IllegalStateException if more than one element is found
@throws IllegalArgumentException if no element matches
@return ... | [
"Searches",
"the",
"only",
"matching",
"element",
"returning",
"it",
"."
] | train | https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Searches.java#L510-L513 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/BooleanTypeUtil.java | BooleanTypeUtil.castToBoolean | static boolean castToBoolean(final Object in) throws PSQLException {
"""
Cast an Object value to the corresponding boolean value.
@param in Object to cast into boolean
@return boolean value corresponding to the cast of the object
@throws PSQLException PSQLState.CANNOT_COERCE
"""
if (LOGGER.isLoggable(... | java | static boolean castToBoolean(final Object in) throws PSQLException {
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, "Cast to boolean: \"{0}\"", String.valueOf(in));
}
if (in instanceof Boolean) {
return (Boolean) in;
}
if (in instanceof String) {
return fromString((Str... | [
"static",
"boolean",
"castToBoolean",
"(",
"final",
"Object",
"in",
")",
"throws",
"PSQLException",
"{",
"if",
"(",
"LOGGER",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"LOGGER",
".",
"log",
"(",
"Level",
".",
"FINE",
",",
"\"Cast to bo... | Cast an Object value to the corresponding boolean value.
@param in Object to cast into boolean
@return boolean value corresponding to the cast of the object
@throws PSQLException PSQLState.CANNOT_COERCE | [
"Cast",
"an",
"Object",
"value",
"to",
"the",
"corresponding",
"boolean",
"value",
"."
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/BooleanTypeUtil.java#L35-L52 |
adyliu/jafka | src/main/java/io/jafka/consumer/ZookeeperConsumerConnector.java | ZookeeperConsumerConnector.generateConsumerId | private String generateConsumerId() {
"""
generate random consumerid ( hostname-currenttime-uuid.sub(8) )
@return random consumerid
"""
UUID uuid = UUID.randomUUID();
try {
return format("%s-%d-%s", InetAddress.getLocalHost().getHostName(), //
System.currentTi... | java | private String generateConsumerId() {
UUID uuid = UUID.randomUUID();
try {
return format("%s-%d-%s", InetAddress.getLocalHost().getHostName(), //
System.currentTimeMillis(),//
Long.toHexString(uuid.getMostSignificantBits()).substring(0, 8));
} ... | [
"private",
"String",
"generateConsumerId",
"(",
")",
"{",
"UUID",
"uuid",
"=",
"UUID",
".",
"randomUUID",
"(",
")",
";",
"try",
"{",
"return",
"format",
"(",
"\"%s-%d-%s\"",
",",
"InetAddress",
".",
"getLocalHost",
"(",
")",
".",
"getHostName",
"(",
")",
... | generate random consumerid ( hostname-currenttime-uuid.sub(8) )
@return random consumerid | [
"generate",
"random",
"consumerid",
"(",
"hostname",
"-",
"currenttime",
"-",
"uuid",
".",
"sub",
"(",
"8",
")",
")"
] | train | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/consumer/ZookeeperConsumerConnector.java#L266-L282 |
xm-online/xm-commons | xm-commons-permission/src/main/java/com/icthh/xm/commons/permission/inspector/kafka/PrivilegeEventProducer.java | PrivilegeEventProducer.sendEvent | @Deprecated
public void sendEvent(String eventId, String ymlPrivileges) {
"""
Build message for kafka's event and send it.
@param eventId the event id
@param ymlPrivileges the content
@deprecated left only for backward compatibility, use {@link #sendEvent(String, Set)}
"""
SystemEvent ev... | java | @Deprecated
public void sendEvent(String eventId, String ymlPrivileges) {
SystemEvent event = buildSystemEvent(eventId, ymlPrivileges);
serializeEvent(event).ifPresent(this::send);
} | [
"@",
"Deprecated",
"public",
"void",
"sendEvent",
"(",
"String",
"eventId",
",",
"String",
"ymlPrivileges",
")",
"{",
"SystemEvent",
"event",
"=",
"buildSystemEvent",
"(",
"eventId",
",",
"ymlPrivileges",
")",
";",
"serializeEvent",
"(",
"event",
")",
".",
"if... | Build message for kafka's event and send it.
@param eventId the event id
@param ymlPrivileges the content
@deprecated left only for backward compatibility, use {@link #sendEvent(String, Set)} | [
"Build",
"message",
"for",
"kafka",
"s",
"event",
"and",
"send",
"it",
"."
] | train | https://github.com/xm-online/xm-commons/blob/43eb2273adb96f40830d7b905ee3a767b8715caf/xm-commons-permission/src/main/java/com/icthh/xm/commons/permission/inspector/kafka/PrivilegeEventProducer.java#L48-L52 |
blinkfox/zealot | src/main/java/com/blinkfox/zealot/core/ZealotKhala.java | ZealotKhala.notLike | public ZealotKhala notLike(String field, Object value) {
"""
生成" NOT LIKE "模糊查询的SQL片段.
<p>示例:传入 {"b.title", "Spring"} 两个参数,生成的SQL片段为:" b.title NOT LIKE ? ", SQL参数为:{"%Spring%"}</p>
@param field 数据库字段
@param value 值
@return ZealotKhala实例
"""
return this.doLike(ZealotConst.ONE_SPACE, field, value, ... | java | public ZealotKhala notLike(String field, Object value) {
return this.doLike(ZealotConst.ONE_SPACE, field, value, true, false);
} | [
"public",
"ZealotKhala",
"notLike",
"(",
"String",
"field",
",",
"Object",
"value",
")",
"{",
"return",
"this",
".",
"doLike",
"(",
"ZealotConst",
".",
"ONE_SPACE",
",",
"field",
",",
"value",
",",
"true",
",",
"false",
")",
";",
"}"
] | 生成" NOT LIKE "模糊查询的SQL片段.
<p>示例:传入 {"b.title", "Spring"} 两个参数,生成的SQL片段为:" b.title NOT LIKE ? ", SQL参数为:{"%Spring%"}</p>
@param field 数据库字段
@param value 值
@return ZealotKhala实例 | [
"生成",
"NOT",
"LIKE",
"模糊查询的SQL片段",
".",
"<p",
">",
"示例:传入",
"{",
"b",
".",
"title",
"Spring",
"}",
"两个参数,生成的SQL片段为:",
"b",
".",
"title",
"NOT",
"LIKE",
"?",
"SQL参数为",
":",
"{",
"%Spring%",
"}",
"<",
"/",
"p",
">"
] | train | https://github.com/blinkfox/zealot/blob/21b00fa3e4ed42188eef3116d494e112e7a4194c/src/main/java/com/blinkfox/zealot/core/ZealotKhala.java#L965-L967 |
Azure/azure-sdk-for-java | storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountsInner.java | StorageAccountsInner.listKeys | public StorageAccountListKeysResultInner listKeys(String resourceGroupName, String accountName) {
"""
Lists the access keys for the specified storage account.
@param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive.
@param accountName The name of the... | java | public StorageAccountListKeysResultInner listKeys(String resourceGroupName, String accountName) {
return listKeysWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body();
} | [
"public",
"StorageAccountListKeysResultInner",
"listKeys",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
")",
"{",
"return",
"listKeysWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
")",
".",
"toBlocking",
"(",
")",
".",
"sin... | Lists the access keys for the specified storage account.
@param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive.
@param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 character... | [
"Lists",
"the",
"access",
"keys",
"for",
"the",
"specified",
"storage",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountsInner.java#L833-L835 |
OpenTSDB/opentsdb | src/tsd/StatsRpc.java | StatsRpc.printRegionClientStats | private void printRegionClientStats(final TSDB tsdb, final HttpQuery query) {
"""
Display stats for each region client
@param tsdb The TSDB to use for fetching stats
@param query The query to respond to
"""
final List<RegionClientStats> region_stats = tsdb.getClient().regionStats();
final List<Map<St... | java | private void printRegionClientStats(final TSDB tsdb, final HttpQuery query) {
final List<RegionClientStats> region_stats = tsdb.getClient().regionStats();
final List<Map<String, Object>> stats =
new ArrayList<Map<String, Object>>(region_stats.size());
for (final RegionClientStats rcs : region_stats... | [
"private",
"void",
"printRegionClientStats",
"(",
"final",
"TSDB",
"tsdb",
",",
"final",
"HttpQuery",
"query",
")",
"{",
"final",
"List",
"<",
"RegionClientStats",
">",
"region_stats",
"=",
"tsdb",
".",
"getClient",
"(",
")",
".",
"regionStats",
"(",
")",
";... | Display stats for each region client
@param tsdb The TSDB to use for fetching stats
@param query The query to respond to | [
"Display",
"stats",
"for",
"each",
"region",
"client"
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/StatsRpc.java#L153-L176 |
Netflix/ribbon | ribbon-loadbalancer/src/main/java/com/netflix/client/ClientFactory.java | ClientFactory.getNamedClient | public static synchronized IClient getNamedClient(String name) {
"""
Return the named client from map if already created. Otherwise creates the client using the configuration returned by {@link #getNamedConfig(String)}.
@throws RuntimeException if an error occurs in creating the client.
"""
if (simp... | java | public static synchronized IClient getNamedClient(String name) {
if (simpleClientMap.get(name) != null) {
return simpleClientMap.get(name);
}
try {
return registerClientFromProperties(name, getNamedConfig(name));
} catch (ClientException e) {
throw new... | [
"public",
"static",
"synchronized",
"IClient",
"getNamedClient",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"simpleClientMap",
".",
"get",
"(",
"name",
")",
"!=",
"null",
")",
"{",
"return",
"simpleClientMap",
".",
"get",
"(",
"name",
")",
";",
"}",
"tr... | Return the named client from map if already created. Otherwise creates the client using the configuration returned by {@link #getNamedConfig(String)}.
@throws RuntimeException if an error occurs in creating the client. | [
"Return",
"the",
"named",
"client",
"from",
"map",
"if",
"already",
"created",
".",
"Otherwise",
"creates",
"the",
"client",
"using",
"the",
"configuration",
"returned",
"by",
"{",
"@link",
"#getNamedConfig",
"(",
"String",
")",
"}",
"."
] | train | https://github.com/Netflix/ribbon/blob/d15cd7715b0bf2f64ae6ca98c5e4d184f178e261/ribbon-loadbalancer/src/main/java/com/netflix/client/ClientFactory.java#L95-L104 |
google/jimfs | jimfs/src/main/java/com/google/common/jimfs/RegularFile.java | RegularFile.bytesToRead | private long bytesToRead(long pos, long max) {
"""
Returns the number of bytes that can be read starting at position {@code pos} (up to a maximum
of {@code max}) or -1 if {@code pos} is greater than or equal to the current size.
"""
long available = size - pos;
if (available <= 0) {
return -1;
... | java | private long bytesToRead(long pos, long max) {
long available = size - pos;
if (available <= 0) {
return -1;
}
return Math.min(available, max);
} | [
"private",
"long",
"bytesToRead",
"(",
"long",
"pos",
",",
"long",
"max",
")",
"{",
"long",
"available",
"=",
"size",
"-",
"pos",
";",
"if",
"(",
"available",
"<=",
"0",
")",
"{",
"return",
"-",
"1",
";",
"}",
"return",
"Math",
".",
"min",
"(",
"... | Returns the number of bytes that can be read starting at position {@code pos} (up to a maximum
of {@code max}) or -1 if {@code pos} is greater than or equal to the current size. | [
"Returns",
"the",
"number",
"of",
"bytes",
"that",
"can",
"be",
"read",
"starting",
"at",
"position",
"{"
] | train | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/RegularFile.java#L620-L626 |
legsem/legstar-core2 | legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/XsdEmitter.java | XsdEmitter.createXmlSchemaType | public XmlSchemaType createXmlSchemaType(final XsdDataItem xsdDataItem) {
"""
Maps a COBOL data item to an XML schema type.
<ul>
<li>COBOL elementary data items are mapped to XML Schema simple types.</li>
<li>COBOL structures are mapped to XML schema complex Types.</li>
</ul>
@param xsdDataItem COBOL data i... | java | public XmlSchemaType createXmlSchemaType(final XsdDataItem xsdDataItem) {
if (xsdDataItem.getXsdType() == null) {
return null;
}
switch (xsdDataItem.getXsdType()) {
case COMPLEX:
return createXmlSchemaComplexType(xsdDataItem);
case STRING:
retu... | [
"public",
"XmlSchemaType",
"createXmlSchemaType",
"(",
"final",
"XsdDataItem",
"xsdDataItem",
")",
"{",
"if",
"(",
"xsdDataItem",
".",
"getXsdType",
"(",
")",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"switch",
"(",
"xsdDataItem",
".",
"getXsdType",
... | Maps a COBOL data item to an XML schema type.
<ul>
<li>COBOL elementary data items are mapped to XML Schema simple types.</li>
<li>COBOL structures are mapped to XML schema complex Types.</li>
</ul>
@param xsdDataItem COBOL data item decorated with XSD attributes
@return a corresponding XML schema type | [
"Maps",
"a",
"COBOL",
"data",
"item",
"to",
"an",
"XML",
"schema",
"type",
".",
"<ul",
">",
"<li",
">",
"COBOL",
"elementary",
"data",
"items",
"are",
"mapped",
"to",
"XML",
"Schema",
"simple",
"types",
".",
"<",
"/",
"li",
">",
"<li",
">",
"COBOL",
... | train | https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/XsdEmitter.java#L92-L127 |
TNG/JGiven | jgiven-core/src/main/java/com/tngtech/jgiven/report/model/StepFormatter.java | StepFormatter.flushCurrentWord | private static void flushCurrentWord( StringBuilder currentWords, List<Word> formattedWords, boolean cutWhitespace ) {
"""
Appends the accumulated words to the resulting words. Trailing whitespace is removed because of the
postprocessing that inserts custom whitespace
@param currentWords is the {@link StringBu... | java | private static void flushCurrentWord( StringBuilder currentWords, List<Word> formattedWords, boolean cutWhitespace ) {
if( currentWords.length() > 0 ) {
if( cutWhitespace && currentWords.charAt( currentWords.length() - 1 ) == ' ' ) {
currentWords.setLength( currentWords.length() - 1 ... | [
"private",
"static",
"void",
"flushCurrentWord",
"(",
"StringBuilder",
"currentWords",
",",
"List",
"<",
"Word",
">",
"formattedWords",
",",
"boolean",
"cutWhitespace",
")",
"{",
"if",
"(",
"currentWords",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"if",
... | Appends the accumulated words to the resulting words. Trailing whitespace is removed because of the
postprocessing that inserts custom whitespace
@param currentWords is the {@link StringBuilder} of the accumulated words
@param formattedWords is the list that is being appended to | [
"Appends",
"the",
"accumulated",
"words",
"to",
"the",
"resulting",
"words",
".",
"Trailing",
"whitespace",
"is",
"removed",
"because",
"of",
"the",
"postprocessing",
"that",
"inserts",
"custom",
"whitespace"
] | train | https://github.com/TNG/JGiven/blob/1a69248fc6d7eb380cdc4542e3be273842889748/jgiven-core/src/main/java/com/tngtech/jgiven/report/model/StepFormatter.java#L302-L310 |
apache/flink | flink-core/src/main/java/org/apache/flink/configuration/Configuration.java | Configuration.getString | public String getString(String key, String defaultValue) {
"""
Returns the value associated with the given key as a string.
@param key
the key pointing to the associated value
@param defaultValue
the default value which is returned in case there is no value associated with the given key
@return the (default... | java | public String getString(String key, String defaultValue) {
Object o = getRawValue(key);
if (o == null) {
return defaultValue;
} else {
return o.toString();
}
} | [
"public",
"String",
"getString",
"(",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"Object",
"o",
"=",
"getRawValue",
"(",
"key",
")",
";",
"if",
"(",
"o",
"==",
"null",
")",
"{",
"return",
"defaultValue",
";",
"}",
"else",
"{",
"return",
... | Returns the value associated with the given key as a string.
@param key
the key pointing to the associated value
@param defaultValue
the default value which is returned in case there is no value associated with the given key
@return the (default) value associated with the given key | [
"Returns",
"the",
"value",
"associated",
"with",
"the",
"given",
"key",
"as",
"a",
"string",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/Configuration.java#L134-L141 |
foundation-runtime/service-directory | 2.0/sd-core/src/main/java/com/cisco/oss/foundation/directory/ServiceDirectoryThread.java | ServiceDirectoryThread.getThread | public static Thread getThread(Runnable runnable, String name, boolean deamon) {
"""
Get a Thread.
@param runnable
the runnable task.
@param name
the thread name.
@param deamon
the deamon flag.
@return
the Thread.
"""
return doThread(runnable, name, deamon);
} | java | public static Thread getThread(Runnable runnable, String name, boolean deamon){
return doThread(runnable, name, deamon);
} | [
"public",
"static",
"Thread",
"getThread",
"(",
"Runnable",
"runnable",
",",
"String",
"name",
",",
"boolean",
"deamon",
")",
"{",
"return",
"doThread",
"(",
"runnable",
",",
"name",
",",
"deamon",
")",
";",
"}"
] | Get a Thread.
@param runnable
the runnable task.
@param name
the thread name.
@param deamon
the deamon flag.
@return
the Thread. | [
"Get",
"a",
"Thread",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-core/src/main/java/com/cisco/oss/foundation/directory/ServiceDirectoryThread.java#L80-L82 |
dbracewell/hermes | hermes-core/src/main/java/com/davidbracewell/hermes/corpus/spi/ColumnBasedFormat.java | ColumnBasedFormat.createDocument | final Document createDocument(List<String> row, DocumentFactory documentFactory) {
"""
Create document document.
@param row the row
@param documentFactory the document factory
@return the document
"""
String id = StringUtils.EMPTY;
String content = StringUtils.EMPTY;
Language langu... | java | final Document createDocument(List<String> row, DocumentFactory documentFactory) {
String id = StringUtils.EMPTY;
String content = StringUtils.EMPTY;
Language language = documentFactory.getDefaultLanguage();
Map<AttributeType, Object> attributeMap = new HashMap<>();
String idField = Config.get(conf... | [
"final",
"Document",
"createDocument",
"(",
"List",
"<",
"String",
">",
"row",
",",
"DocumentFactory",
"documentFactory",
")",
"{",
"String",
"id",
"=",
"StringUtils",
".",
"EMPTY",
";",
"String",
"content",
"=",
"StringUtils",
".",
"EMPTY",
";",
"Language",
... | Create document document.
@param row the row
@param documentFactory the document factory
@return the document | [
"Create",
"document",
"document",
"."
] | train | https://github.com/dbracewell/hermes/blob/9ebefe7ad5dea1b731ae6931a30771eb75325ea3/hermes-core/src/main/java/com/davidbracewell/hermes/corpus/spi/ColumnBasedFormat.java#L65-L91 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkProfilesInner.java | NetworkProfilesInner.createOrUpdate | public NetworkProfileInner createOrUpdate(String resourceGroupName, String networkProfileName, NetworkProfileInner parameters) {
"""
Creates or updates a network profile.
@param resourceGroupName The name of the resource group.
@param networkProfileName The name of the network profile.
@param parameters Param... | java | public NetworkProfileInner createOrUpdate(String resourceGroupName, String networkProfileName, NetworkProfileInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkProfileName, parameters).toBlocking().last().body();
} | [
"public",
"NetworkProfileInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkProfileName",
",",
"NetworkProfileInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"networkProfileName... | Creates or updates a network profile.
@param resourceGroupName The name of the resource group.
@param networkProfileName The name of the network profile.
@param parameters Parameters supplied to the create or update network profile operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@t... | [
"Creates",
"or",
"updates",
"a",
"network",
"profile",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkProfilesInner.java#L347-L349 |
liferay/com-liferay-commerce | commerce-tax-api/src/main/java/com/liferay/commerce/tax/model/CommerceTaxMethodWrapper.java | CommerceTaxMethodWrapper.getName | @Override
public String getName(String languageId, boolean useDefault) {
"""
Returns the localized name of this commerce tax method in the language, optionally using the default language if no localization exists for the requested language.
@param languageId the ID of the language
@param useDefault whether to... | java | @Override
public String getName(String languageId, boolean useDefault) {
return _commerceTaxMethod.getName(languageId, useDefault);
} | [
"@",
"Override",
"public",
"String",
"getName",
"(",
"String",
"languageId",
",",
"boolean",
"useDefault",
")",
"{",
"return",
"_commerceTaxMethod",
".",
"getName",
"(",
"languageId",
",",
"useDefault",
")",
";",
"}"
] | Returns the localized name of this commerce tax method in the language, optionally using the default language if no localization exists for the requested language.
@param languageId the ID of the language
@param useDefault whether to use the default language if no localization exists for the requested language
@return... | [
"Returns",
"the",
"localized",
"name",
"of",
"this",
"commerce",
"tax",
"method",
"in",
"the",
"language",
"optionally",
"using",
"the",
"default",
"language",
"if",
"no",
"localization",
"exists",
"for",
"the",
"requested",
"language",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-tax-api/src/main/java/com/liferay/commerce/tax/model/CommerceTaxMethodWrapper.java#L374-L377 |
buschmais/extended-objects | api/src/main/java/com/buschmais/xo/api/bootstrap/osgi/XOSGi.java | XOSGi.createXOManagerFactory | public static XOManagerFactory createXOManagerFactory(String name) {
"""
Create a {@link com.buschmais.xo.api.XOManagerFactory} for the XO unit
identified by name.
<p>
Internally it performs a lookup in the OSGi service registry to retrieve the
XOManagerFactory service that is bound to the given XO unit name. ... | java | public static XOManagerFactory createXOManagerFactory(String name) {
if (OSGiUtil.isXOLoadedAsOSGiBundle()) {
try {
BundleContext bundleContext = FrameworkUtil.getBundle(XOSGi.class).getBundleContext();
String filterString = "(name=" + name + ")";
Coll... | [
"public",
"static",
"XOManagerFactory",
"createXOManagerFactory",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"OSGiUtil",
".",
"isXOLoadedAsOSGiBundle",
"(",
")",
")",
"{",
"try",
"{",
"BundleContext",
"bundleContext",
"=",
"FrameworkUtil",
".",
"getBundle",
"(",
... | Create a {@link com.buschmais.xo.api.XOManagerFactory} for the XO unit
identified by name.
<p>
Internally it performs a lookup in the OSGi service registry to retrieve the
XOManagerFactory service that is bound to the given XO unit name. The bundle
providing this XO unit must be processed by the OSGi bundle listener.
<... | [
"Create",
"a",
"{",
"@link",
"com",
".",
"buschmais",
".",
"xo",
".",
"api",
".",
"XOManagerFactory",
"}",
"for",
"the",
"XO",
"unit",
"identified",
"by",
"name",
".",
"<p",
">",
"Internally",
"it",
"performs",
"a",
"lookup",
"in",
"the",
"OSGi",
"serv... | train | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/api/src/main/java/com/buschmais/xo/api/bootstrap/osgi/XOSGi.java#L37-L63 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringParser.java | StringParser.parseBool | public static boolean parseBool (@Nullable final String sStr, final boolean bDefault) {
"""
Parse the given {@link String} as boolean value. All values that are equal
to "true" (ignoring case) will result in <code>true</code> return values.
All values that are equal to "false" (ignoring case) will result in
<co... | java | public static boolean parseBool (@Nullable final String sStr, final boolean bDefault)
{
// Do we need to start thinking at all?
if (sStr != null && sStr.length () > 0)
{
// Is it true?
if (sStr.equalsIgnoreCase ("true"))
return true;
// Is it false?
if (sStr.equalsIgnoreCa... | [
"public",
"static",
"boolean",
"parseBool",
"(",
"@",
"Nullable",
"final",
"String",
"sStr",
",",
"final",
"boolean",
"bDefault",
")",
"{",
"// Do we need to start thinking at all?",
"if",
"(",
"sStr",
"!=",
"null",
"&&",
"sStr",
".",
"length",
"(",
")",
">",
... | Parse the given {@link String} as boolean value. All values that are equal
to "true" (ignoring case) will result in <code>true</code> return values.
All values that are equal to "false" (ignoring case) will result in
<code>false</code> return values. All other values will return the default.
@param sStr
The string to ... | [
"Parse",
"the",
"given",
"{",
"@link",
"String",
"}",
"as",
"boolean",
"value",
".",
"All",
"values",
"that",
"are",
"equal",
"to",
"true",
"(",
"ignoring",
"case",
")",
"will",
"result",
"in",
"<code",
">",
"true<",
"/",
"code",
">",
"return",
"values... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringParser.java#L132-L148 |
actorapp/actor-platform | actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/encryption/KeyManagerActor.java | KeyManagerActor.onPublicKeysGroupAdded | private void onPublicKeysGroupAdded(int uid, ApiEncryptionKeyGroup keyGroup) {
"""
Handler for adding new key group
@param uid User's id
@param keyGroup Added key group
"""
UserKeys userKeys = getCachedUserKeys(uid);
if (userKeys == null) {
return;
}
UserKey... | java | private void onPublicKeysGroupAdded(int uid, ApiEncryptionKeyGroup keyGroup) {
UserKeys userKeys = getCachedUserKeys(uid);
if (userKeys == null) {
return;
}
UserKeysGroup validatedKeysGroup = validateUserKeysGroup(uid, keyGroup);
if (validatedKeysGroup != null) {
... | [
"private",
"void",
"onPublicKeysGroupAdded",
"(",
"int",
"uid",
",",
"ApiEncryptionKeyGroup",
"keyGroup",
")",
"{",
"UserKeys",
"userKeys",
"=",
"getCachedUserKeys",
"(",
"uid",
")",
";",
"if",
"(",
"userKeys",
"==",
"null",
")",
"{",
"return",
";",
"}",
"Us... | Handler for adding new key group
@param uid User's id
@param keyGroup Added key group | [
"Handler",
"for",
"adding",
"new",
"key",
"group"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/encryption/KeyManagerActor.java#L440-L452 |
martint/jmxutils | src/main/java/org/weakref/jmx/ObjectNames.java | ObjectNames.generatedNameOf | public static String generatedNameOf(Class<?> clazz, Named named) {
"""
Produce a generated JMX object name.
@return JMX object name of the form "[package_name]:type=[class_name],name=[named_value]"
"""
return builder(clazz, named).build();
} | java | public static String generatedNameOf(Class<?> clazz, Named named)
{
return builder(clazz, named).build();
} | [
"public",
"static",
"String",
"generatedNameOf",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"Named",
"named",
")",
"{",
"return",
"builder",
"(",
"clazz",
",",
"named",
")",
".",
"build",
"(",
")",
";",
"}"
] | Produce a generated JMX object name.
@return JMX object name of the form "[package_name]:type=[class_name],name=[named_value]" | [
"Produce",
"a",
"generated",
"JMX",
"object",
"name",
"."
] | train | https://github.com/martint/jmxutils/blob/f2770ba1f3c126fb841c388d631456afd68dbf25/src/main/java/org/weakref/jmx/ObjectNames.java#L49-L52 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/os/BundleUtils.java | BundleUtils.optParcelable | @Nullable
public static <T extends Parcelable> T optParcelable(@Nullable Bundle bundle, @Nullable String key, @Nullable T fallback) {
"""
Returns a optional {@link android.os.Parcelable} value. In other words, returns the value mapped by key if it exists and is a {@link android.os.Parcelable}.
The bundle argu... | java | @Nullable
public static <T extends Parcelable> T optParcelable(@Nullable Bundle bundle, @Nullable String key, @Nullable T fallback) {
if (bundle == null) {
return fallback;
}
return bundle.getParcelable(key);
} | [
"@",
"Nullable",
"public",
"static",
"<",
"T",
"extends",
"Parcelable",
">",
"T",
"optParcelable",
"(",
"@",
"Nullable",
"Bundle",
"bundle",
",",
"@",
"Nullable",
"String",
"key",
",",
"@",
"Nullable",
"T",
"fallback",
")",
"{",
"if",
"(",
"bundle",
"=="... | Returns a optional {@link android.os.Parcelable} value. In other words, returns the value mapped by key if it exists and is a {@link android.os.Parcelable}.
The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns null.
@param bundle a bundle. If the bundle is null, this method will... | [
"Returns",
"a",
"optional",
"{"
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/os/BundleUtils.java#L703-L709 |
hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/TypeUtil.java | TypeUtil.equalsOne | @Deprecated
public static boolean equalsOne(Object _obj, Object... _arrObj) {
"""
Returns true if the specified object equals at least one of the specified other objects.
@param _obj object
@param _arrObj array of objects to compare to
@return true if equal, false otherwise or if either parameter is null
... | java | @Deprecated
public static boolean equalsOne(Object _obj, Object... _arrObj) {
return CompareUtil.equalsOne(_obj, _arrObj);
} | [
"@",
"Deprecated",
"public",
"static",
"boolean",
"equalsOne",
"(",
"Object",
"_obj",
",",
"Object",
"...",
"_arrObj",
")",
"{",
"return",
"CompareUtil",
".",
"equalsOne",
"(",
"_obj",
",",
"_arrObj",
")",
";",
"}"
] | Returns true if the specified object equals at least one of the specified other objects.
@param _obj object
@param _arrObj array of objects to compare to
@return true if equal, false otherwise or if either parameter is null
@deprecated Use {@link CompareUtil#equalsOne(Object, Object...)} | [
"Returns",
"true",
"if",
"the",
"specified",
"object",
"equals",
"at",
"least",
"one",
"of",
"the",
"specified",
"other",
"objects",
".",
"@param",
"_obj",
"object",
"@param",
"_arrObj",
"array",
"of",
"objects",
"to",
"compare",
"to",
"@return",
"true",
"if... | train | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/TypeUtil.java#L254-L257 |
networknt/light-4j | utility/src/main/java/com/networknt/utility/CharSequenceUtils.java | CharSequenceUtils.subSequence | public static CharSequence subSequence(final CharSequence cs, final int start) {
"""
<p>Returns a new {@code CharSequence} that is a subsequence of this
sequence starting with the {@code char} value at the specified index.</p>
<p>This provides the {@code CharSequence} equivalent to {@link String#substring(int)... | java | public static CharSequence subSequence(final CharSequence cs, final int start) {
return cs == null ? null : cs.subSequence(start, cs.length());
} | [
"public",
"static",
"CharSequence",
"subSequence",
"(",
"final",
"CharSequence",
"cs",
",",
"final",
"int",
"start",
")",
"{",
"return",
"cs",
"==",
"null",
"?",
"null",
":",
"cs",
".",
"subSequence",
"(",
"start",
",",
"cs",
".",
"length",
"(",
")",
"... | <p>Returns a new {@code CharSequence} that is a subsequence of this
sequence starting with the {@code char} value at the specified index.</p>
<p>This provides the {@code CharSequence} equivalent to {@link String#substring(int)}.
The length (in {@code char}) of the returned sequence is {@code length() - start},
so if {... | [
"<p",
">",
"Returns",
"a",
"new",
"{",
"@code",
"CharSequence",
"}",
"that",
"is",
"a",
"subsequence",
"of",
"this",
"sequence",
"starting",
"with",
"the",
"{",
"@code",
"char",
"}",
"value",
"at",
"the",
"specified",
"index",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/utility/src/main/java/com/networknt/utility/CharSequenceUtils.java#L56-L58 |
palatable/lambda | src/main/java/com/jnape/palatable/lambda/adt/Either.java | Either.flatMap | @Override
@SuppressWarnings("RedundantTypeArguments")
public <R2> Either<L, R2> flatMap(Function<? super R, ? extends Monad<R2, Either<L, ?>>> rightFn) {
"""
If a right value, unwrap it and apply it to <code>rightFn</code>, returning the resulting
<code>Either<L ,R></code>. Otherwise, return the lef... | java | @Override
@SuppressWarnings("RedundantTypeArguments")
public <R2> Either<L, R2> flatMap(Function<? super R, ? extends Monad<R2, Either<L, ?>>> rightFn) {
return match(Either::left, rightFn.andThen(Monad<R2, Either<L, ?>>::coerce));
} | [
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"RedundantTypeArguments\"",
")",
"public",
"<",
"R2",
">",
"Either",
"<",
"L",
",",
"R2",
">",
"flatMap",
"(",
"Function",
"<",
"?",
"super",
"R",
",",
"?",
"extends",
"Monad",
"<",
"R2",
",",
"Either",
... | If a right value, unwrap it and apply it to <code>rightFn</code>, returning the resulting
<code>Either<L ,R></code>. Otherwise, return the left value.
<p>
Note that because this monadic form of <code>flatMap</code> only supports mapping over a theoretical right value,
the resulting <code>Either</code> must be inv... | [
"If",
"a",
"right",
"value",
"unwrap",
"it",
"and",
"apply",
"it",
"to",
"<code",
">",
"rightFn<",
"/",
"code",
">",
"returning",
"the",
"resulting",
"<code",
">",
"Either<",
";",
"L",
"R>",
";",
"<",
"/",
"code",
">",
".",
"Otherwise",
"return",
... | train | https://github.com/palatable/lambda/blob/b643ba836c5916d1d8193822e5efb4e7b40c489a/src/main/java/com/jnape/palatable/lambda/adt/Either.java#L131-L135 |
wkgcass/Style | src/main/java/net/cassite/style/SwitchBlock.java | SwitchBlock.Case | public SwitchBlock<T, R> Case(T ca, R res) {
"""
add a Case block to the expression
@param ca the object for switch-expression to match
@param res an object for expression to return when matches.
@return <code>this</code>
"""
return Case(ca, () -> res);
} | java | public SwitchBlock<T, R> Case(T ca, R res) {
return Case(ca, () -> res);
} | [
"public",
"SwitchBlock",
"<",
"T",
",",
"R",
">",
"Case",
"(",
"T",
"ca",
",",
"R",
"res",
")",
"{",
"return",
"Case",
"(",
"ca",
",",
"(",
")",
"->",
"res",
")",
";",
"}"
] | add a Case block to the expression
@param ca the object for switch-expression to match
@param res an object for expression to return when matches.
@return <code>this</code> | [
"add",
"a",
"Case",
"block",
"to",
"the",
"expression"
] | train | https://github.com/wkgcass/Style/blob/db3ea64337251f46f734279480e365293bececbd/src/main/java/net/cassite/style/SwitchBlock.java#L53-L55 |
shrinkwrap/descriptors | metadata-parser/src/main/java/org/jboss/shrinkwrap/descriptor/metadata/PackageInfo.java | PackageInfo.copyPackageInfo | public static void copyPackageInfo(final MetadataParserPath path, final Metadata metadata, final boolean verbose) throws IOException {
"""
Copies the optional packageInfo files into the packages.
@param path
@param metadata
@throws IOException
"""
for (final MetadataDescriptor descriptor : metadata.... | java | public static void copyPackageInfo(final MetadataParserPath path, final Metadata metadata, final boolean verbose) throws IOException {
for (final MetadataDescriptor descriptor : metadata.getMetadataDescriptorList()) {
if (descriptor.getPathToPackageInfoApi() != null) {
final File sou... | [
"public",
"static",
"void",
"copyPackageInfo",
"(",
"final",
"MetadataParserPath",
"path",
",",
"final",
"Metadata",
"metadata",
",",
"final",
"boolean",
"verbose",
")",
"throws",
"IOException",
"{",
"for",
"(",
"final",
"MetadataDescriptor",
"descriptor",
":",
"m... | Copies the optional packageInfo files into the packages.
@param path
@param metadata
@throws IOException | [
"Copies",
"the",
"optional",
"packageInfo",
"files",
"into",
"the",
"packages",
"."
] | train | https://github.com/shrinkwrap/descriptors/blob/023ba080e6396b9f4dd8275dc4e5c0ebb6b5e6ba/metadata-parser/src/main/java/org/jboss/shrinkwrap/descriptor/metadata/PackageInfo.java#L42-L58 |
sevensource/html-email-service | src/main/java/org/sevensource/commons/email/model/DefaultEmailModel.java | DefaultEmailModel.addTo | public void addTo(String address, String personal) throws AddressException {
"""
adds a recipient (To)
@param address a valid email address
@param personal the real world name of the sender (can be null)
@throws AddressException in case of an invalid email address
"""
if(to == null) {
to = new ArrayL... | java | public void addTo(String address, String personal) throws AddressException {
if(to == null) {
to = new ArrayList<>();
}
to.add( toInternetAddress(address, personal) );
} | [
"public",
"void",
"addTo",
"(",
"String",
"address",
",",
"String",
"personal",
")",
"throws",
"AddressException",
"{",
"if",
"(",
"to",
"==",
"null",
")",
"{",
"to",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"}",
"to",
".",
"add",
"(",
"toIntern... | adds a recipient (To)
@param address a valid email address
@param personal the real world name of the sender (can be null)
@throws AddressException in case of an invalid email address | [
"adds",
"a",
"recipient",
"(",
"To",
")"
] | train | https://github.com/sevensource/html-email-service/blob/a55d9ef1a2173917cb5f870854bc24e5aaebd182/src/main/java/org/sevensource/commons/email/model/DefaultEmailModel.java#L93-L98 |
btaz/data-util | src/main/java/com/btaz/util/files/FileReducer.java | FileReducer.reduceItems | private static void reduceItems(FileOutputCollector collector, Reducer reducable, ArrayList<String> items)
throws IOException {
"""
Call reducer
@param writer writer
@param reducable reducable callback
@param items items
@throws IOException IO exception
"""
if(items != null) {
... | java | private static void reduceItems(FileOutputCollector collector, Reducer reducable, ArrayList<String> items)
throws IOException {
if(items != null) {
// call reducer
reducable.reduce(items, collector);
}
} | [
"private",
"static",
"void",
"reduceItems",
"(",
"FileOutputCollector",
"collector",
",",
"Reducer",
"reducable",
",",
"ArrayList",
"<",
"String",
">",
"items",
")",
"throws",
"IOException",
"{",
"if",
"(",
"items",
"!=",
"null",
")",
"{",
"// call reducer",
"... | Call reducer
@param writer writer
@param reducable reducable callback
@param items items
@throws IOException IO exception | [
"Call",
"reducer"
] | train | https://github.com/btaz/data-util/blob/f01de64854c456a88a31ffbe8bac6d605151b496/src/main/java/com/btaz/util/files/FileReducer.java#L94-L100 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.getHierarchicalEntityAsync | public Observable<HierarchicalEntityExtractor> getHierarchicalEntityAsync(UUID appId, String versionId, UUID hEntityId) {
"""
Gets information about the hierarchical entity model.
@param appId The application ID.
@param versionId The version ID.
@param hEntityId The hierarchical entity extractor ID.
@throws ... | java | public Observable<HierarchicalEntityExtractor> getHierarchicalEntityAsync(UUID appId, String versionId, UUID hEntityId) {
return getHierarchicalEntityWithServiceResponseAsync(appId, versionId, hEntityId).map(new Func1<ServiceResponse<HierarchicalEntityExtractor>, HierarchicalEntityExtractor>() {
@Ov... | [
"public",
"Observable",
"<",
"HierarchicalEntityExtractor",
">",
"getHierarchicalEntityAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"hEntityId",
")",
"{",
"return",
"getHierarchicalEntityWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
... | Gets information about the hierarchical entity model.
@param appId The application ID.
@param versionId The version ID.
@param hEntityId The hierarchical entity extractor ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the HierarchicalEntityExtractor object | [
"Gets",
"information",
"about",
"the",
"hierarchical",
"entity",
"model",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L3683-L3690 |
infinispan/infinispan | core/src/main/java/org/infinispan/factories/AbstractComponentRegistry.java | AbstractComponentRegistry.registerComponent | public final void registerComponent(Object component, Class<?> type) {
"""
Registers a component in the registry under the given type, and injects any dependencies needed.
Note: Until 9.4, if a component of this type already existed, it was overwritten.
@param component component to register
@param type ... | java | public final void registerComponent(Object component, Class<?> type) {
registerComponent(component, type.getName(), type.equals(component.getClass()));
} | [
"public",
"final",
"void",
"registerComponent",
"(",
"Object",
"component",
",",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"registerComponent",
"(",
"component",
",",
"type",
".",
"getName",
"(",
")",
",",
"type",
".",
"equals",
"(",
"component",
".",
"g... | Registers a component in the registry under the given type, and injects any dependencies needed.
Note: Until 9.4, if a component of this type already existed, it was overwritten.
@param component component to register
@param type type of component
@throws org.infinispan.commons.CacheConfigurationException If a c... | [
"Registers",
"a",
"component",
"in",
"the",
"registry",
"under",
"the",
"given",
"type",
"and",
"injects",
"any",
"dependencies",
"needed",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/factories/AbstractComponentRegistry.java#L115-L117 |
groovyfx-project/groovyfx | src/main/groovy/groovyx/javafx/beans/FXBindableASTTransformation.java | FXBindableASTTransformation.createGetterMethod | protected void createGetterMethod(ClassNode declaringClass, PropertyNode propertyNode, String getterName,
Statement getterBlock, List<AnnotationNode> annotations) {
"""
Creates a getter method and adds it to the declaring class.
@param declaringClass The class to which the ... | java | protected void createGetterMethod(ClassNode declaringClass, PropertyNode propertyNode, String getterName,
Statement getterBlock, List<AnnotationNode> annotations) {
int mod = propertyNode.getModifiers() | Modifier.FINAL;
MethodNode getter = new MethodNode(getterName... | [
"protected",
"void",
"createGetterMethod",
"(",
"ClassNode",
"declaringClass",
",",
"PropertyNode",
"propertyNode",
",",
"String",
"getterName",
",",
"Statement",
"getterBlock",
",",
"List",
"<",
"AnnotationNode",
">",
"annotations",
")",
"{",
"int",
"mod",
"=",
"... | Creates a getter method and adds it to the declaring class.
@param declaringClass The class to which the method is added
@param propertyNode The property node being accessed by this getter
@param getterName The name of the getter method
@param getterBlock The code body of the method | [
"Creates",
"a",
"getter",
"method",
"and",
"adds",
"it",
"to",
"the",
"declaring",
"class",
"."
] | train | https://github.com/groovyfx-project/groovyfx/blob/7067d76793601ce4de9c642d4c0c0e11db7907cb/src/main/groovy/groovyx/javafx/beans/FXBindableASTTransformation.java#L413-L421 |
JakeWharton/NineOldAndroids | library/src/com/nineoldandroids/animation/PropertyValuesHolder.java | PropertyValuesHolder.ofKeyframe | public static PropertyValuesHolder ofKeyframe(Property property, Keyframe... values) {
"""
Constructs and returns a PropertyValuesHolder object with the specified property and set
of values. These values can be of any type, but the type should be consistent so that
an appropriate {@link android.animation.TypeEva... | java | public static PropertyValuesHolder ofKeyframe(Property property, Keyframe... values) {
KeyframeSet keyframeSet = KeyframeSet.ofKeyframe(values);
if (keyframeSet instanceof IntKeyframeSet) {
return new IntPropertyValuesHolder(property, (IntKeyframeSet) keyframeSet);
} else if (keyfram... | [
"public",
"static",
"PropertyValuesHolder",
"ofKeyframe",
"(",
"Property",
"property",
",",
"Keyframe",
"...",
"values",
")",
"{",
"KeyframeSet",
"keyframeSet",
"=",
"KeyframeSet",
".",
"ofKeyframe",
"(",
"values",
")",
";",
"if",
"(",
"keyframeSet",
"instanceof",... | Constructs and returns a PropertyValuesHolder object with the specified property and set
of values. These values can be of any type, but the type should be consistent so that
an appropriate {@link android.animation.TypeEvaluator} can be found that matches
the common type.
<p>If there is only one value, it is assumed to... | [
"Constructs",
"and",
"returns",
"a",
"PropertyValuesHolder",
"object",
"with",
"the",
"specified",
"property",
"and",
"set",
"of",
"values",
".",
"These",
"values",
"can",
"be",
"of",
"any",
"type",
"but",
"the",
"type",
"should",
"be",
"consistent",
"so",
"... | train | https://github.com/JakeWharton/NineOldAndroids/blob/d582f0ec8e79013e9fa96c07986160b52e662e63/library/src/com/nineoldandroids/animation/PropertyValuesHolder.java#L280-L293 |
uoa-group-applications/morc | src/main/java/nz/ac/auckland/morc/MorcBuilder.java | MorcBuilder.addProcessors | public Builder addProcessors(int index, Processor... processors) {
"""
Add a set of processors to handle an outgoing exchange at a particular offset (n'th message)
@param index The exchange offset that these processors should be applied to
@param processors The processors that will handle populating the e... | java | public Builder addProcessors(int index, Processor... processors) {
while (index >= this.processors.size()) {
this.processors.add(new ArrayList<>());
}
this.processors.get(index).addAll(new ArrayList<>(Arrays.asList(processors)));
return self();
} | [
"public",
"Builder",
"addProcessors",
"(",
"int",
"index",
",",
"Processor",
"...",
"processors",
")",
"{",
"while",
"(",
"index",
">=",
"this",
".",
"processors",
".",
"size",
"(",
")",
")",
"{",
"this",
".",
"processors",
".",
"add",
"(",
"new",
"Arr... | Add a set of processors to handle an outgoing exchange at a particular offset (n'th message)
@param index The exchange offset that these processors should be applied to
@param processors The processors that will handle populating the exchange with an appropriate outgoing value | [
"Add",
"a",
"set",
"of",
"processors",
"to",
"handle",
"an",
"outgoing",
"exchange",
"at",
"a",
"particular",
"offset",
"(",
"n",
"th",
"message",
")"
] | train | https://github.com/uoa-group-applications/morc/blob/3add6308b1fbfc98187364ac73007c83012ea8ba/src/main/java/nz/ac/auckland/morc/MorcBuilder.java#L72-L78 |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/StyleSet.java | StyleSet.setBackgroundColor | public StyleSet setBackgroundColor(IndexedColors backgroundColor, boolean withHeadCell) {
"""
设置单元格背景样式
@param backgroundColor 背景色
@param withHeadCell 是否也定义头部样式
@return this
@since 4.0.0
"""
if (withHeadCell) {
StyleUtil.setColor(this.headCellStyle, backgroundColor, FillPatternType.SOLID_FOREGROUN... | java | public StyleSet setBackgroundColor(IndexedColors backgroundColor, boolean withHeadCell) {
if (withHeadCell) {
StyleUtil.setColor(this.headCellStyle, backgroundColor, FillPatternType.SOLID_FOREGROUND);
}
StyleUtil.setColor(this.cellStyle, backgroundColor, FillPatternType.SOLID_FOREGROUND);
StyleUtil.setC... | [
"public",
"StyleSet",
"setBackgroundColor",
"(",
"IndexedColors",
"backgroundColor",
",",
"boolean",
"withHeadCell",
")",
"{",
"if",
"(",
"withHeadCell",
")",
"{",
"StyleUtil",
".",
"setColor",
"(",
"this",
".",
"headCellStyle",
",",
"backgroundColor",
",",
"FillP... | 设置单元格背景样式
@param backgroundColor 背景色
@param withHeadCell 是否也定义头部样式
@return this
@since 4.0.0 | [
"设置单元格背景样式"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/StyleSet.java#L130-L138 |
foundation-runtime/service-directory | 2.0/sd-core/src/main/java/com/cisco/oss/foundation/directory/Configurations.java | Configurations.getFloat | public static float getFloat(String name, float defaultVal) {
"""
Get the property object as float, or return defaultVal if property is not defined.
@param name
property name.
@param defaultVal
default property value.
@return
property value as float, return defaultVal if property is undefined.
"""
... | java | public static float getFloat(String name, float defaultVal){
if(getConfiguration().containsKey(name)){
return getConfiguration().getFloat(name);
} else {
return defaultVal;
}
} | [
"public",
"static",
"float",
"getFloat",
"(",
"String",
"name",
",",
"float",
"defaultVal",
")",
"{",
"if",
"(",
"getConfiguration",
"(",
")",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"return",
"getConfiguration",
"(",
")",
".",
"getFloat",
"(",
"... | Get the property object as float, or return defaultVal if property is not defined.
@param name
property name.
@param defaultVal
default property value.
@return
property value as float, return defaultVal if property is undefined. | [
"Get",
"the",
"property",
"object",
"as",
"float",
"or",
"return",
"defaultVal",
"if",
"property",
"is",
"not",
"defined",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-core/src/main/java/com/cisco/oss/foundation/directory/Configurations.java#L200-L206 |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/callback/AbstractHBCICallback.java | AbstractHBCICallback.createDefaultLogLine | protected String createDefaultLogLine(String msg, int level, Date date, StackTraceElement trace) {
"""
Erzeugt einen Log-Eintrag. Diese Methode wird von den mitgelieferten
Callback-Klassen für die Erzeugung von Log-Einträgen verwendet. Um
ein eigenes Format für die Log-Eintrage zu definieren, kann diese
Methode... | java | protected String createDefaultLogLine(String msg, int level, Date date, StackTraceElement trace) {
String[] levels = {"NON", "ERR", "WRN", "INF", "DBG", "DB2", "INT"};
StringBuffer ret = new StringBuffer(128);
ret.append("<").append(levels[level]).append("> ");
SimpleDateFormat df = new... | [
"protected",
"String",
"createDefaultLogLine",
"(",
"String",
"msg",
",",
"int",
"level",
",",
"Date",
"date",
",",
"StackTraceElement",
"trace",
")",
"{",
"String",
"[",
"]",
"levels",
"=",
"{",
"\"NON\"",
",",
"\"ERR\"",
",",
"\"WRN\"",
",",
"\"INF\"",
"... | Erzeugt einen Log-Eintrag. Diese Methode wird von den mitgelieferten
Callback-Klassen für die Erzeugung von Log-Einträgen verwendet. Um
ein eigenes Format für die Log-Eintrage zu definieren, kann diese
Methode mit einer eigenen Implementierung überschrieben werden.<br/>
Die Parameter entsprechen denen der
{@link HBCICa... | [
"Erzeugt",
"einen",
"Log",
"-",
"Eintrag",
".",
"Diese",
"Methode",
"wird",
"von",
"den",
"mitgelieferten",
"Callback",
"-",
"Klassen",
"für",
"die",
"Erzeugung",
"von",
"Log",
"-",
"Einträgen",
"verwendet",
".",
"Um",
"ein",
"eigenes",
"Format",
"für",
"die... | train | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/callback/AbstractHBCICallback.java#L37-L72 |
mangstadt/biweekly | src/main/java/biweekly/component/VJournal.java | VJournal.setOrganizer | public Organizer setOrganizer(String email) {
"""
Sets the organizer of the journal entry.
@param email the organizer's email address (e.g. "johndoe@example.com")
or null to remove
@return the property that was created
@see <a href="http://tools.ietf.org/html/rfc5545#page-111">RFC 5545
p.111-2</a>
@see <a hr... | java | public Organizer setOrganizer(String email) {
Organizer prop = (email == null) ? null : new Organizer(null, email);
setOrganizer(prop);
return prop;
} | [
"public",
"Organizer",
"setOrganizer",
"(",
"String",
"email",
")",
"{",
"Organizer",
"prop",
"=",
"(",
"email",
"==",
"null",
")",
"?",
"null",
":",
"new",
"Organizer",
"(",
"null",
",",
"email",
")",
";",
"setOrganizer",
"(",
"prop",
")",
";",
"retur... | Sets the organizer of the journal entry.
@param email the organizer's email address (e.g. "johndoe@example.com")
or null to remove
@return the property that was created
@see <a href="http://tools.ietf.org/html/rfc5545#page-111">RFC 5545
p.111-2</a>
@see <a href="http://tools.ietf.org/html/rfc2445#page-106">RFC 2445
p.1... | [
"Sets",
"the",
"organizer",
"of",
"the",
"journal",
"entry",
"."
] | train | https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/VJournal.java#L429-L433 |
Azure/azure-sdk-for-java | eventgrid/resource-manager/v2018_09_15_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_09_15_preview/implementation/DomainTopicsInner.java | DomainTopicsInner.getAsync | public Observable<DomainTopicInner> getAsync(String resourceGroupName, String domainName, String topicName) {
"""
Get a domain topic.
Get properties of a domain topic.
@param resourceGroupName The name of the resource group within the user's subscription.
@param domainName Name of the domain
@param topicName... | java | public Observable<DomainTopicInner> getAsync(String resourceGroupName, String domainName, String topicName) {
return getWithServiceResponseAsync(resourceGroupName, domainName, topicName).map(new Func1<ServiceResponse<DomainTopicInner>, DomainTopicInner>() {
@Override
public DomainTopicIn... | [
"public",
"Observable",
"<",
"DomainTopicInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"domainName",
",",
"String",
"topicName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"domainName",
",",
"topicNa... | Get a domain topic.
Get properties of a domain topic.
@param resourceGroupName The name of the resource group within the user's subscription.
@param domainName Name of the domain
@param topicName Name of the topic
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the D... | [
"Get",
"a",
"domain",
"topic",
".",
"Get",
"properties",
"of",
"a",
"domain",
"topic",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2018_09_15_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_09_15_preview/implementation/DomainTopicsInner.java#L106-L113 |
shrinkwrap/descriptors | metadata-parser/src/main/java/org/jboss/shrinkwrap/descriptor/metadata/Metadata.java | Metadata.addClassElement | public void addClassElement(final String className, final MetadataElement classElement) {
"""
Adds a new element to the specific element class. If no element class is found, then a new element class. will be
created.
@param className
the class name
@param classElement
the new element to be added.
"""
... | java | public void addClassElement(final String className, final MetadataElement classElement) {
classElement.setType(getNamespaceValue(classElement.getType()));
if (classElement.getMaxOccurs() != null && !classElement.getMaxOccurs().equals("1")) {
classElement.setMaxOccurs("unbounded");
}... | [
"public",
"void",
"addClassElement",
"(",
"final",
"String",
"className",
",",
"final",
"MetadataElement",
"classElement",
")",
"{",
"classElement",
".",
"setType",
"(",
"getNamespaceValue",
"(",
"classElement",
".",
"getType",
"(",
")",
")",
")",
";",
"if",
"... | Adds a new element to the specific element class. If no element class is found, then a new element class. will be
created.
@param className
the class name
@param classElement
the new element to be added. | [
"Adds",
"a",
"new",
"element",
"to",
"the",
"specific",
"element",
"class",
".",
"If",
"no",
"element",
"class",
"is",
"found",
"then",
"a",
"new",
"element",
"class",
".",
"will",
"be",
"created",
"."
] | train | https://github.com/shrinkwrap/descriptors/blob/023ba080e6396b9f4dd8275dc4e5c0ebb6b5e6ba/metadata-parser/src/main/java/org/jboss/shrinkwrap/descriptor/metadata/Metadata.java#L196-L226 |
forge/javaee-descriptors | impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/facesuicomponent20/WebFacesUIComponentDescriptorImpl.java | WebFacesUIComponentDescriptorImpl.addNamespace | public WebFacesUIComponentDescriptor addNamespace(String name, String value) {
"""
Adds a new namespace
@return the current instance of <code>WebFacesUIComponentDescriptor</code>
"""
model.attribute(name, value);
return this;
} | java | public WebFacesUIComponentDescriptor addNamespace(String name, String value)
{
model.attribute(name, value);
return this;
} | [
"public",
"WebFacesUIComponentDescriptor",
"addNamespace",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"model",
".",
"attribute",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Adds a new namespace
@return the current instance of <code>WebFacesUIComponentDescriptor</code> | [
"Adds",
"a",
"new",
"namespace"
] | train | https://github.com/forge/javaee-descriptors/blob/cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed/impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/facesuicomponent20/WebFacesUIComponentDescriptorImpl.java#L84-L88 |
Talend/tesb-rt-se | policies/correlationid-policy/src/main/java/org/talend/esb/policy/correlation/impl/CorrelationIdProtocolHeaderCodec.java | CorrelationIdProtocolHeaderCodec.writeCorrelationId | public static void writeCorrelationId(Message message, String correlationId) {
"""
Write correlation id.
@param message the message
@param correlationId the correlation id
"""
Map<String, List<String>> headers = getOrCreateProtocolHeader(message);
headers.put(CORRELATIONID_HTTP_HEADER_NAME,... | java | public static void writeCorrelationId(Message message, String correlationId) {
Map<String, List<String>> headers = getOrCreateProtocolHeader(message);
headers.put(CORRELATIONID_HTTP_HEADER_NAME, Collections.singletonList(correlationId));
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("HT... | [
"public",
"static",
"void",
"writeCorrelationId",
"(",
"Message",
"message",
",",
"String",
"correlationId",
")",
"{",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"headers",
"=",
"getOrCreateProtocolHeader",
"(",
"message",
")",
";",
"headers",... | Write correlation id.
@param message the message
@param correlationId the correlation id | [
"Write",
"correlation",
"id",
"."
] | train | https://github.com/Talend/tesb-rt-se/blob/0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886/policies/correlationid-policy/src/main/java/org/talend/esb/policy/correlation/impl/CorrelationIdProtocolHeaderCodec.java#L77-L83 |
apache/groovy | src/main/groovy/groovy/lang/GroovyClassLoader.java | GroovyClassLoader.loadClass | public Class loadClass(final String name, boolean lookupScriptFiles, boolean preferClassOverScript)
throws ClassNotFoundException, CompilationFailedException {
"""
loads a class from a file or a parent classloader.
This method does call loadClass(String, boolean, boolean, boolean)
with the last param... | java | public Class loadClass(final String name, boolean lookupScriptFiles, boolean preferClassOverScript)
throws ClassNotFoundException, CompilationFailedException {
return loadClass(name, lookupScriptFiles, preferClassOverScript, false);
} | [
"public",
"Class",
"loadClass",
"(",
"final",
"String",
"name",
",",
"boolean",
"lookupScriptFiles",
",",
"boolean",
"preferClassOverScript",
")",
"throws",
"ClassNotFoundException",
",",
"CompilationFailedException",
"{",
"return",
"loadClass",
"(",
"name",
",",
"loo... | loads a class from a file or a parent classloader.
This method does call loadClass(String, boolean, boolean, boolean)
with the last parameter set to false.
@throws CompilationFailedException if compilation was not successful | [
"loads",
"a",
"class",
"from",
"a",
"file",
"or",
"a",
"parent",
"classloader",
".",
"This",
"method",
"does",
"call",
"loadClass",
"(",
"String",
"boolean",
"boolean",
"boolean",
")",
"with",
"the",
"last",
"parameter",
"set",
"to",
"false",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/GroovyClassLoader.java#L634-L637 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.