repository_name stringlengths 7 58 | func_path_in_repository stringlengths 18 188 | func_name stringlengths 7 127 | whole_func_string stringlengths 77 3.91k | language stringclasses 1
value | func_code_string stringlengths 77 3.91k | func_code_tokens listlengths 20 745 | func_documentation_string stringlengths 61 1.98k | func_documentation_tokens listlengths 1 477 | split_name stringclasses 1
value | func_code_url stringlengths 111 288 |
|---|---|---|---|---|---|---|---|---|---|---|
jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java | CodedConstant.writeToList | public static void writeToList(CodedOutputStream out, int order, FieldType type, List list) throws IOException {
writeToList(out, order, type, list, false);
} | java | public static void writeToList(CodedOutputStream out, int order, FieldType type, List list) throws IOException {
writeToList(out, order, type, list, false);
} | [
"public",
"static",
"void",
"writeToList",
"(",
"CodedOutputStream",
"out",
",",
"int",
"order",
",",
"FieldType",
"type",
",",
"List",
"list",
")",
"throws",
"IOException",
"{",
"writeToList",
"(",
"out",
",",
"order",
",",
"type",
",",
"list",
",",
"fals... | Write to list.
@param out the out
@param order the order
@param type the type
@param list the list
@throws IOException Signals that an I/O exception has occurred. | [
"Write",
"to",
"list",
"."
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L686-L688 |
michael-rapp/AndroidMaterialValidation | library/src/main/java/de/mrapp/android/validation/validators/AbstractValidator.java | AbstractValidator.setIcon | public final void setIcon(@NonNull final Context context, @DrawableRes final int resourceId) {
Condition.INSTANCE.ensureNotNull(context, "The context may not be null");
this.icon = ContextCompat.getDrawable(context, resourceId);
} | java | public final void setIcon(@NonNull final Context context, @DrawableRes final int resourceId) {
Condition.INSTANCE.ensureNotNull(context, "The context may not be null");
this.icon = ContextCompat.getDrawable(context, resourceId);
} | [
"public",
"final",
"void",
"setIcon",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
",",
"@",
"DrawableRes",
"final",
"int",
"resourceId",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"context",
",",
"\"The context may not be null\"",
... | Sets the icon, which should be shown, if the validation fails.
@param context
The context, which should be used to retrieve the icon, as an instance of the class
{@link Context}. The context may not be null
@param resourceId
The resource ID of the drawable resource, which contains the icon, which should be
set, as an {@link Integer} value. The resource ID must correspond to a valid drawable
resource | [
"Sets",
"the",
"icon",
"which",
"should",
"be",
"shown",
"if",
"the",
"validation",
"fails",
"."
] | train | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/library/src/main/java/de/mrapp/android/validation/validators/AbstractValidator.java#L126-L129 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/Table.java | Table.setConfigItem | public void setConfigItem(final String name, final String type, final String value) {
this.builder.setConfigItem(name, type, value);
} | java | public void setConfigItem(final String name, final String type, final String value) {
this.builder.setConfigItem(name, type, value);
} | [
"public",
"void",
"setConfigItem",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"type",
",",
"final",
"String",
"value",
")",
"{",
"this",
".",
"builder",
".",
"setConfigItem",
"(",
"name",
",",
"type",
",",
"value",
")",
";",
"}"
] | Set a config item
@param name the item name
@param type the item type
@param value the item value | [
"Set",
"a",
"config",
"item"
] | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/Table.java#L293-L295 |
fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/assembly/DockerAssemblyManager.java | DockerAssemblyManager.getAssemblyFiles | public AssemblyFiles getAssemblyFiles(String name, BuildImageConfiguration buildConfig, MojoParameters mojoParams, Logger log)
throws InvalidAssemblerConfigurationException, ArchiveCreationException, AssemblyFormattingException, MojoExecutionException {
BuildDirs buildDirs = createBuildDirs(name, mojoParams);
AssemblyConfiguration assemblyConfig = buildConfig.getAssemblyConfiguration();
String assemblyName = assemblyConfig.getName();
DockerAssemblyConfigurationSource source =
new DockerAssemblyConfigurationSource(mojoParams, buildDirs, assemblyConfig);
Assembly assembly = getAssemblyConfig(assemblyConfig, source);
synchronized (trackArchiver) {
MappingTrackArchiver ta = (MappingTrackArchiver) trackArchiver;
ta.init(log, assemblyName);
assembly.setId("tracker");
assemblyArchiver.createArchive(assembly, assemblyName, "track", source, false, null);
return ta.getAssemblyFiles(mojoParams.getSession());
}
} | java | public AssemblyFiles getAssemblyFiles(String name, BuildImageConfiguration buildConfig, MojoParameters mojoParams, Logger log)
throws InvalidAssemblerConfigurationException, ArchiveCreationException, AssemblyFormattingException, MojoExecutionException {
BuildDirs buildDirs = createBuildDirs(name, mojoParams);
AssemblyConfiguration assemblyConfig = buildConfig.getAssemblyConfiguration();
String assemblyName = assemblyConfig.getName();
DockerAssemblyConfigurationSource source =
new DockerAssemblyConfigurationSource(mojoParams, buildDirs, assemblyConfig);
Assembly assembly = getAssemblyConfig(assemblyConfig, source);
synchronized (trackArchiver) {
MappingTrackArchiver ta = (MappingTrackArchiver) trackArchiver;
ta.init(log, assemblyName);
assembly.setId("tracker");
assemblyArchiver.createArchive(assembly, assemblyName, "track", source, false, null);
return ta.getAssemblyFiles(mojoParams.getSession());
}
} | [
"public",
"AssemblyFiles",
"getAssemblyFiles",
"(",
"String",
"name",
",",
"BuildImageConfiguration",
"buildConfig",
",",
"MojoParameters",
"mojoParams",
",",
"Logger",
"log",
")",
"throws",
"InvalidAssemblerConfigurationException",
",",
"ArchiveCreationException",
",",
"As... | Extract all files with a tracking archiver. These can be used to track changes in the filesystem and triggering
a rebuild of the image if needed ('docker:watch') | [
"Extract",
"all",
"files",
"with",
"a",
"tracking",
"archiver",
".",
"These",
"can",
"be",
"used",
"to",
"track",
"changes",
"in",
"the",
"filesystem",
"and",
"triggering",
"a",
"rebuild",
"of",
"the",
"image",
"if",
"needed",
"(",
"docker",
":",
"watch",
... | train | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/assembly/DockerAssemblyManager.java#L240-L259 |
JDBDT/jdbdt | src/main/java/org/jdbdt/JDBDT.java | JDBDT.assertEquals | public static void assertEquals(DataSet expected, DataSet actual) throws DBAssertionError {
DBAssert.dataSetAssertion(CallInfo.create(), expected, actual);
} | java | public static void assertEquals(DataSet expected, DataSet actual) throws DBAssertionError {
DBAssert.dataSetAssertion(CallInfo.create(), expected, actual);
} | [
"public",
"static",
"void",
"assertEquals",
"(",
"DataSet",
"expected",
",",
"DataSet",
"actual",
")",
"throws",
"DBAssertionError",
"{",
"DBAssert",
".",
"dataSetAssertion",
"(",
"CallInfo",
".",
"create",
"(",
")",
",",
"expected",
",",
"actual",
")",
";",
... | Assert that two data sets are equivalent.
<p>
Note that the executed data set comparison is insensitive
to the order of rows in both data sets.
</p>
@param expected Expected data.
@param actual Actual data.
@throws DBAssertionError if the assertion fails.
@see #assertEquals(String,DataSet,DataSet) | [
"Assert",
"that",
"two",
"data",
"sets",
"are",
"equivalent",
"."
] | train | https://github.com/JDBDT/jdbdt/blob/7e32845ad41dfbc5d6fd0fd561e3613697186df4/src/main/java/org/jdbdt/JDBDT.java#L350-L352 |
talsma-ict/umldoclet | src/main/java/nl/talsmasoftware/umldoclet/javadoc/UMLFactory.java | UMLFactory.createType | private Type createType(Namespace containingPackage, TypeElement type) {
requireNonNull(type, "Type element is <null>.");
if (containingPackage == null) containingPackage = packageOf(type);
return new Type(containingPackage, typeClassificationOf(type), TypeNameVisitor.INSTANCE.visit(type.asType()));
} | java | private Type createType(Namespace containingPackage, TypeElement type) {
requireNonNull(type, "Type element is <null>.");
if (containingPackage == null) containingPackage = packageOf(type);
return new Type(containingPackage, typeClassificationOf(type), TypeNameVisitor.INSTANCE.visit(type.asType()));
} | [
"private",
"Type",
"createType",
"(",
"Namespace",
"containingPackage",
",",
"TypeElement",
"type",
")",
"{",
"requireNonNull",
"(",
"type",
",",
"\"Type element is <null>.\"",
")",
";",
"if",
"(",
"containingPackage",
"==",
"null",
")",
"containingPackage",
"=",
... | Creates an 'empty' type (i.e. without any fields, constructors or methods)
@param containingPackage The containing package of the type (optional, will be obtained from typeElement if null).
@param type The type element to create a Type object for.
@return The empty Type object. | [
"Creates",
"an",
"empty",
"type",
"(",
"i",
".",
"e",
".",
"without",
"any",
"fields",
"constructors",
"or",
"methods",
")"
] | train | https://github.com/talsma-ict/umldoclet/blob/373b23f2646603fddca4a495e9eccbb4a4491fdf/src/main/java/nl/talsmasoftware/umldoclet/javadoc/UMLFactory.java#L306-L310 |
gallandarakhneorg/afc | maven/maventools/src/main/java/org/arakhne/maven/AbstractArakhneMojo.java | AbstractArakhneMojo.createArtifact | public final Artifact createArtifact(String groupId, String artifactId, String version) {
return createArtifact(groupId, artifactId, version, "runtime", "jar"); //$NON-NLS-1$ //$NON-NLS-2$
} | java | public final Artifact createArtifact(String groupId, String artifactId, String version) {
return createArtifact(groupId, artifactId, version, "runtime", "jar"); //$NON-NLS-1$ //$NON-NLS-2$
} | [
"public",
"final",
"Artifact",
"createArtifact",
"(",
"String",
"groupId",
",",
"String",
"artifactId",
",",
"String",
"version",
")",
"{",
"return",
"createArtifact",
"(",
"groupId",
",",
"artifactId",
",",
"version",
",",
"\"runtime\"",
",",
"\"jar\"",
")",
... | Create an Jar runtime artifact from the given values.
@param groupId group id.
@param artifactId artifact id.
@param version version number.
@return the artifact | [
"Create",
"an",
"Jar",
"runtime",
"artifact",
"from",
"the",
"given",
"values",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/maven/maventools/src/main/java/org/arakhne/maven/AbstractArakhneMojo.java#L950-L952 |
joniles/mpxj | src/main/java/net/sf/mpxj/ganttproject/GanttProjectReader.java | GanttProjectReader.readTask | private void readTask(ChildTaskContainer mpxjParent, net.sf.mpxj.ganttproject.schema.Task gpTask)
{
Task mpxjTask = mpxjParent.addTask();
mpxjTask.setUniqueID(Integer.valueOf(NumberHelper.getInt(gpTask.getId()) + 1));
mpxjTask.setName(gpTask.getName());
mpxjTask.setPercentageComplete(gpTask.getComplete());
mpxjTask.setPriority(getPriority(gpTask.getPriority()));
mpxjTask.setHyperlink(gpTask.getWebLink());
Duration duration = Duration.getInstance(NumberHelper.getDouble(gpTask.getDuration()), TimeUnit.DAYS);
mpxjTask.setDuration(duration);
if (duration.getDuration() == 0)
{
mpxjTask.setMilestone(true);
}
else
{
mpxjTask.setStart(gpTask.getStart());
mpxjTask.setFinish(m_mpxjCalendar.getDate(gpTask.getStart(), mpxjTask.getDuration(), false));
}
mpxjTask.setConstraintDate(gpTask.getThirdDate());
if (mpxjTask.getConstraintDate() != null)
{
// TODO: you don't appear to be able to change this setting in GanttProject
// task.getThirdDateConstraint()
mpxjTask.setConstraintType(ConstraintType.START_NO_EARLIER_THAN);
}
readTaskCustomFields(gpTask, mpxjTask);
m_eventManager.fireTaskReadEvent(mpxjTask);
// TODO: read custom values
//
// Process child tasks
//
for (net.sf.mpxj.ganttproject.schema.Task childTask : gpTask.getTask())
{
readTask(mpxjTask, childTask);
}
} | java | private void readTask(ChildTaskContainer mpxjParent, net.sf.mpxj.ganttproject.schema.Task gpTask)
{
Task mpxjTask = mpxjParent.addTask();
mpxjTask.setUniqueID(Integer.valueOf(NumberHelper.getInt(gpTask.getId()) + 1));
mpxjTask.setName(gpTask.getName());
mpxjTask.setPercentageComplete(gpTask.getComplete());
mpxjTask.setPriority(getPriority(gpTask.getPriority()));
mpxjTask.setHyperlink(gpTask.getWebLink());
Duration duration = Duration.getInstance(NumberHelper.getDouble(gpTask.getDuration()), TimeUnit.DAYS);
mpxjTask.setDuration(duration);
if (duration.getDuration() == 0)
{
mpxjTask.setMilestone(true);
}
else
{
mpxjTask.setStart(gpTask.getStart());
mpxjTask.setFinish(m_mpxjCalendar.getDate(gpTask.getStart(), mpxjTask.getDuration(), false));
}
mpxjTask.setConstraintDate(gpTask.getThirdDate());
if (mpxjTask.getConstraintDate() != null)
{
// TODO: you don't appear to be able to change this setting in GanttProject
// task.getThirdDateConstraint()
mpxjTask.setConstraintType(ConstraintType.START_NO_EARLIER_THAN);
}
readTaskCustomFields(gpTask, mpxjTask);
m_eventManager.fireTaskReadEvent(mpxjTask);
// TODO: read custom values
//
// Process child tasks
//
for (net.sf.mpxj.ganttproject.schema.Task childTask : gpTask.getTask())
{
readTask(mpxjTask, childTask);
}
} | [
"private",
"void",
"readTask",
"(",
"ChildTaskContainer",
"mpxjParent",
",",
"net",
".",
"sf",
".",
"mpxj",
".",
"ganttproject",
".",
"schema",
".",
"Task",
"gpTask",
")",
"{",
"Task",
"mpxjTask",
"=",
"mpxjParent",
".",
"addTask",
"(",
")",
";",
"mpxjTask... | Recursively read a task, and any sub tasks.
@param mpxjParent Parent for the MPXJ tasks
@param gpTask GanttProject task | [
"Recursively",
"read",
"a",
"task",
"and",
"any",
"sub",
"tasks",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ganttproject/GanttProjectReader.java#L711-L754 |
Scalified/fab | fab/src/main/java/com/scalified/fab/TouchPoint.java | TouchPoint.isInsideCircle | boolean isInsideCircle(float centerPointX, float centerPointY, float radius) {
double xValue = Math.pow((getX() - centerPointX), 2);
double yValue = Math.pow((getY() - centerPointY), 2);
double radiusValue = Math.pow(radius, 2);
boolean touchPointInsideCircle = xValue + yValue <= radiusValue;
LOGGER.trace("Detected touch point {} inside the main circle", touchPointInsideCircle ? "IS" : "IS NOT");
return touchPointInsideCircle;
} | java | boolean isInsideCircle(float centerPointX, float centerPointY, float radius) {
double xValue = Math.pow((getX() - centerPointX), 2);
double yValue = Math.pow((getY() - centerPointY), 2);
double radiusValue = Math.pow(radius, 2);
boolean touchPointInsideCircle = xValue + yValue <= radiusValue;
LOGGER.trace("Detected touch point {} inside the main circle", touchPointInsideCircle ? "IS" : "IS NOT");
return touchPointInsideCircle;
} | [
"boolean",
"isInsideCircle",
"(",
"float",
"centerPointX",
",",
"float",
"centerPointY",
",",
"float",
"radius",
")",
"{",
"double",
"xValue",
"=",
"Math",
".",
"pow",
"(",
"(",
"getX",
"(",
")",
"-",
"centerPointX",
")",
",",
"2",
")",
";",
"double",
... | Checks whether the touch point is inside the circle or not
@param centerPointX circle X-axis center coordinate
@param centerPointY circle Y-axis center coordinate
@param radius circle radius
@return true if touch point is inside the circle, otherwise false | [
"Checks",
"whether",
"the",
"touch",
"point",
"is",
"inside",
"the",
"circle",
"or",
"not"
] | train | https://github.com/Scalified/fab/blob/0fc001e2f21223871d05d28b192a32ea70726884/fab/src/main/java/com/scalified/fab/TouchPoint.java#L170-L177 |
Netflix/zuul | zuul-core/src/main/java/com/netflix/zuul/monitoring/TracerFactory.java | TracerFactory.instance | public static final TracerFactory instance() {
if(INSTANCE == null) throw new IllegalStateException(String.format("%s not initialized", TracerFactory.class.getSimpleName()));
return INSTANCE;
} | java | public static final TracerFactory instance() {
if(INSTANCE == null) throw new IllegalStateException(String.format("%s not initialized", TracerFactory.class.getSimpleName()));
return INSTANCE;
} | [
"public",
"static",
"final",
"TracerFactory",
"instance",
"(",
")",
"{",
"if",
"(",
"INSTANCE",
"==",
"null",
")",
"throw",
"new",
"IllegalStateException",
"(",
"String",
".",
"format",
"(",
"\"%s not initialized\"",
",",
"TracerFactory",
".",
"class",
".",
"g... | Returns the singleton TracerFactory
@return a <code>TracerFactory</code> value | [
"Returns",
"the",
"singleton",
"TracerFactory"
] | train | https://github.com/Netflix/zuul/blob/01bc777cf05e3522d37c9ed902ae13eb38a19692/zuul-core/src/main/java/com/netflix/zuul/monitoring/TracerFactory.java#L43-L46 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/br/br_device_profile.java | br_device_profile.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
br_device_profile_responses result = (br_device_profile_responses) service.get_payload_formatter().string_to_resource(br_device_profile_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcode == SESSION_NOT_EXISTS)
service.clear_session();
throw new nitro_exception(result.message, result.errorcode, (base_response [])result.br_device_profile_response_array);
}
br_device_profile[] result_br_device_profile = new br_device_profile[result.br_device_profile_response_array.length];
for(int i = 0; i < result.br_device_profile_response_array.length; i++)
{
result_br_device_profile[i] = result.br_device_profile_response_array[i].br_device_profile[0];
}
return result_br_device_profile;
} | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
br_device_profile_responses result = (br_device_profile_responses) service.get_payload_formatter().string_to_resource(br_device_profile_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcode == SESSION_NOT_EXISTS)
service.clear_session();
throw new nitro_exception(result.message, result.errorcode, (base_response [])result.br_device_profile_response_array);
}
br_device_profile[] result_br_device_profile = new br_device_profile[result.br_device_profile_response_array.length];
for(int i = 0; i < result.br_device_profile_response_array.length; i++)
{
result_br_device_profile[i] = result.br_device_profile_response_array[i].br_device_profile[0];
}
return result_br_device_profile;
} | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"br_device_profile_responses",
"result",
"=",
"(",
"br_device_profile_responses",
")",
"service",
".",
"get_pa... | <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/br/br_device_profile.java#L237-L254 |
akarnokd/akarnokd-xml | src/main/java/hu/akarnokd/xml/XNSerializables.java | XNSerializables.createUpdate | public static XNElement createUpdate(String function, XNSerializable object) {
XNElement result = new XNElement(function);
object.save(result);
return result;
} | java | public static XNElement createUpdate(String function, XNSerializable object) {
XNElement result = new XNElement(function);
object.save(result);
return result;
} | [
"public",
"static",
"XNElement",
"createUpdate",
"(",
"String",
"function",
",",
"XNSerializable",
"object",
")",
"{",
"XNElement",
"result",
"=",
"new",
"XNElement",
"(",
"function",
")",
";",
"object",
".",
"save",
"(",
"result",
")",
";",
"return",
"resul... | Create an update request and store the contents of the object into it.
@param function the remote function name
@param object the object to store.
@return the request XML | [
"Create",
"an",
"update",
"request",
"and",
"store",
"the",
"contents",
"of",
"the",
"object",
"into",
"it",
"."
] | train | https://github.com/akarnokd/akarnokd-xml/blob/57466a5a9cb455a13d7121557c165287b31ee870/src/main/java/hu/akarnokd/xml/XNSerializables.java#L48-L52 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/service/tsdb/AnnotationQuery.java | AnnotationQuery.toTagParameterArray | protected String toTagParameterArray(Map<String, String> tags) throws UnsupportedEncodingException {
if(tags == null || tags.isEmpty()) {
return "";
}
StringBuilder sb = new StringBuilder(encode("{", "UTF-8"));
for (Map.Entry<String, String> tagEntry : tags.entrySet()) {
sb.append(tagEntry.getKey()).append("=");
String tagV = tagEntry.getValue().replaceAll("\\|", encode("|", "UTF-8"));
sb.append(tagV).append(",");
}
sb.replace(sb.length() - 1, sb.length(), encode("}", "UTF-8"));
return sb.toString();
} | java | protected String toTagParameterArray(Map<String, String> tags) throws UnsupportedEncodingException {
if(tags == null || tags.isEmpty()) {
return "";
}
StringBuilder sb = new StringBuilder(encode("{", "UTF-8"));
for (Map.Entry<String, String> tagEntry : tags.entrySet()) {
sb.append(tagEntry.getKey()).append("=");
String tagV = tagEntry.getValue().replaceAll("\\|", encode("|", "UTF-8"));
sb.append(tagV).append(",");
}
sb.replace(sb.length() - 1, sb.length(), encode("}", "UTF-8"));
return sb.toString();
} | [
"protected",
"String",
"toTagParameterArray",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"throws",
"UnsupportedEncodingException",
"{",
"if",
"(",
"tags",
"==",
"null",
"||",
"tags",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"\"\"",
";... | Returns the tags in TSDB query string format.
@param tags The tags to convert. Can be null.
@return The formatted tags.
@throws UnsupportedEncodingException If UTF-8 is not supported. | [
"Returns",
"the",
"tags",
"in",
"TSDB",
"query",
"string",
"format",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/tsdb/AnnotationQuery.java#L266-L282 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java | MDAG.getAllStrings | public HashSet<String> getAllStrings()
{
HashSet<String> strHashSet = new LinkedHashSet<String>();
if (sourceNode != null)
getStrings(strHashSet, SearchCondition.NO_SEARCH_CONDITION, null, "", sourceNode.getOutgoingTransitions());
else
getStrings(strHashSet, SearchCondition.NO_SEARCH_CONDITION, null, "", simplifiedSourceNode);
return strHashSet;
} | java | public HashSet<String> getAllStrings()
{
HashSet<String> strHashSet = new LinkedHashSet<String>();
if (sourceNode != null)
getStrings(strHashSet, SearchCondition.NO_SEARCH_CONDITION, null, "", sourceNode.getOutgoingTransitions());
else
getStrings(strHashSet, SearchCondition.NO_SEARCH_CONDITION, null, "", simplifiedSourceNode);
return strHashSet;
} | [
"public",
"HashSet",
"<",
"String",
">",
"getAllStrings",
"(",
")",
"{",
"HashSet",
"<",
"String",
">",
"strHashSet",
"=",
"new",
"LinkedHashSet",
"<",
"String",
">",
"(",
")",
";",
"if",
"(",
"sourceNode",
"!=",
"null",
")",
"getStrings",
"(",
"strHashS... | 取出所有key<br>
Retrieves all the valid Strings that have been inserted in to the MDAG.
@return a HashSet containing all the Strings that have been inserted into the MDAG | [
"取出所有key<br",
">",
"Retrieves",
"all",
"the",
"valid",
"Strings",
"that",
"have",
"been",
"inserted",
"in",
"to",
"the",
"MDAG",
"."
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java#L920-L930 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/map/geotools/FeaturesParser.java | FeaturesParser.treatStringAsURL | public final SimpleFeatureCollection treatStringAsURL(final Template template, final String geoJsonUrl)
throws IOException {
URL url;
try {
url = FileUtils.testForLegalFileUrl(template.getConfiguration(), new URL(geoJsonUrl));
} catch (MalformedURLException e) {
return null;
}
final String geojsonString;
if (url.getProtocol().equalsIgnoreCase("file")) {
geojsonString = IOUtils.toString(url, Constants.DEFAULT_CHARSET.name());
} else {
geojsonString = URIUtils.toString(this.httpRequestFactory, url);
}
return treatStringAsGeoJson(geojsonString);
} | java | public final SimpleFeatureCollection treatStringAsURL(final Template template, final String geoJsonUrl)
throws IOException {
URL url;
try {
url = FileUtils.testForLegalFileUrl(template.getConfiguration(), new URL(geoJsonUrl));
} catch (MalformedURLException e) {
return null;
}
final String geojsonString;
if (url.getProtocol().equalsIgnoreCase("file")) {
geojsonString = IOUtils.toString(url, Constants.DEFAULT_CHARSET.name());
} else {
geojsonString = URIUtils.toString(this.httpRequestFactory, url);
}
return treatStringAsGeoJson(geojsonString);
} | [
"public",
"final",
"SimpleFeatureCollection",
"treatStringAsURL",
"(",
"final",
"Template",
"template",
",",
"final",
"String",
"geoJsonUrl",
")",
"throws",
"IOException",
"{",
"URL",
"url",
";",
"try",
"{",
"url",
"=",
"FileUtils",
".",
"testForLegalFileUrl",
"("... | Get the features collection from a GeoJson URL.
@param template the template
@param geoJsonUrl what to parse
@return the feature collection | [
"Get",
"the",
"features",
"collection",
"from",
"a",
"GeoJson",
"URL",
"."
] | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/map/geotools/FeaturesParser.java#L167-L184 |
EMCECS/nfs-client-java | src/main/java/com/emc/ecs/nfsclient/nfs/nfs3/Nfs3.java | Nfs3.handleRpcException | private boolean handleRpcException(RpcException e, int attemptNumber)
throws IOException {
boolean tryPrivilegedPort = e.getStatus().equals(RejectStatus.AUTH_ERROR);
boolean networkError = e.getStatus().equals(RpcStatus.NETWORK_ERROR);
boolean retry = (tryPrivilegedPort || networkError) &&
((attemptNumber + 1) < MOUNT_MAX_RETRIES);
if (!retry) {
String messageStart = networkError ? "network" : "rpc";
String msg = String.format("%s error, server: %s, export: %s, RPC error: %s", messageStart, _server, _exportedPath,
e.getMessage());
throw new MountException(MountStatus.MNT3ERR_IO, msg, e);
}
System.out.println("retry " + (attemptNumber + 1));
if (tryPrivilegedPort) {
LOG.info("Next try will be with a privileged port.");
}
return tryPrivilegedPort;
} | java | private boolean handleRpcException(RpcException e, int attemptNumber)
throws IOException {
boolean tryPrivilegedPort = e.getStatus().equals(RejectStatus.AUTH_ERROR);
boolean networkError = e.getStatus().equals(RpcStatus.NETWORK_ERROR);
boolean retry = (tryPrivilegedPort || networkError) &&
((attemptNumber + 1) < MOUNT_MAX_RETRIES);
if (!retry) {
String messageStart = networkError ? "network" : "rpc";
String msg = String.format("%s error, server: %s, export: %s, RPC error: %s", messageStart, _server, _exportedPath,
e.getMessage());
throw new MountException(MountStatus.MNT3ERR_IO, msg, e);
}
System.out.println("retry " + (attemptNumber + 1));
if (tryPrivilegedPort) {
LOG.info("Next try will be with a privileged port.");
}
return tryPrivilegedPort;
} | [
"private",
"boolean",
"handleRpcException",
"(",
"RpcException",
"e",
",",
"int",
"attemptNumber",
")",
"throws",
"IOException",
"{",
"boolean",
"tryPrivilegedPort",
"=",
"e",
".",
"getStatus",
"(",
")",
".",
"equals",
"(",
"RejectStatus",
".",
"AUTH_ERROR",
")"... | Decide whether to retry or throw an exception
@param e
The exception.
@param attemptNumber
The number of attempts so far.
@return <ul><li><code>true</code> if there was an authentication failure and privileged ports should be tried,</li>
<li><code>false</code> otherwise.</li></ul>
@throws IOException | [
"Decide",
"whether",
"to",
"retry",
"or",
"throw",
"an",
"exception"
] | train | https://github.com/EMCECS/nfs-client-java/blob/7ba25bad5052b95cd286052745327729288b2843/src/main/java/com/emc/ecs/nfsclient/nfs/nfs3/Nfs3.java#L390-L407 |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4DatabaseMetaData.java | JDBC4DatabaseMetaData.getBestRowIdentifier | @Override
public ResultSet getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable) throws SQLException
{
checkClosed();
throw SQLError.noSupport();
} | java | @Override
public ResultSet getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable) throws SQLException
{
checkClosed();
throw SQLError.noSupport();
} | [
"@",
"Override",
"public",
"ResultSet",
"getBestRowIdentifier",
"(",
"String",
"catalog",
",",
"String",
"schema",
",",
"String",
"table",
",",
"int",
"scope",
",",
"boolean",
"nullable",
")",
"throws",
"SQLException",
"{",
"checkClosed",
"(",
")",
";",
"throw... | Retrieves a description of a table's optimal set of columns that uniquely identifies a row. | [
"Retrieves",
"a",
"description",
"of",
"a",
"table",
"s",
"optimal",
"set",
"of",
"columns",
"that",
"uniquely",
"identifies",
"a",
"row",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4DatabaseMetaData.java#L147-L152 |
jcustenborder/connect-utils | connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/ConfigUtils.java | ConfigUtils.passwordBytes | public static byte[] passwordBytes(AbstractConfig config, String key, String charset) {
return passwordBytes(config, key, Charset.forName(charset));
} | java | public static byte[] passwordBytes(AbstractConfig config, String key, String charset) {
return passwordBytes(config, key, Charset.forName(charset));
} | [
"public",
"static",
"byte",
"[",
"]",
"passwordBytes",
"(",
"AbstractConfig",
"config",
",",
"String",
"key",
",",
"String",
"charset",
")",
"{",
"return",
"passwordBytes",
"(",
"config",
",",
"key",
",",
"Charset",
".",
"forName",
"(",
"charset",
")",
")"... | Method is used to return an array of bytes representing the password stored in the config.
@param config Config to read from
@param key Key to read from
@param charset Charset to use
@return byte array containing the password | [
"Method",
"is",
"used",
"to",
"return",
"an",
"array",
"of",
"bytes",
"representing",
"the",
"password",
"stored",
"in",
"the",
"config",
"."
] | train | https://github.com/jcustenborder/connect-utils/blob/19add138921f59ffcc85282d7aad551eeb582370/connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/ConfigUtils.java#L341-L343 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Request.java | Request.newUploadPhotoRequest | public static Request newUploadPhotoRequest(Session session, Bitmap image, Callback callback) {
Bundle parameters = new Bundle(1);
parameters.putParcelable(PICTURE_PARAM, image);
return new Request(session, MY_PHOTOS, parameters, HttpMethod.POST, callback);
} | java | public static Request newUploadPhotoRequest(Session session, Bitmap image, Callback callback) {
Bundle parameters = new Bundle(1);
parameters.putParcelable(PICTURE_PARAM, image);
return new Request(session, MY_PHOTOS, parameters, HttpMethod.POST, callback);
} | [
"public",
"static",
"Request",
"newUploadPhotoRequest",
"(",
"Session",
"session",
",",
"Bitmap",
"image",
",",
"Callback",
"callback",
")",
"{",
"Bundle",
"parameters",
"=",
"new",
"Bundle",
"(",
"1",
")",
";",
"parameters",
".",
"putParcelable",
"(",
"PICTUR... | Creates a new Request configured to upload a photo to the user's default photo album.
@param session
the Session to use, or null; if non-null, the session must be in an opened state
@param image
the image to upload
@param callback
a callback that will be called when the request is completed to handle success or error conditions
@return a Request that is ready to execute | [
"Creates",
"a",
"new",
"Request",
"configured",
"to",
"upload",
"a",
"photo",
"to",
"the",
"user",
"s",
"default",
"photo",
"album",
"."
] | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Request.java#L319-L324 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java | FieldUtils.readDeclaredStaticField | public static Object readDeclaredStaticField(final Class<?> cls, final String fieldName) throws IllegalAccessException {
return readDeclaredStaticField(cls, fieldName, false);
} | java | public static Object readDeclaredStaticField(final Class<?> cls, final String fieldName) throws IllegalAccessException {
return readDeclaredStaticField(cls, fieldName, false);
} | [
"public",
"static",
"Object",
"readDeclaredStaticField",
"(",
"final",
"Class",
"<",
"?",
">",
"cls",
",",
"final",
"String",
"fieldName",
")",
"throws",
"IllegalAccessException",
"{",
"return",
"readDeclaredStaticField",
"(",
"cls",
",",
"fieldName",
",",
"false"... | Gets the value of a {@code static} {@link Field} by name. The field must be {@code public}. Only the specified
class will be considered.
@param cls
the {@link Class} to reflect, must not be {@code null}
@param fieldName
the field name to obtain
@return the value of the field
@throws IllegalArgumentException
if the class is {@code null}, or the field name is blank or empty, is not {@code static}, or could
not be found
@throws IllegalAccessException
if the field is not accessible | [
"Gets",
"the",
"value",
"of",
"a",
"{",
"@code",
"static",
"}",
"{",
"@link",
"Field",
"}",
"by",
"name",
".",
"The",
"field",
"must",
"be",
"{",
"@code",
"public",
"}",
".",
"Only",
"the",
"specified",
"class",
"will",
"be",
"considered",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java#L360-L362 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/content/IntentUtils.java | IntentUtils.buildAction | public static String buildAction(Class<?> clazz, String action) {
return new StringBuilder().append(clazz.getCanonicalName()).append(".").append(action).toString();
} | java | public static String buildAction(Class<?> clazz, String action) {
return new StringBuilder().append(clazz.getCanonicalName()).append(".").append(action).toString();
} | [
"public",
"static",
"String",
"buildAction",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"action",
")",
"{",
"return",
"new",
"StringBuilder",
"(",
")",
".",
"append",
"(",
"clazz",
".",
"getCanonicalName",
"(",
")",
")",
".",
"append",
"(",
"... | Build a custom intent action name, like "jp.co.nohana.amalgam.Sample.ACTION_SAMPLE".
@param clazz the class name.
@param action the action name.
@return the custom action name. | [
"Build",
"a",
"custom",
"intent",
"action",
"name",
"like",
"jp",
".",
"co",
".",
"nohana",
".",
"amalgam",
".",
"Sample",
".",
"ACTION_SAMPLE",
"."
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/content/IntentUtils.java#L33-L35 |
larsga/Duke | duke-core/src/main/java/no/priv/garshol/duke/ConfigurationImpl.java | ConfigurationImpl.addDataSource | public void addDataSource(int groupno, DataSource datasource) {
// the loader takes care of validation
if (groupno == 0)
datasources.add(datasource);
else if (groupno == 1)
group1.add(datasource);
else if (groupno == 2)
group2.add(datasource);
} | java | public void addDataSource(int groupno, DataSource datasource) {
// the loader takes care of validation
if (groupno == 0)
datasources.add(datasource);
else if (groupno == 1)
group1.add(datasource);
else if (groupno == 2)
group2.add(datasource);
} | [
"public",
"void",
"addDataSource",
"(",
"int",
"groupno",
",",
"DataSource",
"datasource",
")",
"{",
"// the loader takes care of validation",
"if",
"(",
"groupno",
"==",
"0",
")",
"datasources",
".",
"add",
"(",
"datasource",
")",
";",
"else",
"if",
"(",
"gro... | Adds a data source to the configuration. If in deduplication mode
groupno == 0, otherwise it gives the number of the group to which
the data source belongs. | [
"Adds",
"a",
"data",
"source",
"to",
"the",
"configuration",
".",
"If",
"in",
"deduplication",
"mode",
"groupno",
"==",
"0",
"otherwise",
"it",
"gives",
"the",
"number",
"of",
"the",
"group",
"to",
"which",
"the",
"data",
"source",
"belongs",
"."
] | train | https://github.com/larsga/Duke/blob/6263f9c6e984c26362a76241c7c7ea3bb4469bac/duke-core/src/main/java/no/priv/garshol/duke/ConfigurationImpl.java#L73-L81 |
fommil/matrix-toolkits-java | src/main/java/no/uib/cipr/matrix/sparse/AbstractIterativeSolver.java | AbstractIterativeSolver.checkSizes | protected void checkSizes(Matrix A, Vector b, Vector x) {
if (!A.isSquare())
throw new IllegalArgumentException("!A.isSquare()");
if (b.size() != A.numRows())
throw new IllegalArgumentException("b.size() != A.numRows()");
if (b.size() != x.size())
throw new IllegalArgumentException("b.size() != x.size()");
} | java | protected void checkSizes(Matrix A, Vector b, Vector x) {
if (!A.isSquare())
throw new IllegalArgumentException("!A.isSquare()");
if (b.size() != A.numRows())
throw new IllegalArgumentException("b.size() != A.numRows()");
if (b.size() != x.size())
throw new IllegalArgumentException("b.size() != x.size()");
} | [
"protected",
"void",
"checkSizes",
"(",
"Matrix",
"A",
",",
"Vector",
"b",
",",
"Vector",
"x",
")",
"{",
"if",
"(",
"!",
"A",
".",
"isSquare",
"(",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"!A.isSquare()\"",
")",
";",
"if",
"(",
"b"... | Checks sizes of input data for {@link #solve(Matrix, Vector, Vector)}.
Throws an exception if the sizes does not match. | [
"Checks",
"sizes",
"of",
"input",
"data",
"for",
"{"
] | train | https://github.com/fommil/matrix-toolkits-java/blob/6157618bc86bcda3749af2a60bf869d8f3292960/src/main/java/no/uib/cipr/matrix/sparse/AbstractIterativeSolver.java#L70-L77 |
jbundle/jbundle | thin/base/screen/grid/src/main/java/org/jbundle/thin/base/screen/grid/ThinTableModel.java | ThinTableModel.getValueAt | public Object getValueAt(int iRowIndex, int iColumnIndex)
{
int iEditMode = Constants.EDIT_NONE;
try {
if (iRowIndex >= 0)
{
FieldList fieldList = this.makeRowCurrent(iRowIndex, false);
if (fieldList != null)
iEditMode = fieldList.getEditMode();
}
} catch (Exception ex) {
ex.printStackTrace();
}
return this.getColumnValue(iColumnIndex, iEditMode);
} | java | public Object getValueAt(int iRowIndex, int iColumnIndex)
{
int iEditMode = Constants.EDIT_NONE;
try {
if (iRowIndex >= 0)
{
FieldList fieldList = this.makeRowCurrent(iRowIndex, false);
if (fieldList != null)
iEditMode = fieldList.getEditMode();
}
} catch (Exception ex) {
ex.printStackTrace();
}
return this.getColumnValue(iColumnIndex, iEditMode);
} | [
"public",
"Object",
"getValueAt",
"(",
"int",
"iRowIndex",
",",
"int",
"iColumnIndex",
")",
"{",
"int",
"iEditMode",
"=",
"Constants",
".",
"EDIT_NONE",
";",
"try",
"{",
"if",
"(",
"iRowIndex",
">=",
"0",
")",
"{",
"FieldList",
"fieldList",
"=",
"this",
... | Get the value at this location.
@param iRowIndex The row.
@param iColumnIndex The column.
@return The raw data at this location. | [
"Get",
"the",
"value",
"at",
"this",
"location",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/grid/src/main/java/org/jbundle/thin/base/screen/grid/ThinTableModel.java#L315-L329 |
mcxiaoke/Android-Next | recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java | HeaderFooterRecyclerAdapter.notifyHeaderItemMoved | public void notifyHeaderItemMoved(int fromPosition, int toPosition) {
if (fromPosition < 0 || toPosition < 0 || fromPosition >= headerItemCount || toPosition >= headerItemCount) {
throw new IndexOutOfBoundsException("The given fromPosition " + fromPosition + " or toPosition " + toPosition + " is not within the position bounds for header items [0 - " + (headerItemCount - 1) + "].");
}
notifyItemMoved(fromPosition, toPosition);
} | java | public void notifyHeaderItemMoved(int fromPosition, int toPosition) {
if (fromPosition < 0 || toPosition < 0 || fromPosition >= headerItemCount || toPosition >= headerItemCount) {
throw new IndexOutOfBoundsException("The given fromPosition " + fromPosition + " or toPosition " + toPosition + " is not within the position bounds for header items [0 - " + (headerItemCount - 1) + "].");
}
notifyItemMoved(fromPosition, toPosition);
} | [
"public",
"void",
"notifyHeaderItemMoved",
"(",
"int",
"fromPosition",
",",
"int",
"toPosition",
")",
"{",
"if",
"(",
"fromPosition",
"<",
"0",
"||",
"toPosition",
"<",
"0",
"||",
"fromPosition",
">=",
"headerItemCount",
"||",
"toPosition",
">=",
"headerItemCoun... | Notifies that an existing header item is moved to another position.
@param fromPosition the original position.
@param toPosition the new position. | [
"Notifies",
"that",
"an",
"existing",
"header",
"item",
"is",
"moved",
"to",
"another",
"position",
"."
] | train | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java#L172-L177 |
pwall567/jsonutil | src/main/java/net/pwall/json/JSONObject.java | JSONObject.putValue | public JSONObject putValue(String key, long value) {
put(key, JSONLong.valueOf(value));
return this;
} | java | public JSONObject putValue(String key, long value) {
put(key, JSONLong.valueOf(value));
return this;
} | [
"public",
"JSONObject",
"putValue",
"(",
"String",
"key",
",",
"long",
"value",
")",
"{",
"put",
"(",
"key",
",",
"JSONLong",
".",
"valueOf",
"(",
"value",
")",
")",
";",
"return",
"this",
";",
"}"
] | Add a {@link JSONLong} representing the supplied {@code long} to the {@code JSONObject}.
@param key the key to use when storing the value
@param value the value
@return {@code this} (for chaining)
@throws NullPointerException if key is {@code null} | [
"Add",
"a",
"{",
"@link",
"JSONLong",
"}",
"representing",
"the",
"supplied",
"{",
"@code",
"long",
"}",
"to",
"the",
"{",
"@code",
"JSONObject",
"}",
"."
] | train | https://github.com/pwall567/jsonutil/blob/dd5960b9b0bcc9acfe6c52b884fffd9ee5f422fe/src/main/java/net/pwall/json/JSONObject.java#L130-L133 |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/ChangeObjects.java | ChangeObjects.produceMonomerNotationUnitWithOtherID | public final static MonomerNotationUnit produceMonomerNotationUnitWithOtherID(MonomerNotation monomerNotation,
String newID) throws NotationException {
MonomerNotationUnit result = new MonomerNotationUnit(newID, monomerNotation.getType());
if (monomerNotation.isAnnotationTrue()) {
result.setAnnotation(monomerNotation.getAnnotation());
}
result.setCount(monomerNotation.getCount());
return result;
} | java | public final static MonomerNotationUnit produceMonomerNotationUnitWithOtherID(MonomerNotation monomerNotation,
String newID) throws NotationException {
MonomerNotationUnit result = new MonomerNotationUnit(newID, monomerNotation.getType());
if (monomerNotation.isAnnotationTrue()) {
result.setAnnotation(monomerNotation.getAnnotation());
}
result.setCount(monomerNotation.getCount());
return result;
} | [
"public",
"final",
"static",
"MonomerNotationUnit",
"produceMonomerNotationUnitWithOtherID",
"(",
"MonomerNotation",
"monomerNotation",
",",
"String",
"newID",
")",
"throws",
"NotationException",
"{",
"MonomerNotationUnit",
"result",
"=",
"new",
"MonomerNotationUnit",
"(",
... | method to replace the MonomerNotationUnit having the MonomerID with the
new MonomerID
@param monomerNotation
given monomer notation
@param newID
new monomer id
@return MonomerNotationUnit
@throws NotationException
if new id is not valid | [
"method",
"to",
"replace",
"the",
"MonomerNotationUnit",
"having",
"the",
"MonomerID",
"with",
"the",
"new",
"MonomerID"
] | train | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/ChangeObjects.java#L582-L590 |
BlueBrain/bluima | modules/bluima_pdf/src/main/java/edu/psu/seersuite/extractors/tableextractor/Debug.java | Debug.printMiddleResults | public static void printMiddleResults(ArrayList<ArrayList<TextPiece>> wordsByPage,
ArrayList<ArrayList<TextPiece>> linesByPage, String outputDirPath, File pdfFile) {
try {
/**
* Creates the middle-result directory if it does not exist
*/
File middleDir = new File(outputDirPath, "middleResults-Seersuite"); //"middleResults-Seersuite"
if (!middleDir.exists()) {
middleDir.mkdirs();
}
/**
* Generates the names with the directory path of files to store the middle-stage results
*/
File pieceResultFile = new File(middleDir, pdfFile.getName() + ".piece");
File lineResultFile = new File(middleDir, pdfFile.getName() + ".line");
BufferedWriter bw0 = new BufferedWriter(new FileWriter(pieceResultFile));
BufferedWriter bw = new BufferedWriter(new FileWriter(lineResultFile));
/**
* Loops over PDF document pages.
*/
for (int i = 0; i < linesByPage.size(); i++) {
bw0.write("************ PAGE " + i + "***************\n");
bw.write("************ PAGE " + i + "***************\n");
ArrayList<TextPiece> wordsOfAPage = wordsByPage.get(i);
ArrayList<TextPiece> linesOfAPage = linesByPage.get(i);
/**
* Loops over text pieces within a page
*/
for (int j = 0; j < wordsOfAPage.size(); j++) {
TextPiece word = wordsOfAPage.get(j);
String wordStr = String.format("WORD %d %s\n", j, word.toString());
bw0.write(wordStr);
}
/**
* Loops over lines within a page
*/
for (int j = 0; j < linesOfAPage.size(); j++) {
TextPiece line = linesOfAPage.get(j);
String lineStr = String.format(
"LINE %d %s\n",
j,
line.toString());
bw.write(lineStr);
}
bw0.write("\n");
bw.write("\n");
}
bw0.close();
bw.close();
}
catch (IOException e){
System.out.printf("[Debug Error] IOException\n");
}
} | java | public static void printMiddleResults(ArrayList<ArrayList<TextPiece>> wordsByPage,
ArrayList<ArrayList<TextPiece>> linesByPage, String outputDirPath, File pdfFile) {
try {
/**
* Creates the middle-result directory if it does not exist
*/
File middleDir = new File(outputDirPath, "middleResults-Seersuite"); //"middleResults-Seersuite"
if (!middleDir.exists()) {
middleDir.mkdirs();
}
/**
* Generates the names with the directory path of files to store the middle-stage results
*/
File pieceResultFile = new File(middleDir, pdfFile.getName() + ".piece");
File lineResultFile = new File(middleDir, pdfFile.getName() + ".line");
BufferedWriter bw0 = new BufferedWriter(new FileWriter(pieceResultFile));
BufferedWriter bw = new BufferedWriter(new FileWriter(lineResultFile));
/**
* Loops over PDF document pages.
*/
for (int i = 0; i < linesByPage.size(); i++) {
bw0.write("************ PAGE " + i + "***************\n");
bw.write("************ PAGE " + i + "***************\n");
ArrayList<TextPiece> wordsOfAPage = wordsByPage.get(i);
ArrayList<TextPiece> linesOfAPage = linesByPage.get(i);
/**
* Loops over text pieces within a page
*/
for (int j = 0; j < wordsOfAPage.size(); j++) {
TextPiece word = wordsOfAPage.get(j);
String wordStr = String.format("WORD %d %s\n", j, word.toString());
bw0.write(wordStr);
}
/**
* Loops over lines within a page
*/
for (int j = 0; j < linesOfAPage.size(); j++) {
TextPiece line = linesOfAPage.get(j);
String lineStr = String.format(
"LINE %d %s\n",
j,
line.toString());
bw.write(lineStr);
}
bw0.write("\n");
bw.write("\n");
}
bw0.close();
bw.close();
}
catch (IOException e){
System.out.printf("[Debug Error] IOException\n");
}
} | [
"public",
"static",
"void",
"printMiddleResults",
"(",
"ArrayList",
"<",
"ArrayList",
"<",
"TextPiece",
">",
">",
"wordsByPage",
",",
"ArrayList",
"<",
"ArrayList",
"<",
"TextPiece",
">",
">",
"linesByPage",
",",
"String",
"outputDirPath",
",",
"File",
"pdfFile"... | For testing purpose. The function of this method is to display the middle-stage text combination results.
E.g., combined texts in the Word or Line level. The results will be printed into files "pdfFile"
in path "outputDirPath" in the directory of the PDF documents
@param wordsByPage
the word list of a PDF document page
@param linesByPage
the line list of a PDF document page
@param outputDirPath
the directory path where the middle-stage results will go to
@param pdfFile
the PDF file being processed
@throws IOException | [
"For",
"testing",
"purpose",
".",
"The",
"function",
"of",
"this",
"method",
"is",
"to",
"display",
"the",
"middle",
"-",
"stage",
"text",
"combination",
"results",
".",
"E",
".",
"g",
".",
"combined",
"texts",
"in",
"the",
"Word",
"or",
"Line",
"level",... | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_pdf/src/main/java/edu/psu/seersuite/extractors/tableextractor/Debug.java#L42-L101 |
igniterealtime/Smack | smack-core/src/main/java/org/jivesoftware/smack/util/PacketParserUtils.java | PacketParserUtils.parseContentDepth | public static CharSequence parseContentDepth(XmlPullParser parser, int depth, boolean fullNamespaces) throws XmlPullParserException, IOException {
if (parser.getFeature(FEATURE_XML_ROUNDTRIP)) {
return parseContentDepthWithRoundtrip(parser, depth, fullNamespaces);
} else {
return parseContentDepthWithoutRoundtrip(parser, depth, fullNamespaces);
}
} | java | public static CharSequence parseContentDepth(XmlPullParser parser, int depth, boolean fullNamespaces) throws XmlPullParserException, IOException {
if (parser.getFeature(FEATURE_XML_ROUNDTRIP)) {
return parseContentDepthWithRoundtrip(parser, depth, fullNamespaces);
} else {
return parseContentDepthWithoutRoundtrip(parser, depth, fullNamespaces);
}
} | [
"public",
"static",
"CharSequence",
"parseContentDepth",
"(",
"XmlPullParser",
"parser",
",",
"int",
"depth",
",",
"boolean",
"fullNamespaces",
")",
"throws",
"XmlPullParserException",
",",
"IOException",
"{",
"if",
"(",
"parser",
".",
"getFeature",
"(",
"FEATURE_XM... | Returns the content from the current position of the parser up to the closing tag of the
given depth. Note that only the outermost namespace attributes ("xmlns") will be returned,
not nested ones, if <code>fullNamespaces</code> is false. If it is true, then namespaces of
parent elements will be added to child elements that don't define a different namespace.
<p>
This method is able to parse the content with MX- and KXmlParser. KXmlParser does not support
xml-roundtrip. i.e. return a String on getText() on START_TAG and END_TAG. We check for the
XML_ROUNDTRIP feature. If it's not found we are required to work around this limitation, which
results in only partial support for XML namespaces ("xmlns"): Only the outermost namespace of
elements will be included in the resulting String, if <code>fullNamespaces</code> is set to false.
</p>
<p>
In particular Android's XmlPullParser does not support XML_ROUNDTRIP.
</p>
@param parser
@param depth
@param fullNamespaces
@return the content of the current depth
@throws XmlPullParserException
@throws IOException | [
"Returns",
"the",
"content",
"from",
"the",
"current",
"position",
"of",
"the",
"parser",
"up",
"to",
"the",
"closing",
"tag",
"of",
"the",
"given",
"depth",
".",
"Note",
"that",
"only",
"the",
"outermost",
"namespace",
"attributes",
"(",
"xmlns",
")",
"wi... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-core/src/main/java/org/jivesoftware/smack/util/PacketParserUtils.java#L421-L427 |
joniles/mpxj | src/main/java/net/sf/mpxj/synchro/SynchroData.java | SynchroData.readTableHeader | private SynchroTable readTableHeader(byte[] header)
{
SynchroTable result = null;
String tableName = DatatypeConverter.getSimpleString(header, 0);
if (!tableName.isEmpty())
{
int offset = DatatypeConverter.getInt(header, 40);
result = new SynchroTable(tableName, offset);
}
return result;
} | java | private SynchroTable readTableHeader(byte[] header)
{
SynchroTable result = null;
String tableName = DatatypeConverter.getSimpleString(header, 0);
if (!tableName.isEmpty())
{
int offset = DatatypeConverter.getInt(header, 40);
result = new SynchroTable(tableName, offset);
}
return result;
} | [
"private",
"SynchroTable",
"readTableHeader",
"(",
"byte",
"[",
"]",
"header",
")",
"{",
"SynchroTable",
"result",
"=",
"null",
";",
"String",
"tableName",
"=",
"DatatypeConverter",
".",
"getSimpleString",
"(",
"header",
",",
"0",
")",
";",
"if",
"(",
"!",
... | Read the header data for a single file.
@param header header data
@return SynchroTable instance | [
"Read",
"the",
"header",
"data",
"for",
"a",
"single",
"file",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/SynchroData.java#L140-L150 |
apache/spark | sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/SessionManager.java | SessionManager.openSession | public SessionHandle openSession(TProtocolVersion protocol, String username, String password, String ipAddress,
Map<String, String> sessionConf, boolean withImpersonation, String delegationToken)
throws HiveSQLException {
HiveSession session;
// If doAs is set to true for HiveServer2, we will create a proxy object for the session impl.
// Within the proxy object, we wrap the method call in a UserGroupInformation#doAs
if (withImpersonation) {
HiveSessionImplwithUGI sessionWithUGI = new HiveSessionImplwithUGI(protocol, username, password,
hiveConf, ipAddress, delegationToken);
session = HiveSessionProxy.getProxy(sessionWithUGI, sessionWithUGI.getSessionUgi());
sessionWithUGI.setProxySession(session);
} else {
session = new HiveSessionImpl(protocol, username, password, hiveConf, ipAddress);
}
session.setSessionManager(this);
session.setOperationManager(operationManager);
try {
session.open(sessionConf);
} catch (Exception e) {
try {
session.close();
} catch (Throwable t) {
LOG.warn("Error closing session", t);
}
session = null;
throw new HiveSQLException("Failed to open new session: " + e, e);
}
if (isOperationLogEnabled) {
session.setOperationLogSessionDir(operationLogRootDir);
}
handleToSession.put(session.getSessionHandle(), session);
return session.getSessionHandle();
} | java | public SessionHandle openSession(TProtocolVersion protocol, String username, String password, String ipAddress,
Map<String, String> sessionConf, boolean withImpersonation, String delegationToken)
throws HiveSQLException {
HiveSession session;
// If doAs is set to true for HiveServer2, we will create a proxy object for the session impl.
// Within the proxy object, we wrap the method call in a UserGroupInformation#doAs
if (withImpersonation) {
HiveSessionImplwithUGI sessionWithUGI = new HiveSessionImplwithUGI(protocol, username, password,
hiveConf, ipAddress, delegationToken);
session = HiveSessionProxy.getProxy(sessionWithUGI, sessionWithUGI.getSessionUgi());
sessionWithUGI.setProxySession(session);
} else {
session = new HiveSessionImpl(protocol, username, password, hiveConf, ipAddress);
}
session.setSessionManager(this);
session.setOperationManager(operationManager);
try {
session.open(sessionConf);
} catch (Exception e) {
try {
session.close();
} catch (Throwable t) {
LOG.warn("Error closing session", t);
}
session = null;
throw new HiveSQLException("Failed to open new session: " + e, e);
}
if (isOperationLogEnabled) {
session.setOperationLogSessionDir(operationLogRootDir);
}
handleToSession.put(session.getSessionHandle(), session);
return session.getSessionHandle();
} | [
"public",
"SessionHandle",
"openSession",
"(",
"TProtocolVersion",
"protocol",
",",
"String",
"username",
",",
"String",
"password",
",",
"String",
"ipAddress",
",",
"Map",
"<",
"String",
",",
"String",
">",
"sessionConf",
",",
"boolean",
"withImpersonation",
",",... | Opens a new session and creates a session handle.
The username passed to this method is the effective username.
If withImpersonation is true (==doAs true) we wrap all the calls in HiveSession
within a UGI.doAs, where UGI corresponds to the effective user.
Please see {@code org.apache.hive.service.cli.thrift.ThriftCLIService.getUserName()} for
more details.
@param protocol
@param username
@param password
@param ipAddress
@param sessionConf
@param withImpersonation
@param delegationToken
@return
@throws HiveSQLException | [
"Opens",
"a",
"new",
"session",
"and",
"creates",
"a",
"session",
"handle",
".",
"The",
"username",
"passed",
"to",
"this",
"method",
"is",
"the",
"effective",
"username",
".",
"If",
"withImpersonation",
"is",
"true",
"(",
"==",
"doAs",
"true",
")",
"we",
... | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/SessionManager.java#L241-L273 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java | StringGroovyMethods.getAt | public static String getAt(GString text, int index) {
return (String) getAt(text.toString(), index);
} | java | public static String getAt(GString text, int index) {
return (String) getAt(text.toString(), index);
} | [
"public",
"static",
"String",
"getAt",
"(",
"GString",
"text",
",",
"int",
"index",
")",
"{",
"return",
"(",
"String",
")",
"getAt",
"(",
"text",
".",
"toString",
"(",
")",
",",
"index",
")",
";",
"}"
] | Support the subscript operator for GString.
@param text a GString
@param index the index of the Character to get
@return the Character at the given index
@since 2.3.7 | [
"Support",
"the",
"subscript",
"operator",
"for",
"GString",
"."
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java#L1253-L1255 |
sockeqwe/SwipeBack | library/src/com/hannesdorfmann/swipeback/SwipeBack.java | SwipeBack.setSwipeBackView | public SwipeBack setSwipeBackView(View view) {
setSwipeBackView(view, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
return this;
} | java | public SwipeBack setSwipeBackView(View view) {
setSwipeBackView(view, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
return this;
} | [
"public",
"SwipeBack",
"setSwipeBackView",
"(",
"View",
"view",
")",
"{",
"setSwipeBackView",
"(",
"view",
",",
"new",
"LayoutParams",
"(",
"LayoutParams",
".",
"MATCH_PARENT",
",",
"LayoutParams",
".",
"MATCH_PARENT",
")",
")",
";",
"return",
"this",
";",
"}"... | Set the swipe back view to an explicit view.
@param view
The swipe back view. | [
"Set",
"the",
"swipe",
"back",
"view",
"to",
"an",
"explicit",
"view",
"."
] | train | https://github.com/sockeqwe/SwipeBack/blob/09ed11f48e930ed47fd4f07ad1c786fc9fff3c48/library/src/com/hannesdorfmann/swipeback/SwipeBack.java#L1372-L1375 |
deeplearning4j/deeplearning4j | datavec/datavec-spark/src/main/java/org/datavec/spark/storage/SparkStorageUtils.java | SparkStorageUtils.restoreSequenceFileSequences | public static JavaRDD<List<List<Writable>>> restoreSequenceFileSequences(String path, JavaSparkContext sc) {
return restoreMapFileSequences(path, sc).values();
} | java | public static JavaRDD<List<List<Writable>>> restoreSequenceFileSequences(String path, JavaSparkContext sc) {
return restoreMapFileSequences(path, sc).values();
} | [
"public",
"static",
"JavaRDD",
"<",
"List",
"<",
"List",
"<",
"Writable",
">",
">",
">",
"restoreSequenceFileSequences",
"(",
"String",
"path",
",",
"JavaSparkContext",
"sc",
")",
"{",
"return",
"restoreMapFileSequences",
"(",
"path",
",",
"sc",
")",
".",
"v... | Restore a {@code JavaRDD<List<List<Writable>>} previously saved with {@link #saveSequenceFileSequences(String, JavaRDD)}
@param path Path of the sequence file
@param sc Spark context
@return The restored RDD | [
"Restore",
"a",
"{",
"@code",
"JavaRDD<List<List<Writable",
">>",
"}",
"previously",
"saved",
"with",
"{",
"@link",
"#saveSequenceFileSequences",
"(",
"String",
"JavaRDD",
")",
"}"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-spark/src/main/java/org/datavec/spark/storage/SparkStorageUtils.java#L165-L167 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/render/CoreRenderer.java | CoreRenderer.getRequestParameter | public static String getRequestParameter(FacesContext context, String name) {
return context.getExternalContext().getRequestParameterMap().get(name);
} | java | public static String getRequestParameter(FacesContext context, String name) {
return context.getExternalContext().getRequestParameterMap().get(name);
} | [
"public",
"static",
"String",
"getRequestParameter",
"(",
"FacesContext",
"context",
",",
"String",
"name",
")",
"{",
"return",
"context",
".",
"getExternalContext",
"(",
")",
".",
"getRequestParameterMap",
"(",
")",
".",
"get",
"(",
"name",
")",
";",
"}"
] | Returns request parameter value for the provided parameter name.
@param context Faces context.
@param name Parameter name to get value for.
@return Request parameter value for the provided parameter name. | [
"Returns",
"request",
"parameter",
"value",
"for",
"the",
"provided",
"parameter",
"name",
"."
] | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/render/CoreRenderer.java#L576-L578 |
Jasig/uPortal | uPortal-spring/src/main/java/org/springframework/web/client/interceptors/ZeroLeggedOAuthInterceptor.java | ZeroLeggedOAuthInterceptor.getConsumer | private synchronized RealmOAuthConsumer getConsumer() {
// could just inject these, but I kinda prefer pushing this out
// to the properties file...
if (consumer == null) {
OAuthServiceProvider serviceProvider = new OAuthServiceProvider("", "", "");
String realm =
propertyResolver.getProperty(
"org.jasig.rest.interceptor.oauth." + id + ".realm");
String consumerKey =
propertyResolver.getProperty(
"org.jasig.rest.interceptor.oauth." + id + ".consumerKey");
String secretKey =
propertyResolver.getProperty(
"org.jasig.rest.interceptor.oauth." + id + ".secretKey");
Assert.notNull(
consumerKey,
"The property \"org.jasig.rest.interceptor.oauth."
+ id
+ ".consumerKey\" must be set.");
Assert.notNull(
secretKey,
"The property \"org.jasig.rest.interceptor.oauth."
+ id
+ ".secretKey\" must be set.");
consumer = new RealmOAuthConsumer(consumerKey, secretKey, realm, serviceProvider);
}
return consumer;
} | java | private synchronized RealmOAuthConsumer getConsumer() {
// could just inject these, but I kinda prefer pushing this out
// to the properties file...
if (consumer == null) {
OAuthServiceProvider serviceProvider = new OAuthServiceProvider("", "", "");
String realm =
propertyResolver.getProperty(
"org.jasig.rest.interceptor.oauth." + id + ".realm");
String consumerKey =
propertyResolver.getProperty(
"org.jasig.rest.interceptor.oauth." + id + ".consumerKey");
String secretKey =
propertyResolver.getProperty(
"org.jasig.rest.interceptor.oauth." + id + ".secretKey");
Assert.notNull(
consumerKey,
"The property \"org.jasig.rest.interceptor.oauth."
+ id
+ ".consumerKey\" must be set.");
Assert.notNull(
secretKey,
"The property \"org.jasig.rest.interceptor.oauth."
+ id
+ ".secretKey\" must be set.");
consumer = new RealmOAuthConsumer(consumerKey, secretKey, realm, serviceProvider);
}
return consumer;
} | [
"private",
"synchronized",
"RealmOAuthConsumer",
"getConsumer",
"(",
")",
"{",
"// could just inject these, but I kinda prefer pushing this out",
"// to the properties file...",
"if",
"(",
"consumer",
"==",
"null",
")",
"{",
"OAuthServiceProvider",
"serviceProvider",
"=",
"new"... | Get the OAuthConsumer. Will initialize it lazily.
@return the OAuthConsumer object. | [
"Get",
"the",
"OAuthConsumer",
".",
"Will",
"initialize",
"it",
"lazily",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-spring/src/main/java/org/springframework/web/client/interceptors/ZeroLeggedOAuthInterceptor.java#L98-L128 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/customer/accounts/CustomerNoteUrl.java | CustomerNoteUrl.getAccountNotesUrl | public static MozuUrl getAccountNotesUrl(Integer accountId, String filter, Integer pageSize, String responseFields, String sortBy, Integer startIndex)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/accounts/{accountId}/notes?startIndex={startIndex}&pageSize={pageSize}&sortBy={sortBy}&filter={filter}&responseFields={responseFields}");
formatter.formatUrl("accountId", accountId);
formatter.formatUrl("filter", filter);
formatter.formatUrl("pageSize", pageSize);
formatter.formatUrl("responseFields", responseFields);
formatter.formatUrl("sortBy", sortBy);
formatter.formatUrl("startIndex", startIndex);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java | public static MozuUrl getAccountNotesUrl(Integer accountId, String filter, Integer pageSize, String responseFields, String sortBy, Integer startIndex)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/accounts/{accountId}/notes?startIndex={startIndex}&pageSize={pageSize}&sortBy={sortBy}&filter={filter}&responseFields={responseFields}");
formatter.formatUrl("accountId", accountId);
formatter.formatUrl("filter", filter);
formatter.formatUrl("pageSize", pageSize);
formatter.formatUrl("responseFields", responseFields);
formatter.formatUrl("sortBy", sortBy);
formatter.formatUrl("startIndex", startIndex);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | [
"public",
"static",
"MozuUrl",
"getAccountNotesUrl",
"(",
"Integer",
"accountId",
",",
"String",
"filter",
",",
"Integer",
"pageSize",
",",
"String",
"responseFields",
",",
"String",
"sortBy",
",",
"Integer",
"startIndex",
")",
"{",
"UrlFormatter",
"formatter",
"=... | Get Resource Url for GetAccountNotes
@param accountId Unique identifier of the customer account.
@param filter A set of filter expressions representing the search parameters for a query. This parameter is optional. Refer to [Sorting and Filtering](../../../../Developer/api-guides/sorting-filtering.htm) for a list of supported filters.
@param pageSize When creating paged results from a query, this value indicates the zero-based offset in the complete result set where the returned entities begin. For example, with this parameter set to 25, to get the 51st through the 75th items, set startIndex to 50.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
@param sortBy The element to sort the results by and the channel in which the results appear. Either ascending (a-z) or descending (z-a) channel. Optional. Refer to [Sorting and Filtering](../../../../Developer/api-guides/sorting-filtering.htm) for more information.
@param startIndex When creating paged results from a query, this value indicates the zero-based offset in the complete result set where the returned entities begin. For example, with pageSize set to 25, to get the 51st through the 75th items, set this parameter to 50.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"GetAccountNotes"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/customer/accounts/CustomerNoteUrl.java#L42-L52 |
osglworks/java-mvc | src/main/java/org/osgl/mvc/result/BadGateway.java | BadGateway.of | public static BadGateway of(Throwable cause) {
if (_localizedErrorMsg()) {
return of(cause, defaultMessage(BAD_GATEWAY));
} else {
touchPayload().cause(cause);
return _INSTANCE;
}
} | java | public static BadGateway of(Throwable cause) {
if (_localizedErrorMsg()) {
return of(cause, defaultMessage(BAD_GATEWAY));
} else {
touchPayload().cause(cause);
return _INSTANCE;
}
} | [
"public",
"static",
"BadGateway",
"of",
"(",
"Throwable",
"cause",
")",
"{",
"if",
"(",
"_localizedErrorMsg",
"(",
")",
")",
"{",
"return",
"of",
"(",
"cause",
",",
"defaultMessage",
"(",
"BAD_GATEWAY",
")",
")",
";",
"}",
"else",
"{",
"touchPayload",
"(... | Returns a static BadGateway instance and set the {@link #payload} thread local
with cause specified.
When calling the instance on {@link #getMessage()} method, it will return whatever
stored in the {@link #payload} thread local
@param cause the cause
@return a static BadGateway instance as described above | [
"Returns",
"a",
"static",
"BadGateway",
"instance",
"and",
"set",
"the",
"{",
"@link",
"#payload",
"}",
"thread",
"local",
"with",
"cause",
"specified",
"."
] | train | https://github.com/osglworks/java-mvc/blob/4d2b2ec40498ac6ee7040c0424377cbeacab124b/src/main/java/org/osgl/mvc/result/BadGateway.java#L123-L130 |
fernandospr/java-wns | src/main/java/ar/com/fernandospr/wns/WnsService.java | WnsService.pushRaw | public WnsNotificationResponse pushRaw(String channelUri, WnsRaw raw) throws WnsException {
return this.pushRaw(channelUri, null, raw);
} | java | public WnsNotificationResponse pushRaw(String channelUri, WnsRaw raw) throws WnsException {
return this.pushRaw(channelUri, null, raw);
} | [
"public",
"WnsNotificationResponse",
"pushRaw",
"(",
"String",
"channelUri",
",",
"WnsRaw",
"raw",
")",
"throws",
"WnsException",
"{",
"return",
"this",
".",
"pushRaw",
"(",
"channelUri",
",",
"null",
",",
"raw",
")",
";",
"}"
] | Pushes a badge to channelUri
@param channelUri
@param raw which should be built with {@link ar.com.fernandospr.wns.model.builders.WnsBadgeBuilder}
@return WnsNotificationResponse please see response headers from <a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh465435.aspx#send_notification_response">http://msdn.microsoft.com/en-us/library/windows/apps/hh465435.aspx#send_notification_response</a>
@throws WnsException when authentication fails | [
"Pushes",
"a",
"badge",
"to",
"channelUri"
] | train | https://github.com/fernandospr/java-wns/blob/cd621b9c17d1e706f6284e0913531d834904a90d/src/main/java/ar/com/fernandospr/wns/WnsService.java#L214-L216 |
burberius/eve-esi | src/main/java/net/troja/eve/esi/auth/OAuth.java | OAuth.getJWT | public JWT getJWT() {
AccountData accountData = getAccountData(); // Update access token if
// needed
if (accountData == null) {
return null;
}
try {
String accessToken = accountData.getAccessToken();
if (accessToken == null) {
return null;
}
String[] parts = accessToken.split("\\.");
if (parts.length != 3) {
return null;
}
Gson gson = new GsonBuilder().registerTypeAdapter(JWT.Payload.class, new JWT.PayloadDeserializer())
.create();
JWT.Header header = gson.fromJson(new String(Base64.getUrlDecoder().decode(parts[0])), JWT.Header.class);
JWT.Payload payload = gson.fromJson(new String(Base64.getUrlDecoder().decode(parts[1])), JWT.Payload.class);
String signature = parts[2];
return new JWT(header, payload, signature);
} catch (JsonSyntaxException ex) {
return null;
}
} | java | public JWT getJWT() {
AccountData accountData = getAccountData(); // Update access token if
// needed
if (accountData == null) {
return null;
}
try {
String accessToken = accountData.getAccessToken();
if (accessToken == null) {
return null;
}
String[] parts = accessToken.split("\\.");
if (parts.length != 3) {
return null;
}
Gson gson = new GsonBuilder().registerTypeAdapter(JWT.Payload.class, new JWT.PayloadDeserializer())
.create();
JWT.Header header = gson.fromJson(new String(Base64.getUrlDecoder().decode(parts[0])), JWT.Header.class);
JWT.Payload payload = gson.fromJson(new String(Base64.getUrlDecoder().decode(parts[1])), JWT.Payload.class);
String signature = parts[2];
return new JWT(header, payload, signature);
} catch (JsonSyntaxException ex) {
return null;
}
} | [
"public",
"JWT",
"getJWT",
"(",
")",
"{",
"AccountData",
"accountData",
"=",
"getAccountData",
"(",
")",
";",
"// Update access token if",
"// needed",
"if",
"(",
"accountData",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"String",
"acces... | Get JWT (JSON Web Token) WARNING: The JWT is unverified. Verifying the
JWT is beyond the scope of this library. As ESI will verify the token
when used. See the SSO documentation for JWT Token validation for
details:
https://github.com/esi/esi-docs/blob/master/docs/sso/validating_eve_jwt
.md
@return Unverified JWT or null | [
"Get",
"JWT",
"(",
"JSON",
"Web",
"Token",
")",
"WARNING",
":",
"The",
"JWT",
"is",
"unverified",
".",
"Verifying",
"the",
"JWT",
"is",
"beyond",
"the",
"scope",
"of",
"this",
"library",
".",
"As",
"ESI",
"will",
"verify",
"the",
"token",
"when",
"used... | train | https://github.com/burberius/eve-esi/blob/24a941c592cfc15f23471ef849b282fbc582ca13/src/main/java/net/troja/eve/esi/auth/OAuth.java#L113-L137 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/ConnectionsInner.java | ConnectionsInner.updateAsync | public Observable<ConnectionInner> updateAsync(String resourceGroupName, String automationAccountName, String connectionName, ConnectionUpdateParameters parameters) {
return updateWithServiceResponseAsync(resourceGroupName, automationAccountName, connectionName, parameters).map(new Func1<ServiceResponse<ConnectionInner>, ConnectionInner>() {
@Override
public ConnectionInner call(ServiceResponse<ConnectionInner> response) {
return response.body();
}
});
} | java | public Observable<ConnectionInner> updateAsync(String resourceGroupName, String automationAccountName, String connectionName, ConnectionUpdateParameters parameters) {
return updateWithServiceResponseAsync(resourceGroupName, automationAccountName, connectionName, parameters).map(new Func1<ServiceResponse<ConnectionInner>, ConnectionInner>() {
@Override
public ConnectionInner call(ServiceResponse<ConnectionInner> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"ConnectionInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"String",
"connectionName",
",",
"ConnectionUpdateParameters",
"parameters",
")",
"{",
"return",
"updateWithServiceResponseAs... | Update a connection.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param connectionName The parameters supplied to the update a connection operation.
@param parameters The parameters supplied to the update a connection operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ConnectionInner object | [
"Update",
"a",
"connection",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/ConnectionsInner.java#L417-L424 |
VoltDB/voltdb | src/frontend/org/voltdb/RestoreAgent.java | RestoreAgent.fetchSnapshotTxnId | private void fetchSnapshotTxnId() {
try {
byte[] data = m_zk.getData(VoltZK.restore_snapshot_id, false, null);
String jsonData = new String(data, Constants.UTF8ENCODING);
if (!jsonData.equals("{}")) {
m_hasRestored = true;
JSONObject jo = new JSONObject(jsonData);
SnapshotInfo info = new SnapshotInfo(jo);
m_replayAgent.setSnapshotTxnId(info);
}
else {
m_hasRestored = false;
m_replayAgent.setSnapshotTxnId(null);
}
} catch (KeeperException e2) {
VoltDB.crashGlobalVoltDB(e2.getMessage(), false, e2);
} catch (InterruptedException e2) {
} catch (JSONException je) {
VoltDB.crashLocalVoltDB(je.getMessage(), true, je);
}
} | java | private void fetchSnapshotTxnId() {
try {
byte[] data = m_zk.getData(VoltZK.restore_snapshot_id, false, null);
String jsonData = new String(data, Constants.UTF8ENCODING);
if (!jsonData.equals("{}")) {
m_hasRestored = true;
JSONObject jo = new JSONObject(jsonData);
SnapshotInfo info = new SnapshotInfo(jo);
m_replayAgent.setSnapshotTxnId(info);
}
else {
m_hasRestored = false;
m_replayAgent.setSnapshotTxnId(null);
}
} catch (KeeperException e2) {
VoltDB.crashGlobalVoltDB(e2.getMessage(), false, e2);
} catch (InterruptedException e2) {
} catch (JSONException je) {
VoltDB.crashLocalVoltDB(je.getMessage(), true, je);
}
} | [
"private",
"void",
"fetchSnapshotTxnId",
"(",
")",
"{",
"try",
"{",
"byte",
"[",
"]",
"data",
"=",
"m_zk",
".",
"getData",
"(",
"VoltZK",
".",
"restore_snapshot_id",
",",
"false",
",",
"null",
")",
";",
"String",
"jsonData",
"=",
"new",
"String",
"(",
... | Get the txnId of the snapshot the cluster is restoring from from ZK.
NOTE that the barrier for this is now completely contained
in run() in the restorePlanner thread; nobody gets out of there until
someone wins the leader election and successfully writes the VoltZK.restore_snapshot_id
node, so we just need to read it here. | [
"Get",
"the",
"txnId",
"of",
"the",
"snapshot",
"the",
"cluster",
"is",
"restoring",
"from",
"from",
"ZK",
".",
"NOTE",
"that",
"the",
"barrier",
"for",
"this",
"is",
"now",
"completely",
"contained",
"in",
"run",
"()",
"in",
"the",
"restorePlanner",
"thre... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/RestoreAgent.java#L954-L975 |
javagl/CommonUI | src/main/java/de/javagl/common/ui/tree/filtered/FilteredTreeModel.java | FilteredTreeModel.createNode | private FilteredTreeNode createNode(final TreeNode delegateNode)
{
FilteredTreeNode node = new FilteredTreeNode(this, delegateNode);
delegateToThis.put(delegateNode, node);
thisToDelegate.put(node, delegateNode);
@SuppressWarnings("unchecked")
Enumeration<? extends TreeNode> delegateChildren =
delegateNode.children();
while (delegateChildren.hasMoreElements())
{
TreeNode delegateChild = delegateChildren.nextElement();
createNode(delegateChild);
}
return node;
} | java | private FilteredTreeNode createNode(final TreeNode delegateNode)
{
FilteredTreeNode node = new FilteredTreeNode(this, delegateNode);
delegateToThis.put(delegateNode, node);
thisToDelegate.put(node, delegateNode);
@SuppressWarnings("unchecked")
Enumeration<? extends TreeNode> delegateChildren =
delegateNode.children();
while (delegateChildren.hasMoreElements())
{
TreeNode delegateChild = delegateChildren.nextElement();
createNode(delegateChild);
}
return node;
} | [
"private",
"FilteredTreeNode",
"createNode",
"(",
"final",
"TreeNode",
"delegateNode",
")",
"{",
"FilteredTreeNode",
"node",
"=",
"new",
"FilteredTreeNode",
"(",
"this",
",",
"delegateNode",
")",
";",
"delegateToThis",
".",
"put",
"(",
"delegateNode",
",",
"node",... | Recursively create the node for the given delegate node and
its children.
@param delegateNode The delegate node
@return The filtered version of the node | [
"Recursively",
"create",
"the",
"node",
"for",
"the",
"given",
"delegate",
"node",
"and",
"its",
"children",
"."
] | train | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/tree/filtered/FilteredTreeModel.java#L165-L180 |
rterp/GMapsFX | GMapsFX/src/main/java/com/lynden/gmapsfx/javascript/object/DirectionsPane.java | DirectionsPane.fromLatLngToPoint | public Point2D fromLatLngToPoint(LatLong loc) {
// System.out.println("GoogleMap.fromLatLngToPoint loc: " + loc);
Projection proj = getProjection();
//System.out.println("map.fromLatLngToPoint Projection: " + proj);
LatLongBounds llb = getBounds();
// System.out.println("GoogleMap.fromLatLngToPoint Bounds: " + llb);
GMapPoint topRight = proj.fromLatLngToPoint(llb.getNorthEast());
// System.out.println("GoogleMap.fromLatLngToPoint topRight: " + topRight);
GMapPoint bottomLeft = proj.fromLatLngToPoint(llb.getSouthWest());
// System.out.println("GoogleMap.fromLatLngToPoint bottomLeft: " + bottomLeft);
double scale = Math.pow(2, getZoom());
GMapPoint worldPoint = proj.fromLatLngToPoint(loc);
// System.out.println("GoogleMap.fromLatLngToPoint worldPoint: " + worldPoint);
double x = (worldPoint.getX() - bottomLeft.getX()) * scale;
double y = (worldPoint.getY() - topRight.getY()) * scale;
// System.out.println("GoogleMap.fromLatLngToPoint x: " + x + " y: " + y);
return new Point2D(x, y);
} | java | public Point2D fromLatLngToPoint(LatLong loc) {
// System.out.println("GoogleMap.fromLatLngToPoint loc: " + loc);
Projection proj = getProjection();
//System.out.println("map.fromLatLngToPoint Projection: " + proj);
LatLongBounds llb = getBounds();
// System.out.println("GoogleMap.fromLatLngToPoint Bounds: " + llb);
GMapPoint topRight = proj.fromLatLngToPoint(llb.getNorthEast());
// System.out.println("GoogleMap.fromLatLngToPoint topRight: " + topRight);
GMapPoint bottomLeft = proj.fromLatLngToPoint(llb.getSouthWest());
// System.out.println("GoogleMap.fromLatLngToPoint bottomLeft: " + bottomLeft);
double scale = Math.pow(2, getZoom());
GMapPoint worldPoint = proj.fromLatLngToPoint(loc);
// System.out.println("GoogleMap.fromLatLngToPoint worldPoint: " + worldPoint);
double x = (worldPoint.getX() - bottomLeft.getX()) * scale;
double y = (worldPoint.getY() - topRight.getY()) * scale;
// System.out.println("GoogleMap.fromLatLngToPoint x: " + x + " y: " + y);
return new Point2D(x, y);
} | [
"public",
"Point2D",
"fromLatLngToPoint",
"(",
"LatLong",
"loc",
")",
"{",
"// System.out.println(\"GoogleMap.fromLatLngToPoint loc: \" + loc);",
"Projection",
"proj",
"=",
"getProjection",
"(",
")",
";",
"//System.out.println(\"map.fromLatLngToPoint Projection: \" + proj);",
... | Returns the screen point for the provided LatLong. Note: Unexpected
results can be obtained if this method is called as a result of a zoom
change, as the zoom event is fired before the bounds are updated, and
bounds need to be used to obtain the answer!
<p>
One workaround is to only operate off bounds_changed events.
@param loc
@return | [
"Returns",
"the",
"screen",
"point",
"for",
"the",
"provided",
"LatLong",
".",
"Note",
":",
"Unexpected",
"results",
"can",
"be",
"obtained",
"if",
"this",
"method",
"is",
"called",
"as",
"a",
"result",
"of",
"a",
"zoom",
"change",
"as",
"the",
"zoom",
"... | train | https://github.com/rterp/GMapsFX/blob/4623d3f768e8ad78fc50ee32dd204d236e01059f/GMapsFX/src/main/java/com/lynden/gmapsfx/javascript/object/DirectionsPane.java#L170-L191 |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/HpackStaticTable.java | HpackStaticTable.getIndex | static int getIndex(CharSequence name, CharSequence value) {
int index = getIndex(name);
if (index == -1) {
return -1;
}
// Note this assumes all entries for a given header field are sequential.
while (index <= length) {
HpackHeaderField entry = getEntry(index);
if (equalsConstantTime(name, entry.name) == 0) {
break;
}
if (equalsConstantTime(value, entry.value) != 0) {
return index;
}
index++;
}
return -1;
} | java | static int getIndex(CharSequence name, CharSequence value) {
int index = getIndex(name);
if (index == -1) {
return -1;
}
// Note this assumes all entries for a given header field are sequential.
while (index <= length) {
HpackHeaderField entry = getEntry(index);
if (equalsConstantTime(name, entry.name) == 0) {
break;
}
if (equalsConstantTime(value, entry.value) != 0) {
return index;
}
index++;
}
return -1;
} | [
"static",
"int",
"getIndex",
"(",
"CharSequence",
"name",
",",
"CharSequence",
"value",
")",
"{",
"int",
"index",
"=",
"getIndex",
"(",
"name",
")",
";",
"if",
"(",
"index",
"==",
"-",
"1",
")",
"{",
"return",
"-",
"1",
";",
"}",
"// Note this assumes ... | Returns the index value for the given header field in the static table. Returns -1 if the
header field is not in the static table. | [
"Returns",
"the",
"index",
"value",
"for",
"the",
"given",
"header",
"field",
"in",
"the",
"static",
"table",
".",
"Returns",
"-",
"1",
"if",
"the",
"header",
"field",
"is",
"not",
"in",
"the",
"static",
"table",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/HpackStaticTable.java#L148-L167 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/FailoverGroupsInner.java | FailoverGroupsInner.updateAsync | public Observable<FailoverGroupInner> updateAsync(String resourceGroupName, String serverName, String failoverGroupName, FailoverGroupUpdate parameters) {
return updateWithServiceResponseAsync(resourceGroupName, serverName, failoverGroupName, parameters).map(new Func1<ServiceResponse<FailoverGroupInner>, FailoverGroupInner>() {
@Override
public FailoverGroupInner call(ServiceResponse<FailoverGroupInner> response) {
return response.body();
}
});
} | java | public Observable<FailoverGroupInner> updateAsync(String resourceGroupName, String serverName, String failoverGroupName, FailoverGroupUpdate parameters) {
return updateWithServiceResponseAsync(resourceGroupName, serverName, failoverGroupName, parameters).map(new Func1<ServiceResponse<FailoverGroupInner>, FailoverGroupInner>() {
@Override
public FailoverGroupInner call(ServiceResponse<FailoverGroupInner> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"FailoverGroupInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"failoverGroupName",
",",
"FailoverGroupUpdate",
"parameters",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",... | Updates a failover group.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server containing the failover group.
@param failoverGroupName The name of the failover group.
@param parameters The failover group parameters.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the request | [
"Updates",
"a",
"failover",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/FailoverGroupsInner.java#L611-L618 |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/common/Workspace.java | Workspace.workspaceToElement | public Element workspaceToElement() {
final Workspace space = this;
final Element element = new Element("workspace", AtomService.ATOM_PROTOCOL);
final Element titleElem = new Element("title", AtomService.ATOM_FORMAT);
titleElem.setText(space.getTitle());
if (space.getTitleType() != null && !space.getTitleType().equals("TEXT")) {
titleElem.setAttribute("type", space.getTitleType(), AtomService.ATOM_FORMAT);
}
element.addContent(titleElem);
for (final Collection col : space.getCollections()) {
element.addContent(col.collectionToElement());
}
return element;
} | java | public Element workspaceToElement() {
final Workspace space = this;
final Element element = new Element("workspace", AtomService.ATOM_PROTOCOL);
final Element titleElem = new Element("title", AtomService.ATOM_FORMAT);
titleElem.setText(space.getTitle());
if (space.getTitleType() != null && !space.getTitleType().equals("TEXT")) {
titleElem.setAttribute("type", space.getTitleType(), AtomService.ATOM_FORMAT);
}
element.addContent(titleElem);
for (final Collection col : space.getCollections()) {
element.addContent(col.collectionToElement());
}
return element;
} | [
"public",
"Element",
"workspaceToElement",
"(",
")",
"{",
"final",
"Workspace",
"space",
"=",
"this",
";",
"final",
"Element",
"element",
"=",
"new",
"Element",
"(",
"\"workspace\"",
",",
"AtomService",
".",
"ATOM_PROTOCOL",
")",
";",
"final",
"Element",
"titl... | Serialize an AtomService.DefaultWorkspace object into an XML element | [
"Serialize",
"an",
"AtomService",
".",
"DefaultWorkspace",
"object",
"into",
"an",
"XML",
"element"
] | train | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/common/Workspace.java#L119-L136 |
Impetus/Kundera | src/kundera-hbase/kundera-hbase-v2/src/main/java/com/impetus/client/hbase/admin/HBaseDataHandler.java | HBaseDataHandler.populateEntityFromHBaseData | private Object populateEntityFromHBaseData(Object entity, HBaseDataWrapper hbaseData, EntityMetadata m,
Object rowKey)
{
try
{
Map<String, Object> relations = new HashMap<String, Object>();
if (entity.getClass().isAssignableFrom(EnhanceEntity.class))
{
relations = ((EnhanceEntity) entity).getRelations();
entity = ((EnhanceEntity) entity).getEntity();
}
MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
m.getPersistenceUnit());
EntityType entityType = metaModel.entity(m.getEntityClazz());
Set<Attribute> attributes = ((AbstractManagedType) entityType).getAttributes();
writeValuesToEntity(entity, hbaseData, m, metaModel, attributes, m.getRelationNames(), relations, -1, "");
if (!relations.isEmpty())
{
return new EnhanceEntity(entity, rowKey, relations);
}
return entity;
}
catch (PropertyAccessException e1)
{
throw new RuntimeException(e1);
}
} | java | private Object populateEntityFromHBaseData(Object entity, HBaseDataWrapper hbaseData, EntityMetadata m,
Object rowKey)
{
try
{
Map<String, Object> relations = new HashMap<String, Object>();
if (entity.getClass().isAssignableFrom(EnhanceEntity.class))
{
relations = ((EnhanceEntity) entity).getRelations();
entity = ((EnhanceEntity) entity).getEntity();
}
MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
m.getPersistenceUnit());
EntityType entityType = metaModel.entity(m.getEntityClazz());
Set<Attribute> attributes = ((AbstractManagedType) entityType).getAttributes();
writeValuesToEntity(entity, hbaseData, m, metaModel, attributes, m.getRelationNames(), relations, -1, "");
if (!relations.isEmpty())
{
return new EnhanceEntity(entity, rowKey, relations);
}
return entity;
}
catch (PropertyAccessException e1)
{
throw new RuntimeException(e1);
}
} | [
"private",
"Object",
"populateEntityFromHBaseData",
"(",
"Object",
"entity",
",",
"HBaseDataWrapper",
"hbaseData",
",",
"EntityMetadata",
"m",
",",
"Object",
"rowKey",
")",
"{",
"try",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"relations",
"=",
"new",
"Ha... | Populate entity from hBase data.
@param entity
the entity
@param hbaseData
the hbase data
@param m
the m
@param rowKey
the row key
@return the object | [
"Populate",
"entity",
"from",
"hBase",
"data",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-hbase/kundera-hbase-v2/src/main/java/com/impetus/client/hbase/admin/HBaseDataHandler.java#L519-L546 |
apache/spark | common/network-common/src/main/java/org/apache/spark/network/TransportContext.java | TransportContext.createServer | public TransportServer createServer(
String host, int port, List<TransportServerBootstrap> bootstraps) {
return new TransportServer(this, host, port, rpcHandler, bootstraps);
} | java | public TransportServer createServer(
String host, int port, List<TransportServerBootstrap> bootstraps) {
return new TransportServer(this, host, port, rpcHandler, bootstraps);
} | [
"public",
"TransportServer",
"createServer",
"(",
"String",
"host",
",",
"int",
"port",
",",
"List",
"<",
"TransportServerBootstrap",
">",
"bootstraps",
")",
"{",
"return",
"new",
"TransportServer",
"(",
"this",
",",
"host",
",",
"port",
",",
"rpcHandler",
","... | Create a server which will attempt to bind to a specific host and port. | [
"Create",
"a",
"server",
"which",
"will",
"attempt",
"to",
"bind",
"to",
"a",
"specific",
"host",
"and",
"port",
"."
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-common/src/main/java/org/apache/spark/network/TransportContext.java#L155-L158 |
heinrichreimer/material-drawer | library/src/main/java/com/heinrichreimersoftware/materialdrawer/structure/DrawerItem.java | DrawerItem.setImage | public DrawerItem setImage(Context context, Bitmap image, int imageMode) {
return setImage(new BitmapDrawable(context.getResources(), image), imageMode);
} | java | public DrawerItem setImage(Context context, Bitmap image, int imageMode) {
return setImage(new BitmapDrawable(context.getResources(), image), imageMode);
} | [
"public",
"DrawerItem",
"setImage",
"(",
"Context",
"context",
",",
"Bitmap",
"image",
",",
"int",
"imageMode",
")",
"{",
"return",
"setImage",
"(",
"new",
"BitmapDrawable",
"(",
"context",
".",
"getResources",
"(",
")",
",",
"image",
")",
",",
"imageMode",
... | Sets an image with a given image mode to the drawer item
@param image Image to set
@param imageMode Image mode to set | [
"Sets",
"an",
"image",
"with",
"a",
"given",
"image",
"mode",
"to",
"the",
"drawer",
"item"
] | train | https://github.com/heinrichreimer/material-drawer/blob/7c2406812d73f710ef8bb73d4a0f4bbef3b275ce/library/src/main/java/com/heinrichreimersoftware/materialdrawer/structure/DrawerItem.java#L194-L196 |
apache/flink | flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/hadoopcompatibility/HadoopInputs.java | HadoopInputs.readHadoopFile | public static <K, V> HadoopInputFormat<K, V> readHadoopFile(org.apache.hadoop.mapred.FileInputFormat<K, V> mapredInputFormat, Class<K> key, Class<V> value, String inputPath) {
return readHadoopFile(mapredInputFormat, key, value, inputPath, new JobConf());
} | java | public static <K, V> HadoopInputFormat<K, V> readHadoopFile(org.apache.hadoop.mapred.FileInputFormat<K, V> mapredInputFormat, Class<K> key, Class<V> value, String inputPath) {
return readHadoopFile(mapredInputFormat, key, value, inputPath, new JobConf());
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"HadoopInputFormat",
"<",
"K",
",",
"V",
">",
"readHadoopFile",
"(",
"org",
".",
"apache",
".",
"hadoop",
".",
"mapred",
".",
"FileInputFormat",
"<",
"K",
",",
"V",
">",
"mapredInputFormat",
",",
"Class",
"<... | Creates a Flink {@link InputFormat} that wraps the given Hadoop {@link org.apache.hadoop.mapred.FileInputFormat}.
@return A Flink InputFormat that wraps the Hadoop FileInputFormat. | [
"Creates",
"a",
"Flink",
"{",
"@link",
"InputFormat",
"}",
"that",
"wraps",
"the",
"given",
"Hadoop",
"{",
"@link",
"org",
".",
"apache",
".",
"hadoop",
".",
"mapred",
".",
"FileInputFormat",
"}",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/hadoopcompatibility/HadoopInputs.java#L62-L64 |
javamonkey/beetl2.0 | beetl-core/src/main/java/org/beetl/ext/spring/UtilsFunctionPackage.java | UtilsFunctionPackage.joinEx | public String joinEx(Object collection, String delim, String prefix, String suffix) {
if (collection == null) {
return StringUtils.collectionToDelimitedString(Collections.emptyList(), delim, prefix, suffix);
} else if (collection instanceof Collection) {
return StringUtils.collectionToDelimitedString((Collection<?>) collection, delim, prefix, suffix);
} else if (collection.getClass().isArray()) {
return StringUtils.collectionToDelimitedString(CollectionUtils.arrayToList(collection), delim, prefix, suffix);
} else {
return StringUtils.collectionToDelimitedString(Collections.singletonList(collection), delim, prefix, suffix);
}
} | java | public String joinEx(Object collection, String delim, String prefix, String suffix) {
if (collection == null) {
return StringUtils.collectionToDelimitedString(Collections.emptyList(), delim, prefix, suffix);
} else if (collection instanceof Collection) {
return StringUtils.collectionToDelimitedString((Collection<?>) collection, delim, prefix, suffix);
} else if (collection.getClass().isArray()) {
return StringUtils.collectionToDelimitedString(CollectionUtils.arrayToList(collection), delim, prefix, suffix);
} else {
return StringUtils.collectionToDelimitedString(Collections.singletonList(collection), delim, prefix, suffix);
}
} | [
"public",
"String",
"joinEx",
"(",
"Object",
"collection",
",",
"String",
"delim",
",",
"String",
"prefix",
",",
"String",
"suffix",
")",
"{",
"if",
"(",
"collection",
"==",
"null",
")",
"{",
"return",
"StringUtils",
".",
"collectionToDelimitedString",
"(",
... | 在集合或数组元素之间拼接指定分隔符返回字符串, 并在前后拼接前后缀
@param collection
传入集合或数组, null表示空集, 其他类型表示单元素集合
@param delim
分隔符
@param prefix
前缀
@param suffix
后缀
@return 在集合或数组元素之间拼接指定分隔符返回字符串 | [
"在集合或数组元素之间拼接指定分隔符返回字符串",
"并在前后拼接前后缀"
] | train | https://github.com/javamonkey/beetl2.0/blob/f32f729ad238079df5aca6e38a3c3ba0a55c78d6/beetl-core/src/main/java/org/beetl/ext/spring/UtilsFunctionPackage.java#L158-L168 |
apache/flink | flink-core/src/main/java/org/apache/flink/core/io/SimpleVersionedSerialization.java | SimpleVersionedSerialization.readVersionAndDeSerialize | public static <T> T readVersionAndDeSerialize(SimpleVersionedSerializer<T> serializer, DataInputView in) throws IOException {
checkNotNull(serializer, "serializer");
checkNotNull(in, "in");
final int version = in.readInt();
final int length = in.readInt();
final byte[] data = new byte[length];
in.readFully(data);
return serializer.deserialize(version, data);
} | java | public static <T> T readVersionAndDeSerialize(SimpleVersionedSerializer<T> serializer, DataInputView in) throws IOException {
checkNotNull(serializer, "serializer");
checkNotNull(in, "in");
final int version = in.readInt();
final int length = in.readInt();
final byte[] data = new byte[length];
in.readFully(data);
return serializer.deserialize(version, data);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"readVersionAndDeSerialize",
"(",
"SimpleVersionedSerializer",
"<",
"T",
">",
"serializer",
",",
"DataInputView",
"in",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"serializer",
",",
"\"serializer\"",
")",
";",
... | Deserializes the version and datum from a stream.
<p>This method deserializes data serialized via
{@link #writeVersionAndSerialize(SimpleVersionedSerializer, Object, DataOutputView)}.
<p>The first four bytes will be interpreted as the version. The next four bytes will be
interpreted as the length of the datum bytes, then length-many bytes will be read.
Finally, the datum is deserialized via the {@link SimpleVersionedSerializer#deserialize(int, byte[])}
method.
@param serializer The serializer to serialize the datum with.
@param in The stream to deserialize from. | [
"Deserializes",
"the",
"version",
"and",
"datum",
"from",
"a",
"stream",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/io/SimpleVersionedSerialization.java#L78-L88 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/ChartResources.java | ChartResources.updateChartPreferences | @PUT
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Path("/{chartId}/preferences")
@Description("Updates a chart preferences given the ID.")
public ChartDto updateChartPreferences(@Context HttpServletRequest req, @PathParam("chartId") BigInteger chartId, final Map<String, String> preferences) {
if (chartId == null || chartId.compareTo(BigInteger.ZERO) < 1) {
throw new WebApplicationException("chartId cannot be null and must be a positive non-zero number.", Status.BAD_REQUEST);
}
if (preferences == null) {
throw new WebApplicationException("Cannot update with null preferences.", Status.BAD_REQUEST);
}
PrincipalUser remoteUser = getRemoteUser(req);
Chart existingChart = _chartService.getChartByPrimaryKey(chartId);
if (existingChart == null) {
throw new WebApplicationException("Chart with ID: " + chartId + " does not exist. Please use a valid chartId.",
Response.Status.NOT_FOUND);
}
Dashboard sharedDashboard= _dService.findDashboardByPrimaryKey(existingChart.getEntity().getId());
if (!sharedDashboard.isShared()) {
_validateResourceAuthorization(remoteUser, existingChart.getOwner());
}
existingChart.getPreferences().putAll(preferences);
existingChart.setModifiedBy(remoteUser);
existingChart=_chartService.updateChart(existingChart);
return ChartDto.transformToDto(existingChart);
} | java | @PUT
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Path("/{chartId}/preferences")
@Description("Updates a chart preferences given the ID.")
public ChartDto updateChartPreferences(@Context HttpServletRequest req, @PathParam("chartId") BigInteger chartId, final Map<String, String> preferences) {
if (chartId == null || chartId.compareTo(BigInteger.ZERO) < 1) {
throw new WebApplicationException("chartId cannot be null and must be a positive non-zero number.", Status.BAD_REQUEST);
}
if (preferences == null) {
throw new WebApplicationException("Cannot update with null preferences.", Status.BAD_REQUEST);
}
PrincipalUser remoteUser = getRemoteUser(req);
Chart existingChart = _chartService.getChartByPrimaryKey(chartId);
if (existingChart == null) {
throw new WebApplicationException("Chart with ID: " + chartId + " does not exist. Please use a valid chartId.",
Response.Status.NOT_FOUND);
}
Dashboard sharedDashboard= _dService.findDashboardByPrimaryKey(existingChart.getEntity().getId());
if (!sharedDashboard.isShared()) {
_validateResourceAuthorization(remoteUser, existingChart.getOwner());
}
existingChart.getPreferences().putAll(preferences);
existingChart.setModifiedBy(remoteUser);
existingChart=_chartService.updateChart(existingChart);
return ChartDto.transformToDto(existingChart);
} | [
"@",
"PUT",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"Consumes",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"Path",
"(",
"\"/{chartId}/preferences\"",
")",
"@",
"Description",
"(",
"\"Updates a chart preferences given the ID.\"",... | Updates an existing chart preferences.
@param req The HttpServlet request object. Cannot be null.
@param chartId The id of a chart. Cannot be null.
@param preferences Preferences for chart object. Cannot be null.
@return Updated chart object with preferences.
@throws WebApplicationException An exception with 404 NOT_FOUND will be thrown if the chart does not exist. | [
"Updates",
"an",
"existing",
"chart",
"preferences",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/ChartResources.java#L307-L337 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpx/MPXWriter.java | MPXWriter.stripLineBreaks | private String stripLineBreaks(String text, String replacement)
{
if (text.indexOf('\r') != -1 || text.indexOf('\n') != -1)
{
StringBuilder sb = new StringBuilder(text);
int index;
while ((index = sb.indexOf("\r\n")) != -1)
{
sb.replace(index, index + 2, replacement);
}
while ((index = sb.indexOf("\n\r")) != -1)
{
sb.replace(index, index + 2, replacement);
}
while ((index = sb.indexOf("\r")) != -1)
{
sb.replace(index, index + 1, replacement);
}
while ((index = sb.indexOf("\n")) != -1)
{
sb.replace(index, index + 1, replacement);
}
text = sb.toString();
}
return (text);
} | java | private String stripLineBreaks(String text, String replacement)
{
if (text.indexOf('\r') != -1 || text.indexOf('\n') != -1)
{
StringBuilder sb = new StringBuilder(text);
int index;
while ((index = sb.indexOf("\r\n")) != -1)
{
sb.replace(index, index + 2, replacement);
}
while ((index = sb.indexOf("\n\r")) != -1)
{
sb.replace(index, index + 2, replacement);
}
while ((index = sb.indexOf("\r")) != -1)
{
sb.replace(index, index + 1, replacement);
}
while ((index = sb.indexOf("\n")) != -1)
{
sb.replace(index, index + 1, replacement);
}
text = sb.toString();
}
return (text);
} | [
"private",
"String",
"stripLineBreaks",
"(",
"String",
"text",
",",
"String",
"replacement",
")",
"{",
"if",
"(",
"text",
".",
"indexOf",
"(",
"'",
"'",
")",
"!=",
"-",
"1",
"||",
"text",
".",
"indexOf",
"(",
"'",
"'",
")",
"!=",
"-",
"1",
")",
"... | This method removes line breaks from a piece of text, and replaces
them with the supplied text.
@param text source text
@param replacement line break replacement text
@return text with line breaks removed. | [
"This",
"method",
"removes",
"line",
"breaks",
"from",
"a",
"piece",
"of",
"text",
"and",
"replaces",
"them",
"with",
"the",
"supplied",
"text",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpx/MPXWriter.java#L902-L934 |
real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/Generators.java | Generators.findFirst | public static Token findFirst(final String name, final List<Token> tokens, final int index)
{
for (int i = index, size = tokens.size(); i < size; i++)
{
final Token token = tokens.get(i);
if (token.name().equals(name))
{
return token;
}
}
throw new IllegalStateException("name not found: " + name);
} | java | public static Token findFirst(final String name, final List<Token> tokens, final int index)
{
for (int i = index, size = tokens.size(); i < size; i++)
{
final Token token = tokens.get(i);
if (token.name().equals(name))
{
return token;
}
}
throw new IllegalStateException("name not found: " + name);
} | [
"public",
"static",
"Token",
"findFirst",
"(",
"final",
"String",
"name",
",",
"final",
"List",
"<",
"Token",
">",
"tokens",
",",
"final",
"int",
"index",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"index",
",",
"size",
"=",
"tokens",
".",
"size",
"(",
... | Find the first token with a given name from an index inclusive.
@param name to search for.
@param tokens to search.
@param index from which to search.
@return first found {@link Token} or throw a {@link IllegalStateException} if not found. | [
"Find",
"the",
"first",
"token",
"with",
"a",
"given",
"name",
"from",
"an",
"index",
"inclusive",
"."
] | train | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/Generators.java#L91-L103 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java | MultiLayerNetwork.setParam | @Override
public void setParam(String key, INDArray val) {
//Set params for MultiLayerNetwork sub layers.
int idx = key.indexOf('_');
if (idx == -1)
throw new IllegalStateException("Invalid param key: not have layer separator: \"" + key + "\"");
int layerIdx = Integer.parseInt(key.substring(0, idx));
String newKey = key.substring(idx + 1);
layers[layerIdx].setParam(newKey, val);
} | java | @Override
public void setParam(String key, INDArray val) {
//Set params for MultiLayerNetwork sub layers.
int idx = key.indexOf('_');
if (idx == -1)
throw new IllegalStateException("Invalid param key: not have layer separator: \"" + key + "\"");
int layerIdx = Integer.parseInt(key.substring(0, idx));
String newKey = key.substring(idx + 1);
layers[layerIdx].setParam(newKey, val);
} | [
"@",
"Override",
"public",
"void",
"setParam",
"(",
"String",
"key",
",",
"INDArray",
"val",
")",
"{",
"//Set params for MultiLayerNetwork sub layers.",
"int",
"idx",
"=",
"key",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"idx",
"==",
"-",
"1",
... | Set the values of a single parameter. See {@link #setParamTable(Map)} and {@link #getParam(String)} for more
details.
@param key the key of the parameter to set
@param val the new values for the parameter | [
"Set",
"the",
"values",
"of",
"a",
"single",
"parameter",
".",
"See",
"{"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java#L567-L577 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Sheet.java | Sheet.swapRows | public void swapRows(Object rowKeyA, Object rowKeyB) {
checkFrozen();
final int rowIndexA = this.getRowIndex(rowKeyA);
final int rowIndexB = this.getRowIndex(rowKeyB);
final List<R> tmp = new ArrayList<>(rowLength());
tmp.addAll(_rowKeySet);
final R tmpRowKeyA = tmp.get(rowIndexA);
tmp.set(rowIndexA, tmp.get(rowIndexB));
tmp.set(rowIndexB, tmpRowKeyA);
_rowKeySet.clear();
_rowKeySet.addAll(tmp);
_rowKeyIndexMap.forcePut(tmp.get(rowIndexA), rowIndexA);
_rowKeyIndexMap.forcePut(tmp.get(rowIndexB), rowIndexB);
if (_initialized && _columnList.size() > 0) {
E tmpVal = null;
for (List<E> column : _columnList) {
tmpVal = column.get(rowIndexA);
column.set(rowIndexA, column.get(rowIndexB));
column.set(rowIndexB, tmpVal);
}
}
} | java | public void swapRows(Object rowKeyA, Object rowKeyB) {
checkFrozen();
final int rowIndexA = this.getRowIndex(rowKeyA);
final int rowIndexB = this.getRowIndex(rowKeyB);
final List<R> tmp = new ArrayList<>(rowLength());
tmp.addAll(_rowKeySet);
final R tmpRowKeyA = tmp.get(rowIndexA);
tmp.set(rowIndexA, tmp.get(rowIndexB));
tmp.set(rowIndexB, tmpRowKeyA);
_rowKeySet.clear();
_rowKeySet.addAll(tmp);
_rowKeyIndexMap.forcePut(tmp.get(rowIndexA), rowIndexA);
_rowKeyIndexMap.forcePut(tmp.get(rowIndexB), rowIndexB);
if (_initialized && _columnList.size() > 0) {
E tmpVal = null;
for (List<E> column : _columnList) {
tmpVal = column.get(rowIndexA);
column.set(rowIndexA, column.get(rowIndexB));
column.set(rowIndexB, tmpVal);
}
}
} | [
"public",
"void",
"swapRows",
"(",
"Object",
"rowKeyA",
",",
"Object",
"rowKeyB",
")",
"{",
"checkFrozen",
"(",
")",
";",
"final",
"int",
"rowIndexA",
"=",
"this",
".",
"getRowIndex",
"(",
"rowKeyA",
")",
";",
"final",
"int",
"rowIndexB",
"=",
"this",
".... | Swap the positions of the two specified rows.
@param rowKeyA
@param rowKeyB | [
"Swap",
"the",
"positions",
"of",
"the",
"two",
"specified",
"rows",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Sheet.java#L582-L609 |
twilio/twilio-java | src/main/java/com/twilio/rest/monitor/v1/AlertReader.java | AlertReader.nextPage | @Override
public Page<Alert> nextPage(final Page<Alert> page,
final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
page.getNextPageUrl(
Domains.MONITOR.toString(),
client.getRegion()
)
);
return pageForRequest(client, request);
} | java | @Override
public Page<Alert> nextPage(final Page<Alert> page,
final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
page.getNextPageUrl(
Domains.MONITOR.toString(),
client.getRegion()
)
);
return pageForRequest(client, request);
} | [
"@",
"Override",
"public",
"Page",
"<",
"Alert",
">",
"nextPage",
"(",
"final",
"Page",
"<",
"Alert",
">",
"page",
",",
"final",
"TwilioRestClient",
"client",
")",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"HttpMethod",
".",
"GET",
",",
"pag... | Retrieve the next page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Next Page | [
"Retrieve",
"the",
"next",
"page",
"from",
"the",
"Twilio",
"API",
"."
] | train | https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/rest/monitor/v1/AlertReader.java#L127-L138 |
UrielCh/ovh-java-sdk | ovh-java-sdk-caasregistry/src/main/java/net/minidev/ovh/api/ApiOvhCaasregistry.java | ApiOvhCaasregistry.serviceName_namespaces_namespaceId_images_imageId_permissions_permissionId_DELETE | public void serviceName_namespaces_namespaceId_images_imageId_permissions_permissionId_DELETE(String serviceName, String namespaceId, String imageId, String permissionId) throws IOException {
String qPath = "/caas/registry/{serviceName}/namespaces/{namespaceId}/images/{imageId}/permissions/{permissionId}";
StringBuilder sb = path(qPath, serviceName, namespaceId, imageId, permissionId);
exec(qPath, "DELETE", sb.toString(), null);
} | java | public void serviceName_namespaces_namespaceId_images_imageId_permissions_permissionId_DELETE(String serviceName, String namespaceId, String imageId, String permissionId) throws IOException {
String qPath = "/caas/registry/{serviceName}/namespaces/{namespaceId}/images/{imageId}/permissions/{permissionId}";
StringBuilder sb = path(qPath, serviceName, namespaceId, imageId, permissionId);
exec(qPath, "DELETE", sb.toString(), null);
} | [
"public",
"void",
"serviceName_namespaces_namespaceId_images_imageId_permissions_permissionId_DELETE",
"(",
"String",
"serviceName",
",",
"String",
"namespaceId",
",",
"String",
"imageId",
",",
"String",
"permissionId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
... | Delete image permissions.
REST: DELETE /caas/registry/{serviceName}/namespaces/{namespaceId}/images/{imageId}/permissions/{permissionId}
@param imageId [required] Image id
@param namespaceId [required] Namespace id
@param permissionId [required] Permission id
@param serviceName [required] Service name
API beta | [
"Delete",
"image",
"permissions",
"."
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-caasregistry/src/main/java/net/minidev/ovh/api/ApiOvhCaasregistry.java#L304-L308 |
davidmarquis/fluent-interface-proxy | src/main/java/com/fluentinterface/beans/ObjectWrapper.java | ObjectWrapper.setSimpleValue | private static void setSimpleValue(Object obj, Property property, Object value) {
if (property == null) {
throw new IllegalArgumentException("Cannot set a new value to a property with a 'null' propertyName.");
}
property.set(obj, value);
} | java | private static void setSimpleValue(Object obj, Property property, Object value) {
if (property == null) {
throw new IllegalArgumentException("Cannot set a new value to a property with a 'null' propertyName.");
}
property.set(obj, value);
} | [
"private",
"static",
"void",
"setSimpleValue",
"(",
"Object",
"obj",
",",
"Property",
"property",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"property",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot set a new value to a prope... | /*
Internal: Static version of {@link ObjectWrapper#setSimpleValue(Property, Object)}. | [
"/",
"*",
"Internal",
":",
"Static",
"version",
"of",
"{"
] | train | https://github.com/davidmarquis/fluent-interface-proxy/blob/8e72fff6cd1f496c76a01773269caead994fea65/src/main/java/com/fluentinterface/beans/ObjectWrapper.java#L735-L741 |
jbundle/jbundle | thin/base/util/util/src/main/java/org/jbundle/thin/base/util/Application.java | Application.showTheDocument | public boolean showTheDocument(String strURL, BaseAppletReference applet, int iOptions)
{
if (applet != null)
return applet.showTheDocument(this, strURL, iOptions);
return false; // Override this
} | java | public boolean showTheDocument(String strURL, BaseAppletReference applet, int iOptions)
{
if (applet != null)
return applet.showTheDocument(this, strURL, iOptions);
return false; // Override this
} | [
"public",
"boolean",
"showTheDocument",
"(",
"String",
"strURL",
",",
"BaseAppletReference",
"applet",
",",
"int",
"iOptions",
")",
"{",
"if",
"(",
"applet",
"!=",
"null",
")",
"return",
"applet",
".",
"showTheDocument",
"(",
"this",
",",
"strURL",
",",
"iOp... | Display this URL in a web browser.
Uses the applet or jnlp context.
@param strURL The local URL to display (not fully qualified).
@param iOptions ThinMenuConstants.HELP_WINDOW_CHANGE If help pane is already displayed, change to this content.
@param The applet (optional).
@return True if successfully displayed. | [
"Display",
"this",
"URL",
"in",
"a",
"web",
"browser",
".",
"Uses",
"the",
"applet",
"or",
"jnlp",
"context",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/util/util/src/main/java/org/jbundle/thin/base/util/Application.java#L703-L708 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/dsl/BeanPath.java | BeanPath.createCollection | @SuppressWarnings("unchecked")
protected <A, Q extends SimpleExpression<? super A>> CollectionPath<A, Q> createCollection(String property, Class<? super A> type, Class<? super Q> queryType, PathInits inits) {
return add(new CollectionPath<A, Q>(type, (Class) queryType, forProperty(property), inits));
} | java | @SuppressWarnings("unchecked")
protected <A, Q extends SimpleExpression<? super A>> CollectionPath<A, Q> createCollection(String property, Class<? super A> type, Class<? super Q> queryType, PathInits inits) {
return add(new CollectionPath<A, Q>(type, (Class) queryType, forProperty(property), inits));
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"<",
"A",
",",
"Q",
"extends",
"SimpleExpression",
"<",
"?",
"super",
"A",
">",
">",
"CollectionPath",
"<",
"A",
",",
"Q",
">",
"createCollection",
"(",
"String",
"property",
",",
"Class",
"<... | Create a new Collection typed path
@param <A>
@param property property name
@param type property type
@return property path | [
"Create",
"a",
"new",
"Collection",
"typed",
"path"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/BeanPath.java#L149-L152 |
knowm/XChange | xchange-coinbase/src/main/java/org/knowm/xchange/coinbase/service/CoinbaseMarketDataServiceRaw.java | CoinbaseMarketDataServiceRaw.getCoinbaseSellPrice | public CoinbasePrice getCoinbaseSellPrice(BigDecimal quantity, String currency)
throws IOException {
return coinbase.getSellPrice(quantity, currency);
} | java | public CoinbasePrice getCoinbaseSellPrice(BigDecimal quantity, String currency)
throws IOException {
return coinbase.getSellPrice(quantity, currency);
} | [
"public",
"CoinbasePrice",
"getCoinbaseSellPrice",
"(",
"BigDecimal",
"quantity",
",",
"String",
"currency",
")",
"throws",
"IOException",
"{",
"return",
"coinbase",
".",
"getSellPrice",
"(",
"quantity",
",",
"currency",
")",
";",
"}"
] | Unauthenticated resource that tells you the total amount you can get if you sell some quantity
Bitcoin.
@param quantity The quantity of Bitcoin you would like to sell (default is 1 if null).
@param currency Default is USD. Right now this is the only value allowed.
@return The price in the desired {@code currency} to sell the given {@code quantity} BTC.
@throws IOException
@see <a
href="https://coinbase.com/api/doc/1.0/prices/sell.html">coinbase.com/api/doc/1.0/prices/sell.html</a> | [
"Unauthenticated",
"resource",
"that",
"tells",
"you",
"the",
"total",
"amount",
"you",
"can",
"get",
"if",
"you",
"sell",
"some",
"quantity",
"Bitcoin",
"."
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-coinbase/src/main/java/org/knowm/xchange/coinbase/service/CoinbaseMarketDataServiceRaw.java#L122-L126 |
alkacon/opencms-core | src/org/opencms/ade/configuration/CmsADEManager.java | CmsADEManager.getInheritedContainerState | public CmsInheritedContainerState getInheritedContainerState(CmsObject cms, String rootPath, String name)
throws CmsException {
String oldSiteRoot = cms.getRequestContext().getSiteRoot();
try {
cms.getRequestContext().setSiteRoot("");
CmsResource resource = cms.readResource(rootPath);
return getInheritedContainerState(cms, resource, name);
} finally {
cms.getRequestContext().setSiteRoot(oldSiteRoot);
}
} | java | public CmsInheritedContainerState getInheritedContainerState(CmsObject cms, String rootPath, String name)
throws CmsException {
String oldSiteRoot = cms.getRequestContext().getSiteRoot();
try {
cms.getRequestContext().setSiteRoot("");
CmsResource resource = cms.readResource(rootPath);
return getInheritedContainerState(cms, resource, name);
} finally {
cms.getRequestContext().setSiteRoot(oldSiteRoot);
}
} | [
"public",
"CmsInheritedContainerState",
"getInheritedContainerState",
"(",
"CmsObject",
"cms",
",",
"String",
"rootPath",
",",
"String",
"name",
")",
"throws",
"CmsException",
"{",
"String",
"oldSiteRoot",
"=",
"cms",
".",
"getRequestContext",
"(",
")",
".",
"getSit... | Returns the inheritance state for the given inheritance name and root path.<p>
@param cms the current cms context
@param rootPath the root path
@param name the inheritance name
@return the inheritance state
@throws CmsException if something goes wrong | [
"Returns",
"the",
"inheritance",
"state",
"for",
"the",
"given",
"inheritance",
"name",
"and",
"root",
"path",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsADEManager.java#L688-L699 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java | CommonOps_DDRM.extractDiag | public static void extractDiag(DMatrixRMaj src, DMatrixRMaj dst )
{
int N = Math.min(src.numRows, src.numCols);
if( !MatrixFeatures_DDRM.isVector(dst) || dst.numCols*dst.numCols != N ) {
dst.reshape(N,1);
}
for( int i = 0; i < N; i++ ) {
dst.set( i , src.unsafe_get(i,i) );
}
} | java | public static void extractDiag(DMatrixRMaj src, DMatrixRMaj dst )
{
int N = Math.min(src.numRows, src.numCols);
if( !MatrixFeatures_DDRM.isVector(dst) || dst.numCols*dst.numCols != N ) {
dst.reshape(N,1);
}
for( int i = 0; i < N; i++ ) {
dst.set( i , src.unsafe_get(i,i) );
}
} | [
"public",
"static",
"void",
"extractDiag",
"(",
"DMatrixRMaj",
"src",
",",
"DMatrixRMaj",
"dst",
")",
"{",
"int",
"N",
"=",
"Math",
".",
"min",
"(",
"src",
".",
"numRows",
",",
"src",
".",
"numCols",
")",
";",
"if",
"(",
"!",
"MatrixFeatures_DDRM",
"."... | <p>
Extracts the diagonal elements 'src' write it to the 'dst' vector. 'dst'
can either be a row or column vector.
<p>
@param src Matrix whose diagonal elements are being extracted. Not modified.
@param dst A vector the results will be written into. Modified. | [
"<p",
">",
"Extracts",
"the",
"diagonal",
"elements",
"src",
"write",
"it",
"to",
"the",
"dst",
"vector",
".",
"dst",
"can",
"either",
"be",
"a",
"row",
"or",
"column",
"vector",
".",
"<p",
">"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java#L1310-L1321 |
gallandarakhneorg/afc | advanced/attributes/src/main/java/org/arakhne/afc/attrs/attr/AttributeImpl.java | AttributeImpl.compareAttrNames | @Pure
public static int compareAttrNames(String arg0, String arg1) {
if (arg0 == arg1) {
return 0;
}
if (arg0 == null) {
return Integer.MAX_VALUE;
}
if (arg1 == null) {
return Integer.MIN_VALUE;
}
return arg0.compareToIgnoreCase(arg1);
} | java | @Pure
public static int compareAttrNames(String arg0, String arg1) {
if (arg0 == arg1) {
return 0;
}
if (arg0 == null) {
return Integer.MAX_VALUE;
}
if (arg1 == null) {
return Integer.MIN_VALUE;
}
return arg0.compareToIgnoreCase(arg1);
} | [
"@",
"Pure",
"public",
"static",
"int",
"compareAttrNames",
"(",
"String",
"arg0",
",",
"String",
"arg1",
")",
"{",
"if",
"(",
"arg0",
"==",
"arg1",
")",
"{",
"return",
"0",
";",
"}",
"if",
"(",
"arg0",
"==",
"null",
")",
"{",
"return",
"Integer",
... | Compare the two specified attribute names.
@param arg0 first attribute.
@param arg1 second attribute.
@return replies a negative value if {@code arg0} is lesser than
{@code arg1}, a positive value if {@code arg0} is greater than
{@code arg1}, or <code>0</code> if they are equal.
@see AttributeNameComparator | [
"Compare",
"the",
"two",
"specified",
"attribute",
"names",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/attributes/src/main/java/org/arakhne/afc/attrs/attr/AttributeImpl.java#L376-L388 |
deeplearning4j/deeplearning4j | nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/src/main/java/org/nd4j/parameterserver/distributed/transport/BaseTransport.java | BaseTransport.internalMessageHandler | protected void internalMessageHandler(DirectBuffer buffer, int offset, int length, Header header) {
/**
* All incoming internal messages are either op commands, or aggregation messages that are tied to commands
*/
byte[] data = new byte[length];
buffer.getBytes(offset, data);
VoidMessage message = VoidMessage.fromBytes(data);
messages.add(message);
// log.info("internalMessageHandler message request incoming: {}", message.getClass().getSimpleName());
} | java | protected void internalMessageHandler(DirectBuffer buffer, int offset, int length, Header header) {
/**
* All incoming internal messages are either op commands, or aggregation messages that are tied to commands
*/
byte[] data = new byte[length];
buffer.getBytes(offset, data);
VoidMessage message = VoidMessage.fromBytes(data);
messages.add(message);
// log.info("internalMessageHandler message request incoming: {}", message.getClass().getSimpleName());
} | [
"protected",
"void",
"internalMessageHandler",
"(",
"DirectBuffer",
"buffer",
",",
"int",
"offset",
",",
"int",
"length",
",",
"Header",
"header",
")",
"{",
"/**\n * All incoming internal messages are either op commands, or aggregation messages that are tied to commands\n ... | This message handler is responsible for receiving coordination messages on Shard side
@param buffer
@param offset
@param length
@param header | [
"This",
"message",
"handler",
"is",
"responsible",
"for",
"receiving",
"coordination",
"messages",
"on",
"Shard",
"side"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/src/main/java/org/nd4j/parameterserver/distributed/transport/BaseTransport.java#L248-L260 |
jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Footer.java | ID3v2Footer.checkFooter | private boolean checkFooter(RandomAccessInputStream raf, int location) throws IOException
{
raf.seek(location);
byte[] buf = new byte[FOOT_SIZE];
if (raf.read(buf) != FOOT_SIZE)
{
throw new IOException("Error encountered finding id3v2 footer");
}
String result = new String(buf, ENC_TYPE);
if (result.substring(0, TAG_START.length()).equals(TAG_START))
{
if ((((int)buf[3]&0xFF) != 0xff) && (((int)buf[4]&0xFF) != 0xff))
{
if (((int)buf[6]&0x80)==0 && ((int)buf[7]&0x80)==0 && ((int)buf[8]&0x80)==0 && ((int)buf[9]&0x80)==0)
{
return true;
}
}
}
return false;
} | java | private boolean checkFooter(RandomAccessInputStream raf, int location) throws IOException
{
raf.seek(location);
byte[] buf = new byte[FOOT_SIZE];
if (raf.read(buf) != FOOT_SIZE)
{
throw new IOException("Error encountered finding id3v2 footer");
}
String result = new String(buf, ENC_TYPE);
if (result.substring(0, TAG_START.length()).equals(TAG_START))
{
if ((((int)buf[3]&0xFF) != 0xff) && (((int)buf[4]&0xFF) != 0xff))
{
if (((int)buf[6]&0x80)==0 && ((int)buf[7]&0x80)==0 && ((int)buf[8]&0x80)==0 && ((int)buf[9]&0x80)==0)
{
return true;
}
}
}
return false;
} | [
"private",
"boolean",
"checkFooter",
"(",
"RandomAccessInputStream",
"raf",
",",
"int",
"location",
")",
"throws",
"IOException",
"{",
"raf",
".",
"seek",
"(",
"location",
")",
";",
"byte",
"[",
"]",
"buf",
"=",
"new",
"byte",
"[",
"FOOT_SIZE",
"]",
";",
... | Checks to see if there is an id3v2 footer in the file provided to the
constructor.
@param location where the footer should be located in the file
@return true if an id3v2 footer exists in the file
@exception FileNotFoundException if an error occurs
@exception IOException if an error occurs | [
"Checks",
"to",
"see",
"if",
"there",
"is",
"an",
"id3v2",
"footer",
"in",
"the",
"file",
"provided",
"to",
"the",
"constructor",
"."
] | train | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Footer.java#L81-L104 |
chanjarster/weixin-java-tools | weixin-java-common/src/main/java/me/chanjar/weixin/common/util/crypto/WxCryptUtil.java | WxCryptUtil.generateXml | private String generateXml(String encrypt, String signature, String timestamp, String nonce) {
String format =
"<xml>\n"
+ "<Encrypt><![CDATA[%1$s]]></Encrypt>\n"
+ "<MsgSignature><![CDATA[%2$s]]></MsgSignature>\n"
+ "<TimeStamp>%3$s</TimeStamp>\n"
+ "<Nonce><![CDATA[%4$s]]></Nonce>\n"
+ "</xml>";
return String.format(format, encrypt, signature, timestamp, nonce);
} | java | private String generateXml(String encrypt, String signature, String timestamp, String nonce) {
String format =
"<xml>\n"
+ "<Encrypt><![CDATA[%1$s]]></Encrypt>\n"
+ "<MsgSignature><![CDATA[%2$s]]></MsgSignature>\n"
+ "<TimeStamp>%3$s</TimeStamp>\n"
+ "<Nonce><![CDATA[%4$s]]></Nonce>\n"
+ "</xml>";
return String.format(format, encrypt, signature, timestamp, nonce);
} | [
"private",
"String",
"generateXml",
"(",
"String",
"encrypt",
",",
"String",
"signature",
",",
"String",
"timestamp",
",",
"String",
"nonce",
")",
"{",
"String",
"format",
"=",
"\"<xml>\\n\"",
"+",
"\"<Encrypt><![CDATA[%1$s]]></Encrypt>\\n\"",
"+",
"\"<MsgSignature><!... | 生成xml消息
@param encrypt 加密后的消息密文
@param signature 安全签名
@param timestamp 时间戳
@param nonce 随机字符串
@return 生成的xml字符串 | [
"生成xml消息"
] | train | https://github.com/chanjarster/weixin-java-tools/blob/2a0b1c30c0f60c2de466cb8933c945bc0d391edf/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/crypto/WxCryptUtil.java#L309-L318 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/core/model/Properties.java | Properties.set | public <T> void set(PropertyKey<T> property, T value) {
properties.put(property.getName(), value);
} | java | public <T> void set(PropertyKey<T> property, T value) {
properties.put(property.getName(), value);
} | [
"public",
"<",
"T",
">",
"void",
"set",
"(",
"PropertyKey",
"<",
"T",
">",
"property",
",",
"T",
"value",
")",
"{",
"properties",
".",
"put",
"(",
"property",
".",
"getName",
"(",
")",
",",
"value",
")",
";",
"}"
] | Associates the specified value with the specified property key. If the properties previously contained a mapping for the property key, the old
value is replaced by the specified value.
@param <T>
the type of the value
@param property
the property key with which the specified value is to be associated
@param value
the value to be associated with the specified property key | [
"Associates",
"the",
"specified",
"value",
"with",
"the",
"specified",
"property",
"key",
".",
"If",
"the",
"properties",
"previously",
"contained",
"a",
"mapping",
"for",
"the",
"property",
"key",
"the",
"old",
"value",
"is",
"replaced",
"by",
"the",
"specifi... | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/core/model/Properties.java#L112-L114 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WInternalLinkRenderer.java | WInternalLinkRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WInternalLink link = (WInternalLink) component;
XmlStringBuilder xml = renderContext.getWriter();
if (Util.empty(link.getText())) {
return;
}
xml.appendTagOpen("ui:link");
xml.appendAttribute("id", component.getId());
xml.appendOptionalAttribute("class", component.getHtmlClass());
xml.appendOptionalAttribute("track", component.isTracking(), "true");
xml.appendOptionalAttribute("toolTip", link.getToolTip());
xml.appendOptionalAttribute("accessibleText", link.getAccessibleText());
xml.appendUrlAttribute("url", "#" + link.getReference().getId());
xml.appendClose();
xml.appendEscaped(link.getText());
xml.appendEndTag("ui:link");
} | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WInternalLink link = (WInternalLink) component;
XmlStringBuilder xml = renderContext.getWriter();
if (Util.empty(link.getText())) {
return;
}
xml.appendTagOpen("ui:link");
xml.appendAttribute("id", component.getId());
xml.appendOptionalAttribute("class", component.getHtmlClass());
xml.appendOptionalAttribute("track", component.isTracking(), "true");
xml.appendOptionalAttribute("toolTip", link.getToolTip());
xml.appendOptionalAttribute("accessibleText", link.getAccessibleText());
xml.appendUrlAttribute("url", "#" + link.getReference().getId());
xml.appendClose();
xml.appendEscaped(link.getText());
xml.appendEndTag("ui:link");
} | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WInternalLink",
"link",
"=",
"(",
"WInternalLink",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
"rend... | Paints the given {@link WInternalLink}.
@param component the WInternalLink to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"{",
"@link",
"WInternalLink",
"}",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WInternalLinkRenderer.java#L23-L43 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/utility/ImageUtils.java | ImageUtils.saveBitmapAsPNG | public static boolean saveBitmapAsPNG(String filename, Bitmap bitmap) {
FileOutputStream outStream = null;
try {
outStream = new FileOutputStream(filename);
bitmap.compress(Bitmap.CompressFormat.PNG, 100, outStream);
} catch (Exception e) {
e.printStackTrace();
return false;
} finally {
try {
if (outStream != null) {
outStream.close();
}
} catch (IOException e) {
e.printStackTrace();
return false;
}
}
return true;
} | java | public static boolean saveBitmapAsPNG(String filename, Bitmap bitmap) {
FileOutputStream outStream = null;
try {
outStream = new FileOutputStream(filename);
bitmap.compress(Bitmap.CompressFormat.PNG, 100, outStream);
} catch (Exception e) {
e.printStackTrace();
return false;
} finally {
try {
if (outStream != null) {
outStream.close();
}
} catch (IOException e) {
e.printStackTrace();
return false;
}
}
return true;
} | [
"public",
"static",
"boolean",
"saveBitmapAsPNG",
"(",
"String",
"filename",
",",
"Bitmap",
"bitmap",
")",
"{",
"FileOutputStream",
"outStream",
"=",
"null",
";",
"try",
"{",
"outStream",
"=",
"new",
"FileOutputStream",
"(",
"filename",
")",
";",
"bitmap",
"."... | Saves a {@code Bitmap} as a PNG file.
@param filename The file path on the file system.
@param bitmap The input {@code Bitmap} object.
@return {@code true} if successful. | [
"Saves",
"a",
"{",
"@code",
"Bitmap",
"}",
"as",
"a",
"PNG",
"file",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/utility/ImageUtils.java#L72-L92 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java | SVGUtil.svgCircle | public static Element svgCircle(Document document, double cx, double cy, double r) {
Element circ = SVGUtil.svgElement(document, SVGConstants.SVG_CIRCLE_TAG);
SVGUtil.setAtt(circ, SVGConstants.SVG_CX_ATTRIBUTE, cx);
SVGUtil.setAtt(circ, SVGConstants.SVG_CY_ATTRIBUTE, cy);
SVGUtil.setAtt(circ, SVGConstants.SVG_R_ATTRIBUTE, r);
return circ;
} | java | public static Element svgCircle(Document document, double cx, double cy, double r) {
Element circ = SVGUtil.svgElement(document, SVGConstants.SVG_CIRCLE_TAG);
SVGUtil.setAtt(circ, SVGConstants.SVG_CX_ATTRIBUTE, cx);
SVGUtil.setAtt(circ, SVGConstants.SVG_CY_ATTRIBUTE, cy);
SVGUtil.setAtt(circ, SVGConstants.SVG_R_ATTRIBUTE, r);
return circ;
} | [
"public",
"static",
"Element",
"svgCircle",
"(",
"Document",
"document",
",",
"double",
"cx",
",",
"double",
"cy",
",",
"double",
"r",
")",
"{",
"Element",
"circ",
"=",
"SVGUtil",
".",
"svgElement",
"(",
"document",
",",
"SVGConstants",
".",
"SVG_CIRCLE_TAG"... | Create a SVG circle element.
@param document document to create in (factory)
@param cx center X
@param cy center Y
@param r radius
@return new element | [
"Create",
"a",
"SVG",
"circle",
"element",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java#L446-L452 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/tai/TAIWebUtils.java | TAIWebUtils.createStateCookie | public String createStateCookie(HttpServletRequest request, HttpServletResponse response) {
String stateValue = SocialUtil.generateRandom();
String loginHint = socialWebUtils.getLoginHint(request);
if (!request.getMethod().equalsIgnoreCase("GET") && loginHint != null) {
stateValue = stateValue + loginHint;
}
if (tc.isDebugEnabled()) {
Tr.debug(tc, "Setting cookie " + ClientConstants.COOKIE_NAME_STATE_KEY + " to " + stateValue);
}
Cookie stateCookie = referrerURLCookieHandler.createCookie(ClientConstants.COOKIE_NAME_STATE_KEY, stateValue, request);
response.addCookie(stateCookie);
return stateValue;
} | java | public String createStateCookie(HttpServletRequest request, HttpServletResponse response) {
String stateValue = SocialUtil.generateRandom();
String loginHint = socialWebUtils.getLoginHint(request);
if (!request.getMethod().equalsIgnoreCase("GET") && loginHint != null) {
stateValue = stateValue + loginHint;
}
if (tc.isDebugEnabled()) {
Tr.debug(tc, "Setting cookie " + ClientConstants.COOKIE_NAME_STATE_KEY + " to " + stateValue);
}
Cookie stateCookie = referrerURLCookieHandler.createCookie(ClientConstants.COOKIE_NAME_STATE_KEY, stateValue, request);
response.addCookie(stateCookie);
return stateValue;
} | [
"public",
"String",
"createStateCookie",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"{",
"String",
"stateValue",
"=",
"SocialUtil",
".",
"generateRandom",
"(",
")",
";",
"String",
"loginHint",
"=",
"socialWebUtils",
".",
"getL... | Generates a random state value, adds a cookie to the response with that value, and returns the value. | [
"Generates",
"a",
"random",
"state",
"value",
"adds",
"a",
"cookie",
"to",
"the",
"response",
"with",
"that",
"value",
"and",
"returns",
"the",
"value",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/tai/TAIWebUtils.java#L87-L99 |
alkacon/opencms-core | src/org/opencms/workplace/CmsDialog.java | CmsDialog.htmlStart | public String htmlStart(String helpUrl, String title) {
return pageHtml(HTML_START, helpUrl, title);
} | java | public String htmlStart(String helpUrl, String title) {
return pageHtml(HTML_START, helpUrl, title);
} | [
"public",
"String",
"htmlStart",
"(",
"String",
"helpUrl",
",",
"String",
"title",
")",
"{",
"return",
"pageHtml",
"(",
"HTML_START",
",",
"helpUrl",
",",
"title",
")",
";",
"}"
] | Builds the start html of the page, including setting of DOCTYPE and
inserting a header with the content-type.<p>
@param helpUrl the key for the online help to include on the page
@param title the title for the page
@return the start html of the page | [
"Builds",
"the",
"start",
"html",
"of",
"the",
"page",
"including",
"setting",
"of",
"DOCTYPE",
"and",
"inserting",
"a",
"header",
"with",
"the",
"content",
"-",
"type",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsDialog.java#L1392-L1395 |
apache/groovy | subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java | NioGroovyMethods.leftShift | public static Path leftShift(Path self, Object text) throws IOException {
append(self, text);
return self;
} | java | public static Path leftShift(Path self, Object text) throws IOException {
append(self, text);
return self;
} | [
"public",
"static",
"Path",
"leftShift",
"(",
"Path",
"self",
",",
"Object",
"text",
")",
"throws",
"IOException",
"{",
"append",
"(",
"self",
",",
"text",
")",
";",
"return",
"self",
";",
"}"
] | Write the text to the Path.
@param self a Path
@param text the text to write to the Path
@return the original file
@throws java.io.IOException if an IOException occurs.
@since 2.3.0 | [
"Write",
"the",
"text",
"to",
"the",
"Path",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java#L492-L495 |
mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java | Tile.getBoundingBox | public static BoundingBox getBoundingBox(Tile upperLeft, Tile lowerRight) {
BoundingBox ul = upperLeft.getBoundingBox();
BoundingBox lr = lowerRight.getBoundingBox();
return ul.extendBoundingBox(lr);
} | java | public static BoundingBox getBoundingBox(Tile upperLeft, Tile lowerRight) {
BoundingBox ul = upperLeft.getBoundingBox();
BoundingBox lr = lowerRight.getBoundingBox();
return ul.extendBoundingBox(lr);
} | [
"public",
"static",
"BoundingBox",
"getBoundingBox",
"(",
"Tile",
"upperLeft",
",",
"Tile",
"lowerRight",
")",
"{",
"BoundingBox",
"ul",
"=",
"upperLeft",
".",
"getBoundingBox",
"(",
")",
";",
"BoundingBox",
"lr",
"=",
"lowerRight",
".",
"getBoundingBox",
"(",
... | Return the BoundingBox of a rectangle of tiles defined by upper left and lower right tile.
@param upperLeft tile in upper left corner.
@param lowerRight tile in lower right corner.
@return BoundingBox defined by the area around upperLeft and lowerRight Tile. | [
"Return",
"the",
"BoundingBox",
"of",
"a",
"rectangle",
"of",
"tiles",
"defined",
"by",
"upper",
"left",
"and",
"lower",
"right",
"tile",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java#L38-L42 |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java | JsonUtils.getNode | public static Node getNode(Object root, String path) {
return getNode(root, Path.create(path));
} | java | public static Node getNode(Object root, String path) {
return getNode(root, Path.create(path));
} | [
"public",
"static",
"Node",
"getNode",
"(",
"Object",
"root",
",",
"String",
"path",
")",
"{",
"return",
"getNode",
"(",
"root",
",",
"Path",
".",
"create",
"(",
"path",
")",
")",
";",
"}"
] | Returns node with given path.
@param root
@param path
@return | [
"Returns",
"node",
"with",
"given",
"path",
"."
] | train | https://github.com/lukas-krecan/JsonUnit/blob/2b12ed792e8dd787bddd6f3b8eb2325737435791/json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java#L81-L83 |
Crab2died/Excel4J | src/main/java/com/github/crab2died/ExcelUtils.java | ExcelUtils.exportObjects2CSV | public void exportObjects2CSV(List<?> data, Class clazz, boolean isWriteHeader, OutputStream os)
throws Excel4JException {
try {
Writer writer = new OutputStreamWriter(os);
exportCSVByMapHandler(data, clazz, isWriteHeader, writer);
} catch (Excel4JException | IOException e) {
throw new Excel4JException(e);
}
} | java | public void exportObjects2CSV(List<?> data, Class clazz, boolean isWriteHeader, OutputStream os)
throws Excel4JException {
try {
Writer writer = new OutputStreamWriter(os);
exportCSVByMapHandler(data, clazz, isWriteHeader, writer);
} catch (Excel4JException | IOException e) {
throw new Excel4JException(e);
}
} | [
"public",
"void",
"exportObjects2CSV",
"(",
"List",
"<",
"?",
">",
"data",
",",
"Class",
"clazz",
",",
"boolean",
"isWriteHeader",
",",
"OutputStream",
"os",
")",
"throws",
"Excel4JException",
"{",
"try",
"{",
"Writer",
"writer",
"=",
"new",
"OutputStreamWrite... | 基于注解导出CSV文件流
@param data 待导出
@param clazz {@link com.github.crab2died.annotation.ExcelField}映射对象Class
@param isWriteHeader 是否写入文件
@param os 输出流
@throws Excel4JException exception | [
"基于注解导出CSV文件流"
] | train | https://github.com/Crab2died/Excel4J/blob/2ab0a3b8226a69ff868c3ead6e724f3a774f5f77/src/main/java/com/github/crab2died/ExcelUtils.java#L1660-L1669 |
hazelcast/hazelcast | hazelcast-client/src/main/java/com/hazelcast/client/spi/ProxyManager.java | ProxyManager.destroyProxyLocally | public void destroyProxyLocally(String service, String id) {
ObjectNamespace objectNamespace = new DistributedObjectNamespace(service, id);
ClientProxyFuture clientProxyFuture = proxies.remove(objectNamespace);
if (clientProxyFuture != null) {
ClientProxy clientProxy = clientProxyFuture.get();
clientProxy.destroyLocally();
}
} | java | public void destroyProxyLocally(String service, String id) {
ObjectNamespace objectNamespace = new DistributedObjectNamespace(service, id);
ClientProxyFuture clientProxyFuture = proxies.remove(objectNamespace);
if (clientProxyFuture != null) {
ClientProxy clientProxy = clientProxyFuture.get();
clientProxy.destroyLocally();
}
} | [
"public",
"void",
"destroyProxyLocally",
"(",
"String",
"service",
",",
"String",
"id",
")",
"{",
"ObjectNamespace",
"objectNamespace",
"=",
"new",
"DistributedObjectNamespace",
"(",
"service",
",",
"id",
")",
";",
"ClientProxyFuture",
"clientProxyFuture",
"=",
"pro... | Locally destroys the proxy identified by the given service and object ID.
<p>
Upon successful completion the proxy is unregistered in this proxy
manager and all local resources associated with the proxy are released.
@param service the service associated with the proxy.
@param id the ID of the object to destroy the proxy of. | [
"Locally",
"destroys",
"the",
"proxy",
"identified",
"by",
"the",
"given",
"service",
"and",
"object",
"ID",
".",
"<p",
">",
"Upon",
"successful",
"completion",
"the",
"proxy",
"is",
"unregistered",
"in",
"this",
"proxy",
"manager",
"and",
"all",
"local",
"r... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast-client/src/main/java/com/hazelcast/client/spi/ProxyManager.java#L375-L382 |
sculptor/sculptor | sculptor-examples/DDDSample/src/main/java/org/sculptor/dddsample/cargo/domain/RouteSpecification.java | RouteSpecification.forCargo | public static RouteSpecification forCargo(Cargo cargo, DateTime arrivalDeadline) {
Validate.notNull(cargo);
Validate.notNull(arrivalDeadline);
return new RouteSpecification(arrivalDeadline, cargo.getOrigin(), cargo.getDestination());
} | java | public static RouteSpecification forCargo(Cargo cargo, DateTime arrivalDeadline) {
Validate.notNull(cargo);
Validate.notNull(arrivalDeadline);
return new RouteSpecification(arrivalDeadline, cargo.getOrigin(), cargo.getDestination());
} | [
"public",
"static",
"RouteSpecification",
"forCargo",
"(",
"Cargo",
"cargo",
",",
"DateTime",
"arrivalDeadline",
")",
"{",
"Validate",
".",
"notNull",
"(",
"cargo",
")",
";",
"Validate",
".",
"notNull",
"(",
"arrivalDeadline",
")",
";",
"return",
"new",
"Route... | Factory for creatig a route specification for a cargo, from cargo
origin to cargo destination. Use for initial routing.
@param cargo cargo
@param arrivalDeadline arrival deadline
@return A route specification for this cargo and arrival deadline | [
"Factory",
"for",
"creatig",
"a",
"route",
"specification",
"for",
"a",
"cargo",
"from",
"cargo",
"origin",
"to",
"cargo",
"destination",
".",
"Use",
"for",
"initial",
"routing",
"."
] | train | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-examples/DDDSample/src/main/java/org/sculptor/dddsample/cargo/domain/RouteSpecification.java#L28-L33 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/ValidationInterceptor.java | ValidationInterceptor.registerMessageReceiver | protected ValidationListener registerMessageReceiver(String propertyName, Messagable messageReceiver) {
MessagableValidationListener messagableValidationListener = new MessagableValidationListener(propertyName,
messageReceiver);
validationResults.addValidationListener(propertyName, messagableValidationListener);
messagableValidationListener.validationResultsChanged(validationResults);
return messagableValidationListener;
} | java | protected ValidationListener registerMessageReceiver(String propertyName, Messagable messageReceiver) {
MessagableValidationListener messagableValidationListener = new MessagableValidationListener(propertyName,
messageReceiver);
validationResults.addValidationListener(propertyName, messagableValidationListener);
messagableValidationListener.validationResultsChanged(validationResults);
return messagableValidationListener;
} | [
"protected",
"ValidationListener",
"registerMessageReceiver",
"(",
"String",
"propertyName",
",",
"Messagable",
"messageReceiver",
")",
"{",
"MessagableValidationListener",
"messagableValidationListener",
"=",
"new",
"MessagableValidationListener",
"(",
"propertyName",
",",
"me... | Register a messageReceiver on a specific property. To keep things in
sync, it also triggers a first time check. (validationResultsModel can
already be populated)
@param propertyName property to listen for.
@param messageReceiver message capable component.
@return {@link ValidationListener} created during the process. | [
"Register",
"a",
"messageReceiver",
"on",
"a",
"specific",
"property",
".",
"To",
"keep",
"things",
"in",
"sync",
"it",
"also",
"triggers",
"a",
"first",
"time",
"check",
".",
"(",
"validationResultsModel",
"can",
"already",
"be",
"populated",
")"
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/ValidationInterceptor.java#L57-L63 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxTransactionalAPIConnection.java | BoxTransactionalAPIConnection.getTransactionConnection | public static BoxAPIConnection getTransactionConnection(String accessToken, String scope) {
return BoxTransactionalAPIConnection.getTransactionConnection(accessToken, scope, null);
} | java | public static BoxAPIConnection getTransactionConnection(String accessToken, String scope) {
return BoxTransactionalAPIConnection.getTransactionConnection(accessToken, scope, null);
} | [
"public",
"static",
"BoxAPIConnection",
"getTransactionConnection",
"(",
"String",
"accessToken",
",",
"String",
"scope",
")",
"{",
"return",
"BoxTransactionalAPIConnection",
".",
"getTransactionConnection",
"(",
"accessToken",
",",
"scope",
",",
"null",
")",
";",
"}"... | Request a scoped transactional token.
@param accessToken application access token.
@param scope scope of transactional token.
@return a BoxAPIConnection which can be used to perform transactional requests. | [
"Request",
"a",
"scoped",
"transactional",
"token",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTransactionalAPIConnection.java#L35-L37 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/io/AbstractMapWritable.java | AbstractMapWritable.addToMap | private synchronized void addToMap(Class clazz, byte id) {
if (classToIdMap.containsKey(clazz)) {
byte b = classToIdMap.get(clazz);
if (b != id) {
throw new IllegalArgumentException ("Class " + clazz.getName() +
" already registered but maps to " + b + " and not " + id);
}
}
if (idToClassMap.containsKey(id)) {
Class c = idToClassMap.get(id);
if (!c.equals(clazz)) {
throw new IllegalArgumentException("Id " + id + " exists but maps to " +
c.getName() + " and not " + clazz.getName());
}
}
classToIdMap.put(clazz, id);
idToClassMap.put(id, clazz);
} | java | private synchronized void addToMap(Class clazz, byte id) {
if (classToIdMap.containsKey(clazz)) {
byte b = classToIdMap.get(clazz);
if (b != id) {
throw new IllegalArgumentException ("Class " + clazz.getName() +
" already registered but maps to " + b + " and not " + id);
}
}
if (idToClassMap.containsKey(id)) {
Class c = idToClassMap.get(id);
if (!c.equals(clazz)) {
throw new IllegalArgumentException("Id " + id + " exists but maps to " +
c.getName() + " and not " + clazz.getName());
}
}
classToIdMap.put(clazz, id);
idToClassMap.put(id, clazz);
} | [
"private",
"synchronized",
"void",
"addToMap",
"(",
"Class",
"clazz",
",",
"byte",
"id",
")",
"{",
"if",
"(",
"classToIdMap",
".",
"containsKey",
"(",
"clazz",
")",
")",
"{",
"byte",
"b",
"=",
"classToIdMap",
".",
"get",
"(",
"clazz",
")",
";",
"if",
... | Used to add "predefined" classes and by Writable to copy "new" classes. | [
"Used",
"to",
"add",
"predefined",
"classes",
"and",
"by",
"Writable",
"to",
"copy",
"new",
"classes",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/AbstractMapWritable.java#L62-L79 |
sawano/java-commons | src/main/java/se/sawano/java/commons/lang/validate/AbstractValidate.java | AbstractValidate.isTrue | public void isTrue(final boolean expression, final String message, final long value) {
if (!expression) {
fail(String.format(message, value));
}
} | java | public void isTrue(final boolean expression, final String message, final long value) {
if (!expression) {
fail(String.format(message, value));
}
} | [
"public",
"void",
"isTrue",
"(",
"final",
"boolean",
"expression",
",",
"final",
"String",
"message",
",",
"final",
"long",
"value",
")",
"{",
"if",
"(",
"!",
"expression",
")",
"{",
"fail",
"(",
"String",
".",
"format",
"(",
"message",
",",
"value",
"... | <p>Validate that the argument condition is {@code true}; otherwise throwing an exception with the specified message. This method is useful when validating according to an arbitrary boolean
expression, such as validating a primitive number or using your own custom validation expression.</p>
<pre>Validate.isTrue(i > 0.0, "The value must be greater than zero: %d", i);</pre>
<p>For performance reasons, the long value is passed as a separate parameter and appended to the exception message only in the case of an error.</p>
@param expression
the boolean expression to check
@param message
the {@link String#format(String, Object...)} exception message if invalid, not null
@param value
the value to append to the message when invalid
@throws IllegalArgumentValidationException
if expression is {@code false}
@see #isTrue(boolean)
@see #isTrue(boolean, String, double)
@see #isTrue(boolean, String, Object...) | [
"<p",
">",
"Validate",
"that",
"the",
"argument",
"condition",
"is",
"{",
"@code",
"true",
"}",
";",
"otherwise",
"throwing",
"an",
"exception",
"with",
"the",
"specified",
"message",
".",
"This",
"method",
"is",
"useful",
"when",
"validating",
"according",
... | train | https://github.com/sawano/java-commons/blob/6f219c9e8dec4401dbe528d17ae6ec1ef9c0d284/src/main/java/se/sawano/java/commons/lang/validate/AbstractValidate.java#L298-L302 |
GeoLatte/geolatte-common | src/main/java/org/geolatte/common/expressions/Expressions.java | Expressions.notLike | public static NotLike notLike(Expression<String> left, String constant, boolean caseInsensitive) {
return new NotLike(left, constant(constant), caseInsensitive);
} | java | public static NotLike notLike(Expression<String> left, String constant, boolean caseInsensitive) {
return new NotLike(left, constant(constant), caseInsensitive);
} | [
"public",
"static",
"NotLike",
"notLike",
"(",
"Expression",
"<",
"String",
">",
"left",
",",
"String",
"constant",
",",
"boolean",
"caseInsensitive",
")",
"{",
"return",
"new",
"NotLike",
"(",
"left",
",",
"constant",
"(",
"constant",
")",
",",
"caseInsensi... | Creates a NotLike expression from the given expressions with % as the wildcard character
@param left The left expression.
@param constant The constant.
@param caseInsensitive Indicates whether comparison should be case insensitive.
@return A NotLike expression. | [
"Creates",
"a",
"NotLike",
"expression",
"from",
"the",
"given",
"expressions",
"with",
"%",
"as",
"the",
"wildcard",
"character"
] | train | https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/expressions/Expressions.java#L601-L603 |
alibaba/vlayout | vlayout/src/main/java/com/alibaba/android/vlayout/layout/OnePlusNLayoutHelperEx.java | OnePlusNLayoutHelperEx.onRangeChange | @Override
public void onRangeChange(int start, int end) {
if (end - start < 4) {
throw new IllegalArgumentException(
"pls use OnePlusNLayoutHelper instead of OnePlusNLayoutHelperEx which childcount <= 5");
}
if (end - start > 6) {
throw new IllegalArgumentException(
"OnePlusNLayoutHelper only supports maximum 7 children now");
}
} | java | @Override
public void onRangeChange(int start, int end) {
if (end - start < 4) {
throw new IllegalArgumentException(
"pls use OnePlusNLayoutHelper instead of OnePlusNLayoutHelperEx which childcount <= 5");
}
if (end - start > 6) {
throw new IllegalArgumentException(
"OnePlusNLayoutHelper only supports maximum 7 children now");
}
} | [
"@",
"Override",
"public",
"void",
"onRangeChange",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"if",
"(",
"end",
"-",
"start",
"<",
"4",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"pls use OnePlusNLayoutHelper instead of OnePlusNLayoutHelp... | {@inheritDoc}
<p/>
Currently, this layout supports maximum children up to 5, otherwise {@link
IllegalArgumentException}
will be thrown
@param start start position of items handled by this layoutHelper
@param end end position of items handled by this layoutHelper, if end < start or end -
start > 4, it will throw {@link IllegalArgumentException} | [
"{",
"@inheritDoc",
"}",
"<p",
"/",
">",
"Currently",
"this",
"layout",
"supports",
"maximum",
"children",
"up",
"to",
"5",
"otherwise",
"{",
"@link",
"IllegalArgumentException",
"}",
"will",
"be",
"thrown"
] | train | https://github.com/alibaba/vlayout/blob/8a5a51d9d2eeb91fed2ee331a4cf3496282452ce/vlayout/src/main/java/com/alibaba/android/vlayout/layout/OnePlusNLayoutHelperEx.java#L117-L127 |
signalapp/libsignal-service-java | java/src/main/java/org/whispersystems/signalservice/internal/util/Base64.java | Base64.decodeToObject | public static Object decodeToObject( String encodedObject )
throws java.io.IOException, java.lang.ClassNotFoundException {
return decodeToObject(encodedObject,NO_OPTIONS,null);
} | java | public static Object decodeToObject( String encodedObject )
throws java.io.IOException, java.lang.ClassNotFoundException {
return decodeToObject(encodedObject,NO_OPTIONS,null);
} | [
"public",
"static",
"Object",
"decodeToObject",
"(",
"String",
"encodedObject",
")",
"throws",
"java",
".",
"io",
".",
"IOException",
",",
"java",
".",
"lang",
".",
"ClassNotFoundException",
"{",
"return",
"decodeToObject",
"(",
"encodedObject",
",",
"NO_OPTIONS",... | Attempts to decode Base64 data and deserialize a Java
Object within. Returns <tt>null</tt> if there was an error.
@param encodedObject The Base64 data to decode
@return The decoded and deserialized object
@throws NullPointerException if encodedObject is null
@throws java.io.IOException if there is a general error
@throws ClassNotFoundException if the decoded object is of a
class that cannot be found by the JVM
@since 1.5 | [
"Attempts",
"to",
"decode",
"Base64",
"data",
"and",
"deserialize",
"a",
"Java",
"Object",
"within",
".",
"Returns",
"<tt",
">",
"null<",
"/",
"tt",
">",
"if",
"there",
"was",
"an",
"error",
"."
] | train | https://github.com/signalapp/libsignal-service-java/blob/64f1150c5e4062d67d31c9a2a9c3a0237d022902/java/src/main/java/org/whispersystems/signalservice/internal/util/Base64.java#L1345-L1348 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java | ComputerVisionImpl.describeImageWithServiceResponseAsync | public Observable<ServiceResponse<ImageDescription>> describeImageWithServiceResponseAsync(String url, DescribeImageOptionalParameter describeImageOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null.");
}
if (url == null) {
throw new IllegalArgumentException("Parameter url is required and cannot be null.");
}
final String maxCandidates = describeImageOptionalParameter != null ? describeImageOptionalParameter.maxCandidates() : null;
final String language = describeImageOptionalParameter != null ? describeImageOptionalParameter.language() : null;
return describeImageWithServiceResponseAsync(url, maxCandidates, language);
} | java | public Observable<ServiceResponse<ImageDescription>> describeImageWithServiceResponseAsync(String url, DescribeImageOptionalParameter describeImageOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null.");
}
if (url == null) {
throw new IllegalArgumentException("Parameter url is required and cannot be null.");
}
final String maxCandidates = describeImageOptionalParameter != null ? describeImageOptionalParameter.maxCandidates() : null;
final String language = describeImageOptionalParameter != null ? describeImageOptionalParameter.language() : null;
return describeImageWithServiceResponseAsync(url, maxCandidates, language);
} | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"ImageDescription",
">",
">",
"describeImageWithServiceResponseAsync",
"(",
"String",
"url",
",",
"DescribeImageOptionalParameter",
"describeImageOptionalParameter",
")",
"{",
"if",
"(",
"this",
".",
"client",
".",
"e... | This operation generates a description of an image in human readable language with complete sentences. The description is based on a collection of content tags, which are also returned by the operation. More than one description can be generated for each image. Descriptions are ordered by their confidence score. All descriptions are in English. Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL.A successful response will be returned in JSON. If the request failed, the response will contain an error code and a message to help understand what went wrong.
@param url Publicly reachable URL of an image
@param describeImageOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ImageDescription object | [
"This",
"operation",
"generates",
"a",
"description",
"of",
"an",
"image",
"in",
"human",
"readable",
"language",
"with",
"complete",
"sentences",
".",
"The",
"description",
"is",
"based",
"on",
"a",
"collection",
"of",
"content",
"tags",
"which",
"are",
"also... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java#L1779-L1790 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WFieldLayout.java | WFieldLayout.addField | public WField addField(final WLabel label, final WComponent field) {
WField wField = new WField(label, field);
add(wField);
return wField;
} | java | public WField addField(final WLabel label, final WComponent field) {
WField wField = new WField(label, field);
add(wField);
return wField;
} | [
"public",
"WField",
"addField",
"(",
"final",
"WLabel",
"label",
",",
"final",
"WComponent",
"field",
")",
"{",
"WField",
"wField",
"=",
"new",
"WField",
"(",
"label",
",",
"field",
")",
";",
"add",
"(",
"wField",
")",
";",
"return",
"wField",
";",
"}"... | Add a field using the label and components passed in.
@param label the label to use for the field
@param field the component to use for the field
@return the field which was added to the layout. | [
"Add",
"a",
"field",
"using",
"the",
"label",
"and",
"components",
"passed",
"in",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WFieldLayout.java#L196-L201 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Session.java | Session.openActiveSession | public static Session openActiveSession(Context context, Fragment fragment,
boolean allowLoginUI, StatusCallback callback) {
return openActiveSession(context, allowLoginUI, new OpenRequest(fragment).setCallback(callback));
} | java | public static Session openActiveSession(Context context, Fragment fragment,
boolean allowLoginUI, StatusCallback callback) {
return openActiveSession(context, allowLoginUI, new OpenRequest(fragment).setCallback(callback));
} | [
"public",
"static",
"Session",
"openActiveSession",
"(",
"Context",
"context",
",",
"Fragment",
"fragment",
",",
"boolean",
"allowLoginUI",
",",
"StatusCallback",
"callback",
")",
"{",
"return",
"openActiveSession",
"(",
"context",
",",
"allowLoginUI",
",",
"new",
... | If allowLoginUI is true, this will create a new Session, make it active, and
open it. If the default token cache is not available, then this will request
basic permissions. If the default token cache is available and cached tokens
are loaded, this will use the cached token and associated permissions.
<p/>
If allowedLoginUI is false, this will only create the active session and open
it if it requires no user interaction (i.e. the token cache is available and
there are cached tokens).
@param context The Activity or Service creating this Session
@param fragment The Fragment that is opening the new Session.
@param allowLoginUI if false, only sets the active session and opens it if it
does not require user interaction
@param callback The {@link StatusCallback SessionStatusCallback} to
notify regarding Session state changes.
@return The new Session or null if one could not be created | [
"If",
"allowLoginUI",
"is",
"true",
"this",
"will",
"create",
"a",
"new",
"Session",
"make",
"it",
"active",
"and",
"open",
"it",
".",
"If",
"the",
"default",
"token",
"cache",
"is",
"not",
"available",
"then",
"this",
"will",
"request",
"basic",
"permissi... | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Session.java#L1065-L1068 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.readBestUrlName | public String readBestUrlName(CmsRequestContext context, CmsUUID id, Locale locale, List<Locale> defaultLocales)
throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
try {
return m_driverManager.readBestUrlName(dbc, id, locale, defaultLocales);
} catch (Exception e) {
CmsMessageContainer message = Messages.get().container(
Messages.ERR_READ_NEWEST_URLNAME_FOR_ID_1,
id.toString());
dbc.report(null, message, e);
return null; // will never be reached
} finally {
dbc.clear();
}
} | java | public String readBestUrlName(CmsRequestContext context, CmsUUID id, Locale locale, List<Locale> defaultLocales)
throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
try {
return m_driverManager.readBestUrlName(dbc, id, locale, defaultLocales);
} catch (Exception e) {
CmsMessageContainer message = Messages.get().container(
Messages.ERR_READ_NEWEST_URLNAME_FOR_ID_1,
id.toString());
dbc.report(null, message, e);
return null; // will never be reached
} finally {
dbc.clear();
}
} | [
"public",
"String",
"readBestUrlName",
"(",
"CmsRequestContext",
"context",
",",
"CmsUUID",
"id",
",",
"Locale",
"locale",
",",
"List",
"<",
"Locale",
">",
"defaultLocales",
")",
"throws",
"CmsException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",... | Reads the newest URL name which is mapped to the given structure id.<p>
If the structure id is not mapped to any name, null will be returned.<p>
@param context the request context
@param id the structure id for which the newest mapped name should be returned
@param locale the locale for the mapping
@param defaultLocales the default locales to use if there is no URL name mapping for the requested locale
@return an URL name or null
@throws CmsException if something goes wrong | [
"Reads",
"the",
"newest",
"URL",
"name",
"which",
"is",
"mapped",
"to",
"the",
"given",
"structure",
"id",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L4095-L4110 |
logic-ng/LogicNG | src/main/java/org/logicng/io/readers/FormulaReader.java | FormulaReader.readPropositionalFormula | public static Formula readPropositionalFormula(final File file, final FormulaFactory f) throws IOException, ParserException {
return read(file, new PropositionalParser(f));
} | java | public static Formula readPropositionalFormula(final File file, final FormulaFactory f) throws IOException, ParserException {
return read(file, new PropositionalParser(f));
} | [
"public",
"static",
"Formula",
"readPropositionalFormula",
"(",
"final",
"File",
"file",
",",
"final",
"FormulaFactory",
"f",
")",
"throws",
"IOException",
",",
"ParserException",
"{",
"return",
"read",
"(",
"file",
",",
"new",
"PropositionalParser",
"(",
"f",
"... | Reads a given file and returns the contained propositional formula.
@param file the file
@param f the formula factory
@return the parsed formula
@throws IOException if there was a problem reading the file
@throws ParserException if there was a problem parsing the formula | [
"Reads",
"a",
"given",
"file",
"and",
"returns",
"the",
"contained",
"propositional",
"formula",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/io/readers/FormulaReader.java#L80-L82 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF6.java | CommonOps_DDF6.multAddOuter | public static void multAddOuter( double alpha , DMatrix6x6 A , double beta , DMatrix6 u , DMatrix6 v , DMatrix6x6 C ) {
C.a11 = alpha*A.a11 + beta*u.a1*v.a1;
C.a12 = alpha*A.a12 + beta*u.a1*v.a2;
C.a13 = alpha*A.a13 + beta*u.a1*v.a3;
C.a14 = alpha*A.a14 + beta*u.a1*v.a4;
C.a15 = alpha*A.a15 + beta*u.a1*v.a5;
C.a16 = alpha*A.a16 + beta*u.a1*v.a6;
C.a21 = alpha*A.a21 + beta*u.a2*v.a1;
C.a22 = alpha*A.a22 + beta*u.a2*v.a2;
C.a23 = alpha*A.a23 + beta*u.a2*v.a3;
C.a24 = alpha*A.a24 + beta*u.a2*v.a4;
C.a25 = alpha*A.a25 + beta*u.a2*v.a5;
C.a26 = alpha*A.a26 + beta*u.a2*v.a6;
C.a31 = alpha*A.a31 + beta*u.a3*v.a1;
C.a32 = alpha*A.a32 + beta*u.a3*v.a2;
C.a33 = alpha*A.a33 + beta*u.a3*v.a3;
C.a34 = alpha*A.a34 + beta*u.a3*v.a4;
C.a35 = alpha*A.a35 + beta*u.a3*v.a5;
C.a36 = alpha*A.a36 + beta*u.a3*v.a6;
C.a41 = alpha*A.a41 + beta*u.a4*v.a1;
C.a42 = alpha*A.a42 + beta*u.a4*v.a2;
C.a43 = alpha*A.a43 + beta*u.a4*v.a3;
C.a44 = alpha*A.a44 + beta*u.a4*v.a4;
C.a45 = alpha*A.a45 + beta*u.a4*v.a5;
C.a46 = alpha*A.a46 + beta*u.a4*v.a6;
C.a51 = alpha*A.a51 + beta*u.a5*v.a1;
C.a52 = alpha*A.a52 + beta*u.a5*v.a2;
C.a53 = alpha*A.a53 + beta*u.a5*v.a3;
C.a54 = alpha*A.a54 + beta*u.a5*v.a4;
C.a55 = alpha*A.a55 + beta*u.a5*v.a5;
C.a56 = alpha*A.a56 + beta*u.a5*v.a6;
C.a61 = alpha*A.a61 + beta*u.a6*v.a1;
C.a62 = alpha*A.a62 + beta*u.a6*v.a2;
C.a63 = alpha*A.a63 + beta*u.a6*v.a3;
C.a64 = alpha*A.a64 + beta*u.a6*v.a4;
C.a65 = alpha*A.a65 + beta*u.a6*v.a5;
C.a66 = alpha*A.a66 + beta*u.a6*v.a6;
} | java | public static void multAddOuter( double alpha , DMatrix6x6 A , double beta , DMatrix6 u , DMatrix6 v , DMatrix6x6 C ) {
C.a11 = alpha*A.a11 + beta*u.a1*v.a1;
C.a12 = alpha*A.a12 + beta*u.a1*v.a2;
C.a13 = alpha*A.a13 + beta*u.a1*v.a3;
C.a14 = alpha*A.a14 + beta*u.a1*v.a4;
C.a15 = alpha*A.a15 + beta*u.a1*v.a5;
C.a16 = alpha*A.a16 + beta*u.a1*v.a6;
C.a21 = alpha*A.a21 + beta*u.a2*v.a1;
C.a22 = alpha*A.a22 + beta*u.a2*v.a2;
C.a23 = alpha*A.a23 + beta*u.a2*v.a3;
C.a24 = alpha*A.a24 + beta*u.a2*v.a4;
C.a25 = alpha*A.a25 + beta*u.a2*v.a5;
C.a26 = alpha*A.a26 + beta*u.a2*v.a6;
C.a31 = alpha*A.a31 + beta*u.a3*v.a1;
C.a32 = alpha*A.a32 + beta*u.a3*v.a2;
C.a33 = alpha*A.a33 + beta*u.a3*v.a3;
C.a34 = alpha*A.a34 + beta*u.a3*v.a4;
C.a35 = alpha*A.a35 + beta*u.a3*v.a5;
C.a36 = alpha*A.a36 + beta*u.a3*v.a6;
C.a41 = alpha*A.a41 + beta*u.a4*v.a1;
C.a42 = alpha*A.a42 + beta*u.a4*v.a2;
C.a43 = alpha*A.a43 + beta*u.a4*v.a3;
C.a44 = alpha*A.a44 + beta*u.a4*v.a4;
C.a45 = alpha*A.a45 + beta*u.a4*v.a5;
C.a46 = alpha*A.a46 + beta*u.a4*v.a6;
C.a51 = alpha*A.a51 + beta*u.a5*v.a1;
C.a52 = alpha*A.a52 + beta*u.a5*v.a2;
C.a53 = alpha*A.a53 + beta*u.a5*v.a3;
C.a54 = alpha*A.a54 + beta*u.a5*v.a4;
C.a55 = alpha*A.a55 + beta*u.a5*v.a5;
C.a56 = alpha*A.a56 + beta*u.a5*v.a6;
C.a61 = alpha*A.a61 + beta*u.a6*v.a1;
C.a62 = alpha*A.a62 + beta*u.a6*v.a2;
C.a63 = alpha*A.a63 + beta*u.a6*v.a3;
C.a64 = alpha*A.a64 + beta*u.a6*v.a4;
C.a65 = alpha*A.a65 + beta*u.a6*v.a5;
C.a66 = alpha*A.a66 + beta*u.a6*v.a6;
} | [
"public",
"static",
"void",
"multAddOuter",
"(",
"double",
"alpha",
",",
"DMatrix6x6",
"A",
",",
"double",
"beta",
",",
"DMatrix6",
"u",
",",
"DMatrix6",
"v",
",",
"DMatrix6x6",
"C",
")",
"{",
"C",
".",
"a11",
"=",
"alpha",
"*",
"A",
".",
"a11",
"+",... | C = αA + βu*v<sup>T</sup>
@param alpha scale factor applied to A
@param A matrix
@param beta scale factor applies to outer product
@param u vector
@param v vector
@param C Storage for solution. Can be same instance as A. | [
"C",
"=",
"&alpha",
";",
"A",
"+",
"&beta",
";",
"u",
"*",
"v<sup",
">",
"T<",
"/",
"sup",
">"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF6.java#L1239-L1276 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Vector.java | Vector.set | public synchronized E set(int index, E element) {
if (index >= elementCount)
throw new ArrayIndexOutOfBoundsException(index);
E oldValue = elementData(index);
elementData[index] = element;
return oldValue;
} | java | public synchronized E set(int index, E element) {
if (index >= elementCount)
throw new ArrayIndexOutOfBoundsException(index);
E oldValue = elementData(index);
elementData[index] = element;
return oldValue;
} | [
"public",
"synchronized",
"E",
"set",
"(",
"int",
"index",
",",
"E",
"element",
")",
"{",
"if",
"(",
"index",
">=",
"elementCount",
")",
"throw",
"new",
"ArrayIndexOutOfBoundsException",
"(",
"index",
")",
";",
"E",
"oldValue",
"=",
"elementData",
"(",
"in... | Replaces the element at the specified position in this Vector with the
specified element.
@param index index of the element to replace
@param element element to be stored at the specified position
@return the element previously at the specified position
@throws ArrayIndexOutOfBoundsException if the index is out of range
({@code index < 0 || index >= size()})
@since 1.2 | [
"Replaces",
"the",
"element",
"at",
"the",
"specified",
"position",
"in",
"this",
"Vector",
"with",
"the",
"specified",
"element",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Vector.java#L764-L771 |
lestard/assertj-javafx | src/main/java/eu/lestard/assertj/javafx/api/DoublePropertyAssert.java | DoublePropertyAssert.hasValue | public DoublePropertyAssert hasValue(Double expectedValue, Offset offset){
new ObservableNumberValueAssertions(actual).hasValue(expectedValue, offset);
return this;
} | java | public DoublePropertyAssert hasValue(Double expectedValue, Offset offset){
new ObservableNumberValueAssertions(actual).hasValue(expectedValue, offset);
return this;
} | [
"public",
"DoublePropertyAssert",
"hasValue",
"(",
"Double",
"expectedValue",
",",
"Offset",
"offset",
")",
"{",
"new",
"ObservableNumberValueAssertions",
"(",
"actual",
")",
".",
"hasValue",
"(",
"expectedValue",
",",
"offset",
")",
";",
"return",
"this",
";",
... | Verifies that the actual observable number has a value that is close to the given one by less then the given offset.
@param expectedValue the given value to compare the actual observables value to.
@param offset the given positive offset.
@return {@code this} assertion object.
@throws java.lang.NullPointerException if the given offset is <code>null</code>.
@throws java.lang.AssertionError if the actual observables value is not equal to the expected one. | [
"Verifies",
"that",
"the",
"actual",
"observable",
"number",
"has",
"a",
"value",
"that",
"is",
"close",
"to",
"the",
"given",
"one",
"by",
"less",
"then",
"the",
"given",
"offset",
"."
] | train | https://github.com/lestard/assertj-javafx/blob/f6b4d22e542a5501c7c1c2fae8700b0f69b956c1/src/main/java/eu/lestard/assertj/javafx/api/DoublePropertyAssert.java#L47-L51 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/ext/ExtensionParam.java | ExtensionParam.setExtensionsState | void setExtensionsState(Map<String, Boolean> extensionsState) {
if (extensionsState == null) {
throw new IllegalArgumentException("Parameter extensionsState must not be null.");
}
((HierarchicalConfiguration) getConfig()).clearTree(ALL_EXTENSIONS_KEY);
int enabledCount = 0;
for (Iterator<Map.Entry<String, Boolean>> it = extensionsState.entrySet().iterator(); it.hasNext();) {
Map.Entry<String, Boolean> entry = it.next();
if (entry.getKey() == null || entry.getValue() == null) {
continue;
}
// Don't persist if enabled, extensions are enabled by default.
if (!entry.getValue()) {
String elementBaseKey = ALL_EXTENSIONS_KEY + "(" + enabledCount + ").";
getConfig().setProperty(elementBaseKey + EXTENSION_NAME_KEY, entry.getKey());
getConfig().setProperty(elementBaseKey + EXTENSION_ENABLED_KEY, Boolean.FALSE);
enabledCount++;
}
}
this.extensionsState = Collections.unmodifiableMap(extensionsState);
} | java | void setExtensionsState(Map<String, Boolean> extensionsState) {
if (extensionsState == null) {
throw new IllegalArgumentException("Parameter extensionsState must not be null.");
}
((HierarchicalConfiguration) getConfig()).clearTree(ALL_EXTENSIONS_KEY);
int enabledCount = 0;
for (Iterator<Map.Entry<String, Boolean>> it = extensionsState.entrySet().iterator(); it.hasNext();) {
Map.Entry<String, Boolean> entry = it.next();
if (entry.getKey() == null || entry.getValue() == null) {
continue;
}
// Don't persist if enabled, extensions are enabled by default.
if (!entry.getValue()) {
String elementBaseKey = ALL_EXTENSIONS_KEY + "(" + enabledCount + ").";
getConfig().setProperty(elementBaseKey + EXTENSION_NAME_KEY, entry.getKey());
getConfig().setProperty(elementBaseKey + EXTENSION_ENABLED_KEY, Boolean.FALSE);
enabledCount++;
}
}
this.extensionsState = Collections.unmodifiableMap(extensionsState);
} | [
"void",
"setExtensionsState",
"(",
"Map",
"<",
"String",
",",
"Boolean",
">",
"extensionsState",
")",
"{",
"if",
"(",
"extensionsState",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Parameter extensionsState must not be null.\"",
")",
... | Sets the extensions' state, to be saved in the configuration file.
@param extensionsState the extensions' state | [
"Sets",
"the",
"extensions",
"state",
"to",
"be",
"saved",
"in",
"the",
"configuration",
"file",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/ext/ExtensionParam.java#L121-L144 |
molgenis/molgenis | molgenis-data/src/main/java/org/molgenis/data/EntityFactoryRegistry.java | EntityFactoryRegistry.registerStaticEntityFactory | <E extends Entity> void registerStaticEntityFactory(EntityFactory<E, ?> staticEntityFactory) {
String entityTypeId = staticEntityFactory.getEntityTypeId();
staticEntityFactoryMap.put(entityTypeId, staticEntityFactory);
} | java | <E extends Entity> void registerStaticEntityFactory(EntityFactory<E, ?> staticEntityFactory) {
String entityTypeId = staticEntityFactory.getEntityTypeId();
staticEntityFactoryMap.put(entityTypeId, staticEntityFactory);
} | [
"<",
"E",
"extends",
"Entity",
">",
"void",
"registerStaticEntityFactory",
"(",
"EntityFactory",
"<",
"E",
",",
"?",
">",
"staticEntityFactory",
")",
"{",
"String",
"entityTypeId",
"=",
"staticEntityFactory",
".",
"getEntityTypeId",
"(",
")",
";",
"staticEntityFac... | Registers a static entity factory
@param staticEntityFactory static entity factory
@param <E> static entity type (e.g. Tag, Language, Package) | [
"Registers",
"a",
"static",
"entity",
"factory"
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-data/src/main/java/org/molgenis/data/EntityFactoryRegistry.java#L28-L31 |
versionone/VersionOne.SDK.Java.ObjectModel | src/main/java/com/versionone/om/Project.java | Project.createSubProject | public Project createSubProject(String name, DateTime beginDate) {
return createSubProject(name, beginDate, null);
} | java | public Project createSubProject(String name, DateTime beginDate) {
return createSubProject(name, beginDate, null);
} | [
"public",
"Project",
"createSubProject",
"(",
"String",
"name",
",",
"DateTime",
"beginDate",
")",
"{",
"return",
"createSubProject",
"(",
"name",
",",
"beginDate",
",",
"null",
")",
";",
"}"
] | Create a sub project under this project with a name and begin date.
@param name Name of the new project.
@param beginDate Date the schedule will begin.
@return The newly created project. | [
"Create",
"a",
"sub",
"project",
"under",
"this",
"project",
"with",
"a",
"name",
"and",
"begin",
"date",
"."
] | train | https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/Project.java#L173-L175 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.