repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
vatbub/common | internet/src/main/java/com/github/vatbub/common/internet/Internet.java | Internet.webread | @SuppressWarnings("UnusedReturnValue")
public static String webread(URL url) throws IOException {
StringBuilder result = new StringBuilder();
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
BufferedReader rd = new BufferedReader(new In... | java | @SuppressWarnings("UnusedReturnValue")
public static String webread(URL url) throws IOException {
StringBuilder result = new StringBuilder();
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
BufferedReader rd = new BufferedReader(new In... | [
"@",
"SuppressWarnings",
"(",
"\"UnusedReturnValue\"",
")",
"public",
"static",
"String",
"webread",
"(",
"URL",
"url",
")",
"throws",
"IOException",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"HttpURLConnection",
"conn",
"=",
"(... | Sends a GET request to url and retrieves the server response
@param url The url to call.
@return The server response
@throws IOException No Internet connection | [
"Sends",
"a",
"GET",
"request",
"to",
"url",
"and",
"retrieves",
"the",
"server",
"response"
] | 8b9fd2ece0a23d520ce53b66c84cbd094e378443 | https://github.com/vatbub/common/blob/8b9fd2ece0a23d520ce53b66c84cbd094e378443/internet/src/main/java/com/github/vatbub/common/internet/Internet.java#L179-L191 | train |
vatbub/common | internet/src/main/java/com/github/vatbub/common/internet/Internet.java | Internet.openInDefaultBrowser | public static void openInDefaultBrowser(URL url) throws IOException {
Runtime rt = Runtime.getRuntime();
if (SystemUtils.IS_OS_WINDOWS) {
rt.exec("rundll32 url.dll,FileProtocolHandler " + url);
} else if (SystemUtils.IS_OS_MAC) {
rt.exec("open" + url);
} else {
... | java | public static void openInDefaultBrowser(URL url) throws IOException {
Runtime rt = Runtime.getRuntime();
if (SystemUtils.IS_OS_WINDOWS) {
rt.exec("rundll32 url.dll,FileProtocolHandler " + url);
} else if (SystemUtils.IS_OS_MAC) {
rt.exec("open" + url);
} else {
... | [
"public",
"static",
"void",
"openInDefaultBrowser",
"(",
"URL",
"url",
")",
"throws",
"IOException",
"{",
"Runtime",
"rt",
"=",
"Runtime",
".",
"getRuntime",
"(",
")",
";",
"if",
"(",
"SystemUtils",
".",
"IS_OS_WINDOWS",
")",
"{",
"rt",
".",
"exec",
"(",
... | OPens the specified url in the default browser.
@param url The url to open
@throws IOException If the URL cannot be opened | [
"OPens",
"the",
"specified",
"url",
"in",
"the",
"default",
"browser",
"."
] | 8b9fd2ece0a23d520ce53b66c84cbd094e378443 | https://github.com/vatbub/common/blob/8b9fd2ece0a23d520ce53b66c84cbd094e378443/internet/src/main/java/com/github/vatbub/common/internet/Internet.java#L440-L457 | train |
lastaflute/lasta-thymeleaf | src/main/java/org/lastaflute/thymeleaf/expression/HandyDateExpressionObject.java | HandyDateExpressionObject.format | public String format(Object expression, Object objPattern) {
if (objPattern instanceof String) {
final String pattern = filterPattern((String) objPattern);
if (expression == null) {
return null;
}
if (expression instanceof LocalDate) {
... | java | public String format(Object expression, Object objPattern) {
if (objPattern instanceof String) {
final String pattern = filterPattern((String) objPattern);
if (expression == null) {
return null;
}
if (expression instanceof LocalDate) {
... | [
"public",
"String",
"format",
"(",
"Object",
"expression",
",",
"Object",
"objPattern",
")",
"{",
"if",
"(",
"objPattern",
"instanceof",
"String",
")",
"{",
"final",
"String",
"pattern",
"=",
"filterPattern",
"(",
"(",
"String",
")",
"objPattern",
")",
";",
... | Get formatted date string.
@param expression Date expression. (NullAllowed: if null, returns null)
@param objPattern date format pattern. (NotNull)
@return formatted date string. (NullAllowed: if expression is null.) | [
"Get",
"formatted",
"date",
"string",
"."
] | d340a6e7eeddfcc9177052958c383fecd4a7fefa | https://github.com/lastaflute/lasta-thymeleaf/blob/d340a6e7eeddfcc9177052958c383fecd4a7fefa/src/main/java/org/lastaflute/thymeleaf/expression/HandyDateExpressionObject.java#L230-L254 | train |
cloudiator/sword | drivers/jclouds/src/main/java/de/uniulm/omi/cloudiator/sword/drivers/jclouds/strategy/JCloudsCreateVirtualMachineStrategy.java | JCloudsCreateVirtualMachineStrategy.enrich | private NodeMetadata enrich(NodeMetadata nodeMetadata, Template template) {
final NodeMetadataBuilder nodeMetadataBuilder = NodeMetadataBuilder
.fromNodeMetadata(nodeMetadata);
if (nodeMetadata.getHardware() == null) {
nodeMetadataBuilder.hardware(template.getHardware());
}
if (nodeMetad... | java | private NodeMetadata enrich(NodeMetadata nodeMetadata, Template template) {
final NodeMetadataBuilder nodeMetadataBuilder = NodeMetadataBuilder
.fromNodeMetadata(nodeMetadata);
if (nodeMetadata.getHardware() == null) {
nodeMetadataBuilder.hardware(template.getHardware());
}
if (nodeMetad... | [
"private",
"NodeMetadata",
"enrich",
"(",
"NodeMetadata",
"nodeMetadata",
",",
"Template",
"template",
")",
"{",
"final",
"NodeMetadataBuilder",
"nodeMetadataBuilder",
"=",
"NodeMetadataBuilder",
".",
"fromNodeMetadata",
"(",
"nodeMetadata",
")",
";",
"if",
"(",
"node... | Enriches the spawned vm with information of the template if the spawned vm does not contain
information about hardware, image or location
@param nodeMetadata the node to enrich
@param template the template used to spawn the node
@return the enriched node | [
"Enriches",
"the",
"spawned",
"vm",
"with",
"information",
"of",
"the",
"template",
"if",
"the",
"spawned",
"vm",
"does",
"not",
"contain",
"information",
"about",
"hardware",
"image",
"or",
"location"
] | b7808ea2776c6d70d439342c403369dfc5bb26bc | https://github.com/cloudiator/sword/blob/b7808ea2776c6d70d439342c403369dfc5bb26bc/drivers/jclouds/src/main/java/de/uniulm/omi/cloudiator/sword/drivers/jclouds/strategy/JCloudsCreateVirtualMachineStrategy.java#L117-L134 | train |
cloudiator/sword | drivers/jclouds/src/main/java/de/uniulm/omi/cloudiator/sword/drivers/jclouds/strategy/JCloudsCreateVirtualMachineStrategy.java | JCloudsCreateVirtualMachineStrategy.modifyTemplateOptions | protected org.jclouds.compute.options.TemplateOptions modifyTemplateOptions(
VirtualMachineTemplate originalVirtualMachineTemplate,
org.jclouds.compute.options.TemplateOptions originalTemplateOptions) {
return originalTemplateOptions;
} | java | protected org.jclouds.compute.options.TemplateOptions modifyTemplateOptions(
VirtualMachineTemplate originalVirtualMachineTemplate,
org.jclouds.compute.options.TemplateOptions originalTemplateOptions) {
return originalTemplateOptions;
} | [
"protected",
"org",
".",
"jclouds",
".",
"compute",
".",
"options",
".",
"TemplateOptions",
"modifyTemplateOptions",
"(",
"VirtualMachineTemplate",
"originalVirtualMachineTemplate",
",",
"org",
".",
"jclouds",
".",
"compute",
".",
"options",
".",
"TemplateOptions",
"o... | Extension point for the template options. Allows the subclass to replace the jclouds template
options object with a new one before it is passed to the template builder.
@param originalVirtualMachineTemplate the original virtual machine template
@param originalTemplateOptions the original template options
@return the r... | [
"Extension",
"point",
"for",
"the",
"template",
"options",
".",
"Allows",
"the",
"subclass",
"to",
"replace",
"the",
"jclouds",
"template",
"options",
"object",
"with",
"a",
"new",
"one",
"before",
"it",
"is",
"passed",
"to",
"the",
"template",
"builder",
".... | b7808ea2776c6d70d439342c403369dfc5bb26bc | https://github.com/cloudiator/sword/blob/b7808ea2776c6d70d439342c403369dfc5bb26bc/drivers/jclouds/src/main/java/de/uniulm/omi/cloudiator/sword/drivers/jclouds/strategy/JCloudsCreateVirtualMachineStrategy.java#L156-L160 | train |
duracloud/snapshot | snapshot-service-impl/src/main/java/org/duracloud/snapshot/service/impl/SpaceManifestSnapshotManifestVerifier.java | SpaceManifestSnapshotManifestVerifier.verify | public boolean verify() {
this.errors = new LinkedList<>();
try (BufferedReader reader =
new BufferedReader(new InputStreamReader(generator.generate(spaceId, ManifestFormat.TSV)))) {
WriteOnlyStringSet snapshotManifest = ManifestFileHelper.loadManifestSetFromFile(this.md5Ma... | java | public boolean verify() {
this.errors = new LinkedList<>();
try (BufferedReader reader =
new BufferedReader(new InputStreamReader(generator.generate(spaceId, ManifestFormat.TSV)))) {
WriteOnlyStringSet snapshotManifest = ManifestFileHelper.loadManifestSetFromFile(this.md5Ma... | [
"public",
"boolean",
"verify",
"(",
")",
"{",
"this",
".",
"errors",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"try",
"(",
"BufferedReader",
"reader",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStreamReader",
"(",
"generator",
".",
"generate",
"(... | Performs the verification.
@return true if verification was a success. Otherwise false. Errors can
be obtained by calling getErrors() after execution completes. | [
"Performs",
"the",
"verification",
"."
] | 7cb387b22fd4a9425087f654276138727c2c0b73 | https://github.com/duracloud/snapshot/blob/7cb387b22fd4a9425087f654276138727c2c0b73/snapshot-service-impl/src/main/java/org/duracloud/snapshot/service/impl/SpaceManifestSnapshotManifestVerifier.java#L60-L106 | train |
cloudiator/sword | drivers/openstack4j/src/main/java/de/uniulm/omi/cloudiator/sword/drivers/openstack4j/internal/OsClientV3Factory.java | OsClientV3Factory.handleIdentifiers | @Nullable
private static Identifiers handleIdentifiers(String domainIdOrName, String projectIdOrName,
String endpoint, String userId, String password) {
//we try all four cases and return the one that works
Set<Identifiers> possibleIdentifiers = new HashSet<Identifiers>() {{
add(new Identifiers(I... | java | @Nullable
private static Identifiers handleIdentifiers(String domainIdOrName, String projectIdOrName,
String endpoint, String userId, String password) {
//we try all four cases and return the one that works
Set<Identifiers> possibleIdentifiers = new HashSet<Identifiers>() {{
add(new Identifiers(I... | [
"@",
"Nullable",
"private",
"static",
"Identifiers",
"handleIdentifiers",
"(",
"String",
"domainIdOrName",
",",
"String",
"projectIdOrName",
",",
"String",
"endpoint",
",",
"String",
"userId",
",",
"String",
"password",
")",
"{",
"//we try all four cases and return the ... | This method tries to determine if the authentication should happen by using the user provided
information as domain ID or domain name resp. project ID or project name.
It does so by brute forcing the four different possible combinations.
Returns early on success.
@param domainIdOrName the domain id or name
@param pr... | [
"This",
"method",
"tries",
"to",
"determine",
"if",
"the",
"authentication",
"should",
"happen",
"by",
"using",
"the",
"user",
"provided",
"information",
"as",
"domain",
"ID",
"or",
"domain",
"name",
"resp",
".",
"project",
"ID",
"or",
"project",
"name",
"."... | b7808ea2776c6d70d439342c403369dfc5bb26bc | https://github.com/cloudiator/sword/blob/b7808ea2776c6d70d439342c403369dfc5bb26bc/drivers/openstack4j/src/main/java/de/uniulm/omi/cloudiator/sword/drivers/openstack4j/internal/OsClientV3Factory.java#L67-L88 | train |
cloudiator/sword | core/src/main/java/de/uniulm/omi/cloudiator/sword/config/AbstractComputeModule.java | AbstractComputeModule.configure | @Override
protected void configure() {
bind(DiscoveryService.class).to(BaseDiscoveryService.class);
bind(OperatingSystemDetectionStrategy.class)
.to(NameSubstringBasedOperatingSystemDetectionStrategy.class);
} | java | @Override
protected void configure() {
bind(DiscoveryService.class).to(BaseDiscoveryService.class);
bind(OperatingSystemDetectionStrategy.class)
.to(NameSubstringBasedOperatingSystemDetectionStrategy.class);
} | [
"@",
"Override",
"protected",
"void",
"configure",
"(",
")",
"{",
"bind",
"(",
"DiscoveryService",
".",
"class",
")",
".",
"to",
"(",
"BaseDiscoveryService",
".",
"class",
")",
";",
"bind",
"(",
"OperatingSystemDetectionStrategy",
".",
"class",
")",
".",
"to... | Can be extended to load own implementation of classes. | [
"Can",
"be",
"extended",
"to",
"load",
"own",
"implementation",
"of",
"classes",
"."
] | b7808ea2776c6d70d439342c403369dfc5bb26bc | https://github.com/cloudiator/sword/blob/b7808ea2776c6d70d439342c403369dfc5bb26bc/core/src/main/java/de/uniulm/omi/cloudiator/sword/config/AbstractComputeModule.java#L57-L64 | train |
Jsondb/jsondb-core | src/main/java/io/jsondb/query/Update.java | Update.update | public static Update update(String key, Object value) {
return new Update().set(key, value);
} | java | public static Update update(String key, Object value) {
return new Update().set(key, value);
} | [
"public",
"static",
"Update",
"update",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"return",
"new",
"Update",
"(",
")",
".",
"set",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Static factory method to create an Update using the provided key
@param key the field name for the update operation
@param value the value to set for the field
@return Updated object | [
"Static",
"factory",
"method",
"to",
"create",
"an",
"Update",
"using",
"the",
"provided",
"key"
] | c49654d1eee2ace4d5ca5be19730652a966ce7f4 | https://github.com/Jsondb/jsondb-core/blob/c49654d1eee2ace4d5ca5be19730652a966ce7f4/src/main/java/io/jsondb/query/Update.java#L45-L47 | train |
Jsondb/jsondb-core | src/main/java/io/jsondb/crypto/CryptoUtil.java | CryptoUtil.encryptFields | public static void encryptFields(Object object, CollectionMetaData cmd, ICipher cipher)
throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
for (String secretAnnotatedFieldName: cmd.getSecretAnnotatedFieldNames()) {
Method getterMethod = cmd.getGetterMethodForFieldName(... | java | public static void encryptFields(Object object, CollectionMetaData cmd, ICipher cipher)
throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
for (String secretAnnotatedFieldName: cmd.getSecretAnnotatedFieldNames()) {
Method getterMethod = cmd.getGetterMethodForFieldName(... | [
"public",
"static",
"void",
"encryptFields",
"(",
"Object",
"object",
",",
"CollectionMetaData",
"cmd",
",",
"ICipher",
"cipher",
")",
"throws",
"IllegalAccessException",
",",
"IllegalArgumentException",
",",
"InvocationTargetException",
"{",
"for",
"(",
"String",
"se... | A utility method to encrypt the value of field marked by the @Secret annotation using its
setter/mutator method.
@param object the actual Object representing the POJO we want the Id of.
@param cmd the CollectionMetaData object from which we can obtain the list
containing names of fields which have the @Secret annotatio... | [
"A",
"utility",
"method",
"to",
"encrypt",
"the",
"value",
"of",
"field",
"marked",
"by",
"the"
] | c49654d1eee2ace4d5ca5be19730652a966ce7f4 | https://github.com/Jsondb/jsondb-core/blob/c49654d1eee2ace4d5ca5be19730652a966ce7f4/src/main/java/io/jsondb/crypto/CryptoUtil.java#L58-L77 | train |
Jsondb/jsondb-core | src/main/java/io/jsondb/crypto/CryptoUtil.java | CryptoUtil.decryptFields | public static void decryptFields(Object object, CollectionMetaData cmd, ICipher cipher)
throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
for (String secretAnnotatedFieldName: cmd.getSecretAnnotatedFieldNames()) {
Method getterMethod = cmd.getGetterMethodForFieldName... | java | public static void decryptFields(Object object, CollectionMetaData cmd, ICipher cipher)
throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
for (String secretAnnotatedFieldName: cmd.getSecretAnnotatedFieldNames()) {
Method getterMethod = cmd.getGetterMethodForFieldName... | [
"public",
"static",
"void",
"decryptFields",
"(",
"Object",
"object",
",",
"CollectionMetaData",
"cmd",
",",
"ICipher",
"cipher",
")",
"throws",
"IllegalAccessException",
",",
"IllegalArgumentException",
",",
"InvocationTargetException",
"{",
"for",
"(",
"String",
"se... | A utility method to decrypt the value of field marked by the @Secret annotation using its
setter/mutator method.
@param object the actual Object representing the POJO we want the Id of.
@param cmd the CollectionMetaData object from which we can obtain the list
containing names of fields which have the @Secret annotatio... | [
"A",
"utility",
"method",
"to",
"decrypt",
"the",
"value",
"of",
"field",
"marked",
"by",
"the"
] | c49654d1eee2ace4d5ca5be19730652a966ce7f4 | https://github.com/Jsondb/jsondb-core/blob/c49654d1eee2ace4d5ca5be19730652a966ce7f4/src/main/java/io/jsondb/crypto/CryptoUtil.java#L90-L110 | train |
Jsondb/jsondb-core | src/main/java/io/jsondb/crypto/CryptoUtil.java | CryptoUtil.generate128BitKey | public static String generate128BitKey(String password, String salt)
throws NoSuchAlgorithmException, UnsupportedEncodingException, InvalidKeySpecException {
SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256");
KeySpec spec = new PBEKeySpec(password.toCharArray(), salt.g... | java | public static String generate128BitKey(String password, String salt)
throws NoSuchAlgorithmException, UnsupportedEncodingException, InvalidKeySpecException {
SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256");
KeySpec spec = new PBEKeySpec(password.toCharArray(), salt.g... | [
"public",
"static",
"String",
"generate128BitKey",
"(",
"String",
"password",
",",
"String",
"salt",
")",
"throws",
"NoSuchAlgorithmException",
",",
"UnsupportedEncodingException",
",",
"InvalidKeySpecException",
"{",
"SecretKeyFactory",
"factory",
"=",
"SecretKeyFactory",
... | Utility method to help generate a strong 128 bit Key to be used for the DefaultAESCBCCipher.
Note: This function is only provided as a utility to generate strong password it should
be used statically to generate a key and then the key should be captured and used in your program.
This function defaults to using 65536 ... | [
"Utility",
"method",
"to",
"help",
"generate",
"a",
"strong",
"128",
"bit",
"Key",
"to",
"be",
"used",
"for",
"the",
"DefaultAESCBCCipher",
"."
] | c49654d1eee2ace4d5ca5be19730652a966ce7f4 | https://github.com/Jsondb/jsondb-core/blob/c49654d1eee2ace4d5ca5be19730652a966ce7f4/src/main/java/io/jsondb/crypto/CryptoUtil.java#L131-L140 | train |
Jsondb/jsondb-core | src/main/java/io/jsondb/query/ddl/CollectionSchemaUpdate.java | CollectionSchemaUpdate.update | public static CollectionSchemaUpdate update(String key, IOperation operation) {
return new CollectionSchemaUpdate().set(key, operation);
} | java | public static CollectionSchemaUpdate update(String key, IOperation operation) {
return new CollectionSchemaUpdate().set(key, operation);
} | [
"public",
"static",
"CollectionSchemaUpdate",
"update",
"(",
"String",
"key",
",",
"IOperation",
"operation",
")",
"{",
"return",
"new",
"CollectionSchemaUpdate",
"(",
")",
".",
"set",
"(",
"key",
",",
"operation",
")",
";",
"}"
] | Static factory method to create an CollectionUpdate for the specified key
@param key: JSON attribute to update
@param operation: operation to carry out on the attribute
@return the updated CollectionSchemaUpdate | [
"Static",
"factory",
"method",
"to",
"create",
"an",
"CollectionUpdate",
"for",
"the",
"specified",
"key"
] | c49654d1eee2ace4d5ca5be19730652a966ce7f4 | https://github.com/Jsondb/jsondb-core/blob/c49654d1eee2ace4d5ca5be19730652a966ce7f4/src/main/java/io/jsondb/query/ddl/CollectionSchemaUpdate.java#L48-L50 | train |
Jsondb/jsondb-core | src/main/java/io/jsondb/query/ddl/CollectionSchemaUpdate.java | CollectionSchemaUpdate.set | public CollectionSchemaUpdate set(String key, IOperation operation) {
collectionUpdateData.put(key, operation);
return this;
} | java | public CollectionSchemaUpdate set(String key, IOperation operation) {
collectionUpdateData.put(key, operation);
return this;
} | [
"public",
"CollectionSchemaUpdate",
"set",
"(",
"String",
"key",
",",
"IOperation",
"operation",
")",
"{",
"collectionUpdateData",
".",
"put",
"(",
"key",
",",
"operation",
")",
";",
"return",
"this",
";",
"}"
] | A method to set a new Operation for a key. It may be of type ADD, RENAME or DELETE.
Only one operation per key can be specified. Attempt to add a second operation for a any key will override the first one.
Attempt to add a ADD operation for a key which already exists will have no effect.
Attempt to add a DELETE operati... | [
"A",
"method",
"to",
"set",
"a",
"new",
"Operation",
"for",
"a",
"key",
".",
"It",
"may",
"be",
"of",
"type",
"ADD",
"RENAME",
"or",
"DELETE",
".",
"Only",
"one",
"operation",
"per",
"key",
"can",
"be",
"specified",
".",
"Attempt",
"to",
"add",
"a",
... | c49654d1eee2ace4d5ca5be19730652a966ce7f4 | https://github.com/Jsondb/jsondb-core/blob/c49654d1eee2ace4d5ca5be19730652a966ce7f4/src/main/java/io/jsondb/query/ddl/CollectionSchemaUpdate.java#L62-L65 | train |
Jsondb/jsondb-core | src/main/java/io/jsondb/query/ddl/CollectionSchemaUpdate.java | CollectionSchemaUpdate.getAddOperations | public Map<String, AddOperation> getAddOperations() {
Map<String, AddOperation> addOperations = new TreeMap<String, AddOperation>();
for (Entry<String, IOperation> entry : collectionUpdateData.entrySet()) {
String key = entry.getKey();
IOperation op = entry.getValue();
if (op.getOperationType(... | java | public Map<String, AddOperation> getAddOperations() {
Map<String, AddOperation> addOperations = new TreeMap<String, AddOperation>();
for (Entry<String, IOperation> entry : collectionUpdateData.entrySet()) {
String key = entry.getKey();
IOperation op = entry.getValue();
if (op.getOperationType(... | [
"public",
"Map",
"<",
"String",
",",
"AddOperation",
">",
"getAddOperations",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"AddOperation",
">",
"addOperations",
"=",
"new",
"TreeMap",
"<",
"String",
",",
"AddOperation",
">",
"(",
")",
";",
"for",
"(",
"Entr... | Returns a Map of ADD operations which have a non-null default value specified.
@return Map of ADD operations which have a non-null default value specified | [
"Returns",
"a",
"Map",
"of",
"ADD",
"operations",
"which",
"have",
"a",
"non",
"-",
"null",
"default",
"value",
"specified",
"."
] | c49654d1eee2ace4d5ca5be19730652a966ce7f4 | https://github.com/Jsondb/jsondb-core/blob/c49654d1eee2ace4d5ca5be19730652a966ce7f4/src/main/java/io/jsondb/query/ddl/CollectionSchemaUpdate.java#L76-L89 | train |
Jsondb/jsondb-core | src/main/java/io/jsondb/query/ddl/CollectionSchemaUpdate.java | CollectionSchemaUpdate.getRenameOperations | public Map<String, RenameOperation> getRenameOperations() {
Map<String, RenameOperation> renOperations = new TreeMap<String, RenameOperation>();
for (Entry<String, IOperation> entry : collectionUpdateData.entrySet()) {
String key = entry.getKey();
IOperation op = entry.getValue();
if (op.getOp... | java | public Map<String, RenameOperation> getRenameOperations() {
Map<String, RenameOperation> renOperations = new TreeMap<String, RenameOperation>();
for (Entry<String, IOperation> entry : collectionUpdateData.entrySet()) {
String key = entry.getKey();
IOperation op = entry.getValue();
if (op.getOp... | [
"public",
"Map",
"<",
"String",
",",
"RenameOperation",
">",
"getRenameOperations",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"RenameOperation",
">",
"renOperations",
"=",
"new",
"TreeMap",
"<",
"String",
",",
"RenameOperation",
">",
"(",
")",
";",
"for",
... | Returns a Map of RENAME operations.
@return Map of RENAME operations which have a non-null default value specified | [
"Returns",
"a",
"Map",
"of",
"RENAME",
"operations",
"."
] | c49654d1eee2ace4d5ca5be19730652a966ce7f4 | https://github.com/Jsondb/jsondb-core/blob/c49654d1eee2ace4d5ca5be19730652a966ce7f4/src/main/java/io/jsondb/query/ddl/CollectionSchemaUpdate.java#L96-L106 | train |
Jsondb/jsondb-core | src/main/java/io/jsondb/query/ddl/CollectionSchemaUpdate.java | CollectionSchemaUpdate.getDeleteOperations | public Map<String, DeleteOperation> getDeleteOperations() {
Map<String, DeleteOperation> delOperations = new TreeMap<String, DeleteOperation>();
for (Entry<String, IOperation> entry : collectionUpdateData.entrySet()) {
String key = entry.getKey();
IOperation op = entry.getValue();
if (op.getOp... | java | public Map<String, DeleteOperation> getDeleteOperations() {
Map<String, DeleteOperation> delOperations = new TreeMap<String, DeleteOperation>();
for (Entry<String, IOperation> entry : collectionUpdateData.entrySet()) {
String key = entry.getKey();
IOperation op = entry.getValue();
if (op.getOp... | [
"public",
"Map",
"<",
"String",
",",
"DeleteOperation",
">",
"getDeleteOperations",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"DeleteOperation",
">",
"delOperations",
"=",
"new",
"TreeMap",
"<",
"String",
",",
"DeleteOperation",
">",
"(",
")",
";",
"for",
... | Returns a Map of DELETE operations.
@return Map of DELETE operations which have a non-null default value specified | [
"Returns",
"a",
"Map",
"of",
"DELETE",
"operations",
"."
] | c49654d1eee2ace4d5ca5be19730652a966ce7f4 | https://github.com/Jsondb/jsondb-core/blob/c49654d1eee2ace4d5ca5be19730652a966ce7f4/src/main/java/io/jsondb/query/ddl/CollectionSchemaUpdate.java#L113-L123 | train |
Jsondb/jsondb-core | src/main/java/io/jsondb/Util.java | Util.getIdForEntity | protected static Object getIdForEntity(Object document, Method getterMethodForId) {
Object id = null;
if (null != getterMethodForId) {
try {
id = getterMethodForId.invoke(document);
} catch (IllegalAccessException e) {
logger.error("Failed to invoke getter method for a idAnnotated fi... | java | protected static Object getIdForEntity(Object document, Method getterMethodForId) {
Object id = null;
if (null != getterMethodForId) {
try {
id = getterMethodForId.invoke(document);
} catch (IllegalAccessException e) {
logger.error("Failed to invoke getter method for a idAnnotated fi... | [
"protected",
"static",
"Object",
"getIdForEntity",
"(",
"Object",
"document",
",",
"Method",
"getterMethodForId",
")",
"{",
"Object",
"id",
"=",
"null",
";",
"if",
"(",
"null",
"!=",
"getterMethodForId",
")",
"{",
"try",
"{",
"id",
"=",
"getterMethodForId",
... | A utility method to extract the value of field marked by the @Id annotation using its
getter/accessor method.
@param document the actual Object representing the POJO we want the Id of.
@param getterMethodForId the Method that is the accessor for the attributed with @Id annotation
@return the actual Id or if none exists... | [
"A",
"utility",
"method",
"to",
"extract",
"the",
"value",
"of",
"field",
"marked",
"by",
"the"
] | c49654d1eee2ace4d5ca5be19730652a966ce7f4 | https://github.com/Jsondb/jsondb-core/blob/c49654d1eee2ace4d5ca5be19730652a966ce7f4/src/main/java/io/jsondb/Util.java#L107-L124 | train |
Jsondb/jsondb-core | src/main/java/io/jsondb/Util.java | Util.deepCopy | protected static Object deepCopy(Object fromBean) {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
XMLEncoder out = new XMLEncoder(bos);
out.writeObject(fromBean);
out.close();
ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
XMLDecoder in = new XMLDecoder(bis, ... | java | protected static Object deepCopy(Object fromBean) {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
XMLEncoder out = new XMLEncoder(bos);
out.writeObject(fromBean);
out.close();
ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
XMLDecoder in = new XMLDecoder(bis, ... | [
"protected",
"static",
"Object",
"deepCopy",
"(",
"Object",
"fromBean",
")",
"{",
"ByteArrayOutputStream",
"bos",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"XMLEncoder",
"out",
"=",
"new",
"XMLEncoder",
"(",
"bos",
")",
";",
"out",
".",
"writeObject"... | A utility method that creates a deep clone of the specified object.
There is no other way of doing this reliably.
@param fromBean java bean to be cloned.
@return a new java bean cloned from fromBean. | [
"A",
"utility",
"method",
"that",
"creates",
"a",
"deep",
"clone",
"of",
"the",
"specified",
"object",
".",
"There",
"is",
"no",
"other",
"way",
"of",
"doing",
"this",
"reliably",
"."
] | c49654d1eee2ace4d5ca5be19730652a966ce7f4 | https://github.com/Jsondb/jsondb-core/blob/c49654d1eee2ace4d5ca5be19730652a966ce7f4/src/main/java/io/jsondb/Util.java#L177-L188 | train |
Jsondb/jsondb-core | src/main/java/io/jsondb/Util.java | Util.stampVersion | public static boolean stampVersion(JsonDBConfig dbConfig, File f, String version) {
FileOutputStream fos = null;
OutputStreamWriter osr = null;
BufferedWriter writer = null;
try {
fos = new FileOutputStream(f);
osr = new OutputStreamWriter(fos, dbConfig.getCharset());
writer = new Buf... | java | public static boolean stampVersion(JsonDBConfig dbConfig, File f, String version) {
FileOutputStream fos = null;
OutputStreamWriter osr = null;
BufferedWriter writer = null;
try {
fos = new FileOutputStream(f);
osr = new OutputStreamWriter(fos, dbConfig.getCharset());
writer = new Buf... | [
"public",
"static",
"boolean",
"stampVersion",
"(",
"JsonDBConfig",
"dbConfig",
",",
"File",
"f",
",",
"String",
"version",
")",
"{",
"FileOutputStream",
"fos",
"=",
"null",
";",
"OutputStreamWriter",
"osr",
"=",
"null",
";",
"BufferedWriter",
"writer",
"=",
"... | Utility to stamp the version into a newly created .json File
This method is expected to be invoked on a newly created .json file before it is usable.
So no locking code required.
@param dbConfig all the settings used by Json DB
@param f the target .json file on which to stamp the version
@param version the actual v... | [
"Utility",
"to",
"stamp",
"the",
"version",
"into",
"a",
"newly",
"created",
".",
"json",
"File",
"This",
"method",
"is",
"expected",
"to",
"be",
"invoked",
"on",
"a",
"newly",
"created",
".",
"json",
"file",
"before",
"it",
"is",
"usable",
".",
"So",
... | c49654d1eee2ace4d5ca5be19730652a966ce7f4 | https://github.com/Jsondb/jsondb-core/blob/c49654d1eee2ace4d5ca5be19730652a966ce7f4/src/main/java/io/jsondb/Util.java#L200-L237 | train |
Jsondb/jsondb-core | src/main/java/io/jsondb/crypto/DefaultAESCBCCipher.java | DefaultAESCBCCipher.decrypt | @Override
public String decrypt(String cipherText) {
this.decryptionLock.lock();
try{
String decryptedValue = null;
try {
byte[] bytes = Base64.getDecoder().decode(cipherText);
decryptedValue = new String(decryptCipher.doFinal(bytes), charset);
} catch (UnsupportedEncodingExc... | java | @Override
public String decrypt(String cipherText) {
this.decryptionLock.lock();
try{
String decryptedValue = null;
try {
byte[] bytes = Base64.getDecoder().decode(cipherText);
decryptedValue = new String(decryptCipher.doFinal(bytes), charset);
} catch (UnsupportedEncodingExc... | [
"@",
"Override",
"public",
"String",
"decrypt",
"(",
"String",
"cipherText",
")",
"{",
"this",
".",
"decryptionLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"String",
"decryptedValue",
"=",
"null",
";",
"try",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"Bas... | A method to decrypt the provided cipher text.
@param cipherText AES encrypted cipherText
@return decrypted text | [
"A",
"method",
"to",
"decrypt",
"the",
"provided",
"cipher",
"text",
"."
] | c49654d1eee2ace4d5ca5be19730652a966ce7f4 | https://github.com/Jsondb/jsondb-core/blob/c49654d1eee2ace4d5ca5be19730652a966ce7f4/src/main/java/io/jsondb/crypto/DefaultAESCBCCipher.java#L180-L196 | train |
Jsondb/jsondb-core | src/main/java/io/jsondb/DefaultSchemaVersionComparator.java | DefaultSchemaVersionComparator.compare | @Override
public int compare(String expected, String actual) {
String[] vals1 = expected.split("\\.");
String[] vals2 = actual.split("\\.");
int i = 0;
while (i < vals1.length && i < vals2.length && vals1[i].equals(vals2[i])) {
i++;
}
if (i < vals1.length && i < vals2.length) {
i... | java | @Override
public int compare(String expected, String actual) {
String[] vals1 = expected.split("\\.");
String[] vals2 = actual.split("\\.");
int i = 0;
while (i < vals1.length && i < vals2.length && vals1[i].equals(vals2[i])) {
i++;
}
if (i < vals1.length && i < vals2.length) {
i... | [
"@",
"Override",
"public",
"int",
"compare",
"(",
"String",
"expected",
",",
"String",
"actual",
")",
"{",
"String",
"[",
"]",
"vals1",
"=",
"expected",
".",
"split",
"(",
"\"\\\\.\"",
")",
";",
"String",
"[",
"]",
"vals2",
"=",
"actual",
".",
"split",... | compare the expected version with the actual version.
Checkout: http://stackoverflow.com/questions/6701948/efficient-way-to-compare-version-strings-in-java
@param expected the version that is obtained from @Document annotation
@param actual the version that is read from the .json file
@return a negative integer, zero... | [
"compare",
"the",
"expected",
"version",
"with",
"the",
"actual",
"version",
"."
] | c49654d1eee2ace4d5ca5be19730652a966ce7f4 | https://github.com/Jsondb/jsondb-core/blob/c49654d1eee2ace4d5ca5be19730652a966ce7f4/src/main/java/io/jsondb/DefaultSchemaVersionComparator.java#L44-L60 | train |
cognitect/transit-java | src/main/java/com/cognitect/transit/TransitFactory.java | TransitFactory.keyword | public static Keyword keyword(Object o) {
if (o instanceof Keyword)
return (Keyword) o;
else if (o instanceof String) {
String s = (String) o;
if (s.charAt(0) == ':')
return new KeywordImpl(s.substring(1));
else
return new K... | java | public static Keyword keyword(Object o) {
if (o instanceof Keyword)
return (Keyword) o;
else if (o instanceof String) {
String s = (String) o;
if (s.charAt(0) == ':')
return new KeywordImpl(s.substring(1));
else
return new K... | [
"public",
"static",
"Keyword",
"keyword",
"(",
"Object",
"o",
")",
"{",
"if",
"(",
"o",
"instanceof",
"Keyword",
")",
"return",
"(",
"Keyword",
")",
"o",
";",
"else",
"if",
"(",
"o",
"instanceof",
"String",
")",
"{",
"String",
"s",
"=",
"(",
"String"... | Converts a string or keyword to a keyword
@param o A string or a keyword
@return a keyword | [
"Converts",
"a",
"string",
"or",
"keyword",
"to",
"a",
"keyword"
] | a1d5edc2862fe9469c51483b9c53dbf6534e9c43 | https://github.com/cognitect/transit-java/blob/a1d5edc2862fe9469c51483b9c53dbf6534e9c43/src/main/java/com/cognitect/transit/TransitFactory.java#L177-L188 | train |
cognitect/transit-java | src/main/java/com/cognitect/transit/TransitFactory.java | TransitFactory.symbol | public static Symbol symbol(Object o) {
if (o instanceof Symbol)
return (Symbol) o;
else if (o instanceof String) {
String s = (String) o;
if (s.charAt(0) == ':')
return new SymbolImpl(s.substring(1));
else
return new Symbol... | java | public static Symbol symbol(Object o) {
if (o instanceof Symbol)
return (Symbol) o;
else if (o instanceof String) {
String s = (String) o;
if (s.charAt(0) == ':')
return new SymbolImpl(s.substring(1));
else
return new Symbol... | [
"public",
"static",
"Symbol",
"symbol",
"(",
"Object",
"o",
")",
"{",
"if",
"(",
"o",
"instanceof",
"Symbol",
")",
"return",
"(",
"Symbol",
")",
"o",
";",
"else",
"if",
"(",
"o",
"instanceof",
"String",
")",
"{",
"String",
"s",
"=",
"(",
"String",
... | Converts a string or a symbol to a symbol
@param o a string or a symbol
@return a symbol | [
"Converts",
"a",
"string",
"or",
"a",
"symbol",
"to",
"a",
"symbol"
] | a1d5edc2862fe9469c51483b9c53dbf6534e9c43 | https://github.com/cognitect/transit-java/blob/a1d5edc2862fe9469c51483b9c53dbf6534e9c43/src/main/java/com/cognitect/transit/TransitFactory.java#L195-L206 | train |
cognitect/transit-java | src/main/java/com/cognitect/transit/TransitFactory.java | TransitFactory.taggedValue | public static <T> TaggedValue<T> taggedValue(String tag, T rep) {
return new TaggedValueImpl<T>(tag, rep);
} | java | public static <T> TaggedValue<T> taggedValue(String tag, T rep) {
return new TaggedValueImpl<T>(tag, rep);
} | [
"public",
"static",
"<",
"T",
">",
"TaggedValue",
"<",
"T",
">",
"taggedValue",
"(",
"String",
"tag",
",",
"T",
"rep",
")",
"{",
"return",
"new",
"TaggedValueImpl",
"<",
"T",
">",
"(",
"tag",
",",
"rep",
")",
";",
"}"
] | Creates a TaggedValue
@param tag tag string
@param rep value representation
@return a tagged value | [
"Creates",
"a",
"TaggedValue"
] | a1d5edc2862fe9469c51483b9c53dbf6534e9c43 | https://github.com/cognitect/transit-java/blob/a1d5edc2862fe9469c51483b9c53dbf6534e9c43/src/main/java/com/cognitect/transit/TransitFactory.java#L214-L216 | train |
yonik/noggit | src/main/java/org/noggit/JSONParser.java | JSONParser.readNumber | private long readNumber(int firstChar, boolean isNeg) throws IOException {
out.unsafeWrite(firstChar); // unsafe OK since we know output is big enough
// We build up the number in the negative plane since it's larger (by one) than
// the positive plane.
long v = '0' - firstChar;
// can't overflow... | java | private long readNumber(int firstChar, boolean isNeg) throws IOException {
out.unsafeWrite(firstChar); // unsafe OK since we know output is big enough
// We build up the number in the negative plane since it's larger (by one) than
// the positive plane.
long v = '0' - firstChar;
// can't overflow... | [
"private",
"long",
"readNumber",
"(",
"int",
"firstChar",
",",
"boolean",
"isNeg",
")",
"throws",
"IOException",
"{",
"out",
".",
"unsafeWrite",
"(",
"firstChar",
")",
";",
"// unsafe OK since we know output is big enough",
"// We build up the number in the negative plane s... | Returns the long read... only significant if valstate==LONG after
this call. firstChar should be the first numeric digit read. | [
"Returns",
"the",
"long",
"read",
"...",
"only",
"significant",
"if",
"valstate",
"==",
"LONG",
"after",
"this",
"call",
".",
"firstChar",
"should",
"be",
"the",
"first",
"numeric",
"digit",
"read",
"."
] | 8febcdc7f88126bde8a1909519b4644655f78106 | https://github.com/yonik/noggit/blob/8febcdc7f88126bde8a1909519b4644655f78106/src/main/java/org/noggit/JSONParser.java#L449-L542 | train |
yonik/noggit | src/main/java/org/noggit/JSONParser.java | JSONParser.readFrac | private int readFrac(CharArr arr, int lim) throws IOException {
nstate = HAS_FRACTION; // deliberate set instead of '|'
while(--lim>=0) {
int ch = getChar();
if (ch>='0' && ch<='9') {
arr.write(ch);
} else if (ch=='e' || ch=='E') {
arr.write(ch);
return readExp(arr,lim... | java | private int readFrac(CharArr arr, int lim) throws IOException {
nstate = HAS_FRACTION; // deliberate set instead of '|'
while(--lim>=0) {
int ch = getChar();
if (ch>='0' && ch<='9') {
arr.write(ch);
} else if (ch=='e' || ch=='E') {
arr.write(ch);
return readExp(arr,lim... | [
"private",
"int",
"readFrac",
"(",
"CharArr",
"arr",
",",
"int",
"lim",
")",
"throws",
"IOException",
"{",
"nstate",
"=",
"HAS_FRACTION",
";",
"// deliberate set instead of '|'",
"while",
"(",
"--",
"lim",
">=",
"0",
")",
"{",
"int",
"ch",
"=",
"getChar",
... | read digits right of decimal point | [
"read",
"digits",
"right",
"of",
"decimal",
"point"
] | 8febcdc7f88126bde8a1909519b4644655f78106 | https://github.com/yonik/noggit/blob/8febcdc7f88126bde8a1909519b4644655f78106/src/main/java/org/noggit/JSONParser.java#L546-L561 | train |
yonik/noggit | src/main/java/org/noggit/JSONParser.java | JSONParser.readExp | private int readExp(CharArr arr, int lim) throws IOException {
nstate |= HAS_EXPONENT;
int ch = getChar(); lim--;
if (ch=='+' || ch=='-') {
arr.write(ch);
ch = getChar(); lim--;
}
// make sure at least one digit is read.
if (ch<'0' || ch>'9') {
throw err("missing exponent num... | java | private int readExp(CharArr arr, int lim) throws IOException {
nstate |= HAS_EXPONENT;
int ch = getChar(); lim--;
if (ch=='+' || ch=='-') {
arr.write(ch);
ch = getChar(); lim--;
}
// make sure at least one digit is read.
if (ch<'0' || ch>'9') {
throw err("missing exponent num... | [
"private",
"int",
"readExp",
"(",
"CharArr",
"arr",
",",
"int",
"lim",
")",
"throws",
"IOException",
"{",
"nstate",
"|=",
"HAS_EXPONENT",
";",
"int",
"ch",
"=",
"getChar",
"(",
")",
";",
"lim",
"--",
";",
"if",
"(",
"ch",
"==",
"'",
"'",
"||",
"ch"... | call after 'e' or 'E' has been seen to read the rest of the exponent | [
"call",
"after",
"e",
"or",
"E",
"has",
"been",
"seen",
"to",
"read",
"the",
"rest",
"of",
"the",
"exponent"
] | 8febcdc7f88126bde8a1909519b4644655f78106 | https://github.com/yonik/noggit/blob/8febcdc7f88126bde8a1909519b4644655f78106/src/main/java/org/noggit/JSONParser.java#L565-L581 | train |
yonik/noggit | src/main/java/org/noggit/JSONParser.java | JSONParser.readExpDigits | private int readExpDigits(CharArr arr, int lim) throws IOException {
while (--lim>=0) {
int ch = getChar();
if (ch>='0' && ch<='9') {
arr.write(ch);
} else {
if (ch!=-1) start--; // back up
return NUMBER;
}
}
return BIGNUMBER;
} | java | private int readExpDigits(CharArr arr, int lim) throws IOException {
while (--lim>=0) {
int ch = getChar();
if (ch>='0' && ch<='9') {
arr.write(ch);
} else {
if (ch!=-1) start--; // back up
return NUMBER;
}
}
return BIGNUMBER;
} | [
"private",
"int",
"readExpDigits",
"(",
"CharArr",
"arr",
",",
"int",
"lim",
")",
"throws",
"IOException",
"{",
"while",
"(",
"--",
"lim",
">=",
"0",
")",
"{",
"int",
"ch",
"=",
"getChar",
"(",
")",
";",
"if",
"(",
"ch",
">=",
"'",
"'",
"&&",
"ch... | continuation of readExpStart | [
"continuation",
"of",
"readExpStart"
] | 8febcdc7f88126bde8a1909519b4644655f78106 | https://github.com/yonik/noggit/blob/8febcdc7f88126bde8a1909519b4644655f78106/src/main/java/org/noggit/JSONParser.java#L584-L595 | train |
yonik/noggit | src/main/java/org/noggit/JSONParser.java | JSONParser.readEscapedChar | private char readEscapedChar() throws IOException {
int ch = getChar();
switch (ch) {
case '"' : return '"';
case '\'' : return '\'';
case '\\' : return '\\';
case '/' : return '/';
case 'n' : return '\n';
case 'r' : return '\r';
case 't' : return '\t';
case 'f' :... | java | private char readEscapedChar() throws IOException {
int ch = getChar();
switch (ch) {
case '"' : return '"';
case '\'' : return '\'';
case '\\' : return '\\';
case '/' : return '/';
case 'n' : return '\n';
case 'r' : return '\r';
case 't' : return '\t';
case 'f' :... | [
"private",
"char",
"readEscapedChar",
"(",
")",
"throws",
"IOException",
"{",
"int",
"ch",
"=",
"getChar",
"(",
")",
";",
"switch",
"(",
"ch",
")",
"{",
"case",
"'",
"'",
":",
"return",
"'",
"'",
";",
"case",
"'",
"'",
":",
"return",
"'",
"'",
";... | backslash has already been read when this is called | [
"backslash",
"has",
"already",
"been",
"read",
"when",
"this",
"is",
"called"
] | 8febcdc7f88126bde8a1909519b4644655f78106 | https://github.com/yonik/noggit/blob/8febcdc7f88126bde8a1909519b4644655f78106/src/main/java/org/noggit/JSONParser.java#L641-L664 | train |
yonik/noggit | src/main/java/org/noggit/JSONParser.java | JSONParser.readStringChars2 | private void readStringChars2(CharArr arr, int middle) throws IOException {
if (stringTerm == 0) {
readStringBare(arr);
return;
}
char terminator = (char) stringTerm;
for (;;) {
if (middle>=end) {
arr.write(buf,start,middle-start);
start=middle;
getMore();
... | java | private void readStringChars2(CharArr arr, int middle) throws IOException {
if (stringTerm == 0) {
readStringBare(arr);
return;
}
char terminator = (char) stringTerm;
for (;;) {
if (middle>=end) {
arr.write(buf,start,middle-start);
start=middle;
getMore();
... | [
"private",
"void",
"readStringChars2",
"(",
"CharArr",
"arr",
",",
"int",
"middle",
")",
"throws",
"IOException",
"{",
"if",
"(",
"stringTerm",
"==",
"0",
")",
"{",
"readStringBare",
"(",
"arr",
")",
";",
"return",
";",
"}",
"char",
"terminator",
"=",
"(... | this should be faster for strings with fewer escapes, but probably slower for many escapes. | [
"this",
"should",
"be",
"faster",
"for",
"strings",
"with",
"fewer",
"escapes",
"but",
"probably",
"slower",
"for",
"many",
"escapes",
"."
] | 8febcdc7f88126bde8a1909519b4644655f78106 | https://github.com/yonik/noggit/blob/8febcdc7f88126bde8a1909519b4644655f78106/src/main/java/org/noggit/JSONParser.java#L697-L726 | train |
yonik/noggit | src/main/java/org/noggit/JSONParser.java | JSONParser.getNumberChars | public void getNumberChars(CharArr output) throws IOException {
int ev=0;
if (valstate==0) ev=nextEvent();
if (valstate == LONG || valstate == NUMBER) output.write(this.out);
else if (valstate==BIGNUMBER) {
continueNumber(output);
} else {
throw err("Unexpected " + ev);
}
valstat... | java | public void getNumberChars(CharArr output) throws IOException {
int ev=0;
if (valstate==0) ev=nextEvent();
if (valstate == LONG || valstate == NUMBER) output.write(this.out);
else if (valstate==BIGNUMBER) {
continueNumber(output);
} else {
throw err("Unexpected " + ev);
}
valstat... | [
"public",
"void",
"getNumberChars",
"(",
"CharArr",
"output",
")",
"throws",
"IOException",
"{",
"int",
"ev",
"=",
"0",
";",
"if",
"(",
"valstate",
"==",
"0",
")",
"ev",
"=",
"nextEvent",
"(",
")",
";",
"if",
"(",
"valstate",
"==",
"LONG",
"||",
"val... | Reads a JSON numeric value into the output. | [
"Reads",
"a",
"JSON",
"numeric",
"value",
"into",
"the",
"output",
"."
] | 8febcdc7f88126bde8a1909519b4644655f78106 | https://github.com/yonik/noggit/blob/8febcdc7f88126bde8a1909519b4644655f78106/src/main/java/org/noggit/JSONParser.java#L1200-L1210 | train |
yonik/noggit | src/main/java/org/noggit/CharUtil.java | CharUtil.parseLong | public long parseLong(char[] arr, int start, int end) {
long x = 0;
boolean negative = arr[start] == '-';
for (int i=negative ? start+1 : start; i<end; i++) {
// If constructing the largest negative number, this will overflow
// to the largest negative number. This is OK since the negation of
... | java | public long parseLong(char[] arr, int start, int end) {
long x = 0;
boolean negative = arr[start] == '-';
for (int i=negative ? start+1 : start; i<end; i++) {
// If constructing the largest negative number, this will overflow
// to the largest negative number. This is OK since the negation of
... | [
"public",
"long",
"parseLong",
"(",
"char",
"[",
"]",
"arr",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"long",
"x",
"=",
"0",
";",
"boolean",
"negative",
"=",
"arr",
"[",
"start",
"]",
"==",
"'",
"'",
";",
"for",
"(",
"int",
"i",
"=",
... | belongs in number utils or charutil? | [
"belongs",
"in",
"number",
"utils",
"or",
"charutil?"
] | 8febcdc7f88126bde8a1909519b4644655f78106 | https://github.com/yonik/noggit/blob/8febcdc7f88126bde8a1909519b4644655f78106/src/main/java/org/noggit/CharUtil.java#L27-L39 | train |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/net/MultiPooledSocketFactory.java | MultiPooledSocketFactory.createSocketFactory | protected SocketFactory createSocketFactory(InetAddress address,
int port,
InetAddress localAddr,
int localPort,
long timeout)
... | java | protected SocketFactory createSocketFactory(InetAddress address,
int port,
InetAddress localAddr,
int localPort,
long timeout)
... | [
"protected",
"SocketFactory",
"createSocketFactory",
"(",
"InetAddress",
"address",
",",
"int",
"port",
",",
"InetAddress",
"localAddr",
",",
"int",
"localPort",
",",
"long",
"timeout",
")",
"{",
"SocketFactory",
"factory",
";",
"factory",
"=",
"new",
"PlainSocket... | Create socket factories for newly resolved addresses. Default
implementation returns a LazySocketFactory wrapping a
PooledSocketFactory wrapping a PlainSocketFactory. | [
"Create",
"socket",
"factories",
"for",
"newly",
"resolved",
"addresses",
".",
"Default",
"implementation",
"returns",
"a",
"LazySocketFactory",
"wrapping",
"a",
"PooledSocketFactory",
"wrapping",
"a",
"PlainSocketFactory",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/net/MultiPooledSocketFactory.java#L137-L149 | train |
teatrove/teatrove | teaapps/src/main/java/org/teatrove/teaapps/contexts/EncodingContext.java | EncodingContext.encodeIntArray | public String encodeIntArray(int[] input) throws IOException {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(bos);
int length = input.length;
dos.writeInt(length);
for (int i=0; i < length; i++) {
dos.writeInt(inp... | java | public String encodeIntArray(int[] input) throws IOException {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(bos);
int length = input.length;
dos.writeInt(length);
for (int i=0; i < length; i++) {
dos.writeInt(inp... | [
"public",
"String",
"encodeIntArray",
"(",
"int",
"[",
"]",
"input",
")",
"throws",
"IOException",
"{",
"ByteArrayOutputStream",
"bos",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"DataOutputStream",
"dos",
"=",
"new",
"DataOutputStream",
"(",
"bos",
")"... | Encode the given integer array into Base64 format.
@param input The array of integers to encode
@return The Base64 encoded data
@throws IOException if an error occurs encoding the array stream
@see #decodeIntArray(String) | [
"Encode",
"the",
"given",
"integer",
"array",
"into",
"Base64",
"format",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaapps/src/main/java/org/teatrove/teaapps/contexts/EncodingContext.java#L82-L92 | train |
teatrove/teatrove | teaapps/src/main/java/org/teatrove/teaapps/contexts/EncodingContext.java | EncodingContext.decodeIntArray | public int[] decodeIntArray(String input) throws IOException {
int[] result = null;
ByteArrayInputStream bis =
new ByteArrayInputStream(Base64.decodeBase64(input));
DataInputStream dis = new DataInputStream(bis);
int length = dis.readInt();
result = new int[length];
... | java | public int[] decodeIntArray(String input) throws IOException {
int[] result = null;
ByteArrayInputStream bis =
new ByteArrayInputStream(Base64.decodeBase64(input));
DataInputStream dis = new DataInputStream(bis);
int length = dis.readInt();
result = new int[length];
... | [
"public",
"int",
"[",
"]",
"decodeIntArray",
"(",
"String",
"input",
")",
"throws",
"IOException",
"{",
"int",
"[",
"]",
"result",
"=",
"null",
";",
"ByteArrayInputStream",
"bis",
"=",
"new",
"ByteArrayInputStream",
"(",
"Base64",
".",
"decodeBase64",
"(",
"... | Decode the given Base64 encoded value into an integer array.
@param input The Base64 encoded value to decode
@return The array of decoded integers
@throws IOException if an error occurs decoding the array stream
@see #encodeIntArray(int[]) | [
"Decode",
"the",
"given",
"Base64",
"encoded",
"value",
"into",
"an",
"integer",
"array",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaapps/src/main/java/org/teatrove/teaapps/contexts/EncodingContext.java#L105-L116 | train |
teatrove/teatrove | teaapps/src/main/java/org/teatrove/teaapps/contexts/EncodingContext.java | EncodingContext.decodeHexToString | public String decodeHexToString(String str) throws DecoderException {
String result = null;
byte[] bytes = Hex.decodeHex(str.toCharArray());
if (bytes != null && bytes.length > 0) {
result = new String(bytes);
}
return result;
} | java | public String decodeHexToString(String str) throws DecoderException {
String result = null;
byte[] bytes = Hex.decodeHex(str.toCharArray());
if (bytes != null && bytes.length > 0) {
result = new String(bytes);
}
return result;
} | [
"public",
"String",
"decodeHexToString",
"(",
"String",
"str",
")",
"throws",
"DecoderException",
"{",
"String",
"result",
"=",
"null",
";",
"byte",
"[",
"]",
"bytes",
"=",
"Hex",
".",
"decodeHex",
"(",
"str",
".",
"toCharArray",
"(",
")",
")",
";",
"if"... | Decode the given hexidecimal formatted value into a string representing
the bytes of the decoded value.
@param str The hexidecimal formatted value
@return The string representing the decoded bytes
@throws DecoderException if an error occurs during decoding
@see #decodeHex(String) | [
"Decode",
"the",
"given",
"hexidecimal",
"formatted",
"value",
"into",
"a",
"string",
"representing",
"the",
"bytes",
"of",
"the",
"decoded",
"value",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaapps/src/main/java/org/teatrove/teaapps/contexts/EncodingContext.java#L299-L306 | train |
teatrove/teatrove | teaservlet/src/main/java/org/teatrove/teatools/FeatureDescription.java | FeatureDescription.getName | public String getName() {
FeatureDescriptor fd = getFeatureDescriptor();
if (fd == null) {
return null;
}
return fd.getName();
} | java | public String getName() {
FeatureDescriptor fd = getFeatureDescriptor();
if (fd == null) {
return null;
}
return fd.getName();
} | [
"public",
"String",
"getName",
"(",
")",
"{",
"FeatureDescriptor",
"fd",
"=",
"getFeatureDescriptor",
"(",
")",
";",
"if",
"(",
"fd",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"fd",
".",
"getName",
"(",
")",
";",
"}"
] | Returns the feature name | [
"Returns",
"the",
"feature",
"name"
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaservlet/src/main/java/org/teatrove/teatools/FeatureDescription.java#L40-L47 | train |
teatrove/teatrove | teaservlet/src/main/java/org/teatrove/teatools/FeatureDescription.java | FeatureDescription.getDescription | public String getDescription() {
FeatureDescriptor fd = getFeatureDescriptor();
if (fd == null) {
return "";
}
return getTeaToolsUtils().getDescription(fd);
} | java | public String getDescription() {
FeatureDescriptor fd = getFeatureDescriptor();
if (fd == null) {
return "";
}
return getTeaToolsUtils().getDescription(fd);
} | [
"public",
"String",
"getDescription",
"(",
")",
"{",
"FeatureDescriptor",
"fd",
"=",
"getFeatureDescriptor",
"(",
")",
";",
"if",
"(",
"fd",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"return",
"getTeaToolsUtils",
"(",
")",
".",
"getDescription",
... | Returns the shortDescription or "" if the
shortDescription is the same as the displayName. | [
"Returns",
"the",
"shortDescription",
"or",
"if",
"the",
"shortDescription",
"is",
"the",
"same",
"as",
"the",
"displayName",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaservlet/src/main/java/org/teatrove/teatools/FeatureDescription.java#L53-L60 | train |
teatrove/teatrove | build-tools/toolbox/src/main/java/org/teatrove/toolbox/beandoc/teadoc/ClassDoc.java | ClassDoc.getQualifiedTypeNameForFile | public String getQualifiedTypeNameForFile() {
String typeName = getTypeNameForFile();
String qualifiedTypeName = mDoc.qualifiedTypeName();
int packageLength = qualifiedTypeName.length() - typeName.length();
if (packageLength <= 0) {
return typeName;
}
Strin... | java | public String getQualifiedTypeNameForFile() {
String typeName = getTypeNameForFile();
String qualifiedTypeName = mDoc.qualifiedTypeName();
int packageLength = qualifiedTypeName.length() - typeName.length();
if (packageLength <= 0) {
return typeName;
}
Strin... | [
"public",
"String",
"getQualifiedTypeNameForFile",
"(",
")",
"{",
"String",
"typeName",
"=",
"getTypeNameForFile",
"(",
")",
";",
"String",
"qualifiedTypeName",
"=",
"mDoc",
".",
"qualifiedTypeName",
"(",
")",
";",
"int",
"packageLength",
"=",
"qualifiedTypeName",
... | Converts inner class names. | [
"Converts",
"inner",
"class",
"names",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/build-tools/toolbox/src/main/java/org/teatrove/toolbox/beandoc/teadoc/ClassDoc.java#L201-L214 | train |
teatrove/teatrove | build-tools/toolbox/src/main/java/org/teatrove/toolbox/beandoc/teadoc/ClassDoc.java | ClassDoc.getMatchingMethod | public MethodDoc getMatchingMethod(MethodDoc method) {
MethodDoc[] methods = getMethods();
for (int i = 0; i < methods.length; i++) {
if (method.getName().equals(methods[i].getName()) &&
method.getSignature().equals(methods[i].getSignature())) {
return meth... | java | public MethodDoc getMatchingMethod(MethodDoc method) {
MethodDoc[] methods = getMethods();
for (int i = 0; i < methods.length; i++) {
if (method.getName().equals(methods[i].getName()) &&
method.getSignature().equals(methods[i].getSignature())) {
return meth... | [
"public",
"MethodDoc",
"getMatchingMethod",
"(",
"MethodDoc",
"method",
")",
"{",
"MethodDoc",
"[",
"]",
"methods",
"=",
"getMethods",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"methods",
".",
"length",
";",
"i",
"++",
")",
"{",... | Get a MethodDoc in this ClassDoc with a name and signature
matching that of the specified MethodDoc | [
"Get",
"a",
"MethodDoc",
"in",
"this",
"ClassDoc",
"with",
"a",
"name",
"and",
"signature",
"matching",
"that",
"of",
"the",
"specified",
"MethodDoc"
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/build-tools/toolbox/src/main/java/org/teatrove/toolbox/beandoc/teadoc/ClassDoc.java#L239-L251 | train |
teatrove/teatrove | build-tools/toolbox/src/main/java/org/teatrove/toolbox/beandoc/teadoc/ClassDoc.java | ClassDoc.getMatchingMethod | public MethodDoc getMatchingMethod(MethodDoc method, MethodFinder mf) {
MethodDoc md = getMatchingMethod(method);
if (md != null) {
if (mf.checkMethod(md)) {
return md;
}
}
return null;
} | java | public MethodDoc getMatchingMethod(MethodDoc method, MethodFinder mf) {
MethodDoc md = getMatchingMethod(method);
if (md != null) {
if (mf.checkMethod(md)) {
return md;
}
}
return null;
} | [
"public",
"MethodDoc",
"getMatchingMethod",
"(",
"MethodDoc",
"method",
",",
"MethodFinder",
"mf",
")",
"{",
"MethodDoc",
"md",
"=",
"getMatchingMethod",
"(",
"method",
")",
";",
"if",
"(",
"md",
"!=",
"null",
")",
"{",
"if",
"(",
"mf",
".",
"checkMethod",... | Get a MethodDoc in this ClassDoc with a name and signature
matching that of the specified MethodDoc and accepted by the
specified MethodFinder | [
"Get",
"a",
"MethodDoc",
"in",
"this",
"ClassDoc",
"with",
"a",
"name",
"and",
"signature",
"matching",
"that",
"of",
"the",
"specified",
"MethodDoc",
"and",
"accepted",
"by",
"the",
"specified",
"MethodFinder"
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/build-tools/toolbox/src/main/java/org/teatrove/toolbox/beandoc/teadoc/ClassDoc.java#L258-L268 | train |
teatrove/teatrove | build-tools/toolbox/src/main/java/org/teatrove/toolbox/beandoc/teadoc/ClassDoc.java | ClassDoc.findMatchingMethod | public MethodDoc findMatchingMethod(MethodDoc method, MethodFinder mf) {
// Look in this class's interface set
MethodDoc md = findMatchingInterfaceMethod(method, mf);
if (md != null) {
return md;
}
// Look in this class's superclass ancestry
ClassDoc superC... | java | public MethodDoc findMatchingMethod(MethodDoc method, MethodFinder mf) {
// Look in this class's interface set
MethodDoc md = findMatchingInterfaceMethod(method, mf);
if (md != null) {
return md;
}
// Look in this class's superclass ancestry
ClassDoc superC... | [
"public",
"MethodDoc",
"findMatchingMethod",
"(",
"MethodDoc",
"method",
",",
"MethodFinder",
"mf",
")",
"{",
"// Look in this class's interface set",
"MethodDoc",
"md",
"=",
"findMatchingInterfaceMethod",
"(",
"method",
",",
"mf",
")",
";",
"if",
"(",
"md",
"!=",
... | Find a MethodDoc with a name and signature
matching that of the specified MethodDoc and accepted by the
specified MethodFinder. This method searches the interfaces and
super class ancestry of the class represented by this ClassDoc for
a matching method. | [
"Find",
"a",
"MethodDoc",
"with",
"a",
"name",
"and",
"signature",
"matching",
"that",
"of",
"the",
"specified",
"MethodDoc",
"and",
"accepted",
"by",
"the",
"specified",
"MethodFinder",
".",
"This",
"method",
"searches",
"the",
"interfaces",
"and",
"super",
"... | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/build-tools/toolbox/src/main/java/org/teatrove/toolbox/beandoc/teadoc/ClassDoc.java#L277-L299 | train |
teatrove/teatrove | build-tools/toolbox/src/main/java/org/teatrove/toolbox/beandoc/teadoc/Doc.java | Doc.getTagValue | public String getTagValue(String tagName) {
Tag[] tags = getTagMap().get(tagName);
if (tags == null || tags.length == 0) {
return null;
}
return tags[tags.length - 1].getText();
} | java | public String getTagValue(String tagName) {
Tag[] tags = getTagMap().get(tagName);
if (tags == null || tags.length == 0) {
return null;
}
return tags[tags.length - 1].getText();
} | [
"public",
"String",
"getTagValue",
"(",
"String",
"tagName",
")",
"{",
"Tag",
"[",
"]",
"tags",
"=",
"getTagMap",
"(",
")",
".",
"get",
"(",
"tagName",
")",
";",
"if",
"(",
"tags",
"==",
"null",
"||",
"tags",
".",
"length",
"==",
"0",
")",
"{",
"... | Gets the text value of the first tag in doc that matches tagName | [
"Gets",
"the",
"text",
"value",
"of",
"the",
"first",
"tag",
"in",
"doc",
"that",
"matches",
"tagName"
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/build-tools/toolbox/src/main/java/org/teatrove/toolbox/beandoc/teadoc/Doc.java#L79-L87 | train |
teatrove/teatrove | tea/src/main/java/org/teatrove/tea/util/BeanAnalyzer.java | BeanAnalyzer.getAllProperties | public static Map<String, PropertyDescriptor>
getAllProperties(GenericType root)
throws IntrospectionException {
Map<String, PropertyDescriptor> properties =
cPropertiesCache.get(root);
if (properties == null) {
GenericType rootType = root.getRootType();
... | java | public static Map<String, PropertyDescriptor>
getAllProperties(GenericType root)
throws IntrospectionException {
Map<String, PropertyDescriptor> properties =
cPropertiesCache.get(root);
if (properties == null) {
GenericType rootType = root.getRootType();
... | [
"public",
"static",
"Map",
"<",
"String",
",",
"PropertyDescriptor",
">",
"getAllProperties",
"(",
"GenericType",
"root",
")",
"throws",
"IntrospectionException",
"{",
"Map",
"<",
"String",
",",
"PropertyDescriptor",
">",
"properties",
"=",
"cPropertiesCache",
".",
... | A function that returns a Map of all the available properties on
a given class including write-only properties. The properties returned
is mostly a superset of those returned from the standard JavaBeans
Introspector except pure indexed properties are discarded.
<p>Interfaces receive all the properties available in Obj... | [
"A",
"function",
"that",
"returns",
"a",
"Map",
"of",
"all",
"the",
"available",
"properties",
"on",
"a",
"given",
"class",
"including",
"write",
"-",
"only",
"properties",
".",
"The",
"properties",
"returned",
"is",
"mostly",
"a",
"superset",
"of",
"those",... | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/tea/src/main/java/org/teatrove/tea/util/BeanAnalyzer.java#L98-L117 | train |
teatrove/teatrove | build-tools/teatools/src/main/java/org/teatrove/teatools/TeaCompiler.java | TeaCompiler.findTemplateName | public static String findTemplateName(org.teatrove.tea.compiler.Scanner scanner) {
// System.out.println("<-- findTemplateName -->");
Token token;
String name = null;
try {
while (((token = scanner.readToken()).getID()) != Token.EOF) {
/*
Syste... | java | public static String findTemplateName(org.teatrove.tea.compiler.Scanner scanner) {
// System.out.println("<-- findTemplateName -->");
Token token;
String name = null;
try {
while (((token = scanner.readToken()).getID()) != Token.EOF) {
/*
Syste... | [
"public",
"static",
"String",
"findTemplateName",
"(",
"org",
".",
"teatrove",
".",
"tea",
".",
"compiler",
".",
"Scanner",
"scanner",
")",
"{",
"// System.out.println(\"<-- findTemplateName -->\");",
"Token",
"token",
";",
"String",
"name",
"=",
"null",
";",
"try... | Finds the name of the template using the specified tea scanner.
@param scanner the Tea scanner.
@return the name of the template | [
"Finds",
"the",
"name",
"of",
"the",
"template",
"using",
"the",
"specified",
"tea",
"scanner",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/build-tools/teatools/src/main/java/org/teatrove/teatools/TeaCompiler.java#L51-L78 | train |
teatrove/teatrove | build-tools/teatools/src/main/java/org/teatrove/teatools/TeaCompiler.java | TeaCompiler.parseTeaTemplate | public Template parseTeaTemplate(String templateName) throws IOException {
if (templateName == null) {
return null;
}
preserveParseTree(templateName);
compile(templateName);
CompilationUnit unit = getCompilationUnit(templateName, null);
if (unit == null) {
... | java | public Template parseTeaTemplate(String templateName) throws IOException {
if (templateName == null) {
return null;
}
preserveParseTree(templateName);
compile(templateName);
CompilationUnit unit = getCompilationUnit(templateName, null);
if (unit == null) {
... | [
"public",
"Template",
"parseTeaTemplate",
"(",
"String",
"templateName",
")",
"throws",
"IOException",
"{",
"if",
"(",
"templateName",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"preserveParseTree",
"(",
"templateName",
")",
";",
"compile",
"(",
"temp... | Perform Tea "parsing." This method will compile the named template.
@param templateName the name of the template to parse
@return a Template object that represents the root node of the Tea
parse tree. | [
"Perform",
"Tea",
"parsing",
".",
"This",
"method",
"will",
"compile",
"the",
"named",
"template",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/build-tools/teatools/src/main/java/org/teatrove/teatools/TeaCompiler.java#L225-L239 | train |
teatrove/teatrove | tea/src/main/java/org/teatrove/tea/parsetree/NumberLiteral.java | NumberLiteral.isValueKnown | public boolean isValueKnown() {
Type type = getType();
if (type != null) {
Class<?> clazz = type.getObjectClass();
return Number.class.isAssignableFrom(clazz) ||
clazz.isAssignableFrom(Number.class);
}
else {
return false;
}
... | java | public boolean isValueKnown() {
Type type = getType();
if (type != null) {
Class<?> clazz = type.getObjectClass();
return Number.class.isAssignableFrom(clazz) ||
clazz.isAssignableFrom(Number.class);
}
else {
return false;
}
... | [
"public",
"boolean",
"isValueKnown",
"(",
")",
"{",
"Type",
"type",
"=",
"getType",
"(",
")",
";",
"if",
"(",
"type",
"!=",
"null",
")",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"type",
".",
"getObjectClass",
"(",
")",
";",
"return",
"Number",
".... | Value is known only if type is a number or can be assigned a number. | [
"Value",
"is",
"known",
"only",
"if",
"type",
"is",
"a",
"number",
"or",
"can",
"be",
"assigned",
"a",
"number",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/tea/src/main/java/org/teatrove/tea/parsetree/NumberLiteral.java#L96-L106 | train |
teatrove/teatrove | teaapps/src/main/java/org/teatrove/teaapps/contexts/ArrayContext.java | ArrayContext.cloneArray | public Object[] cloneArray(Object[] array) {
Class<?> clazz = array.getClass().getComponentType();
Object newArray = Array.newInstance(clazz, array.length);
System.arraycopy(array, 0, newArray, 0, array.length);
return (Object[]) newArray;
} | java | public Object[] cloneArray(Object[] array) {
Class<?> clazz = array.getClass().getComponentType();
Object newArray = Array.newInstance(clazz, array.length);
System.arraycopy(array, 0, newArray, 0, array.length);
return (Object[]) newArray;
} | [
"public",
"Object",
"[",
"]",
"cloneArray",
"(",
"Object",
"[",
"]",
"array",
")",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"array",
".",
"getClass",
"(",
")",
".",
"getComponentType",
"(",
")",
";",
"Object",
"newArray",
"=",
"Array",
".",
"newIns... | Clone the given array into a new instance of the same type and
dimensions. The values are directly copied by memory, so this is not
a deep clone operation. However, manipulation of the contents of the
array will not impact the given array.
@param array The array to clone
@return The new cloned array | [
"Clone",
"the",
"given",
"array",
"into",
"a",
"new",
"instance",
"of",
"the",
"same",
"type",
"and",
"dimensions",
".",
"The",
"values",
"are",
"directly",
"copied",
"by",
"memory",
"so",
"this",
"is",
"not",
"a",
"deep",
"clone",
"operation",
".",
"How... | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaapps/src/main/java/org/teatrove/teaapps/contexts/ArrayContext.java#L38-L43 | train |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/net/HttpClient.java | HttpClient.setHeader | public HttpClient setHeader(String name, Object value) {
if (mHeaders == null) {
mHeaders = new HttpHeaderMap();
}
mHeaders.put(name, value);
return this;
} | java | public HttpClient setHeader(String name, Object value) {
if (mHeaders == null) {
mHeaders = new HttpHeaderMap();
}
mHeaders.put(name, value);
return this;
} | [
"public",
"HttpClient",
"setHeader",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"mHeaders",
"==",
"null",
")",
"{",
"mHeaders",
"=",
"new",
"HttpHeaderMap",
"(",
")",
";",
"}",
"mHeaders",
".",
"put",
"(",
"name",
",",
"value",... | Set a header name-value pair to the request.
@return 'this', so that addtional calls may be chained together | [
"Set",
"a",
"header",
"name",
"-",
"value",
"pair",
"to",
"the",
"request",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/net/HttpClient.java#L116-L122 | train |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/net/HttpClient.java | HttpClient.addHeader | public HttpClient addHeader(String name, Object value) {
if (mHeaders == null) {
mHeaders = new HttpHeaderMap();
}
mHeaders.add(name, value);
return this;
} | java | public HttpClient addHeader(String name, Object value) {
if (mHeaders == null) {
mHeaders = new HttpHeaderMap();
}
mHeaders.add(name, value);
return this;
} | [
"public",
"HttpClient",
"addHeader",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"mHeaders",
"==",
"null",
")",
"{",
"mHeaders",
"=",
"new",
"HttpHeaderMap",
"(",
")",
";",
"}",
"mHeaders",
".",
"add",
"(",
"name",
",",
"value",... | Add a header name-value pair to the request in order for multiple values
to be specified.
@return 'this', so that addtional calls may be chained together | [
"Add",
"a",
"header",
"name",
"-",
"value",
"pair",
"to",
"the",
"request",
"in",
"order",
"for",
"multiple",
"values",
"to",
"be",
"specified",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/net/HttpClient.java#L130-L136 | train |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/net/HttpClient.java | HttpClient.getResponse | public Response getResponse(PostData postData)
throws ConnectException, SocketException
{
CheckedSocket socket = mFactory.getSocket(mSession);
try {
CharToByteBuffer request = new FastCharToByteBuffer
(new DefaultByteBuffer(), "8859_1");
request = new... | java | public Response getResponse(PostData postData)
throws ConnectException, SocketException
{
CheckedSocket socket = mFactory.getSocket(mSession);
try {
CharToByteBuffer request = new FastCharToByteBuffer
(new DefaultByteBuffer(), "8859_1");
request = new... | [
"public",
"Response",
"getResponse",
"(",
"PostData",
"postData",
")",
"throws",
"ConnectException",
",",
"SocketException",
"{",
"CheckedSocket",
"socket",
"=",
"mFactory",
".",
"getSocket",
"(",
"mSession",
")",
";",
"try",
"{",
"CharToByteBuffer",
"request",
"=... | Opens a connection, passes on the current request settings, and returns
the server's response. The optional PostData parameter is used to
supply post data to the server. The Content-Length header specifies
how much data will be read from the PostData InputStream. If it is not
specified, data will be read from the Input... | [
"Opens",
"a",
"connection",
"passes",
"on",
"the",
"current",
"request",
"settings",
"and",
"returns",
"the",
"server",
"s",
"response",
".",
"The",
"optional",
"PostData",
"parameter",
"is",
"used",
"to",
"supply",
"post",
"data",
"to",
"the",
"server",
"."... | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/net/HttpClient.java#L215-L279 | train |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/log/Log.java | Log.addRootLogListener | public void addRootLogListener(LogListener listener) {
if (mParent == null) {
addLogListener(listener);
}
else {
mParent.addRootLogListener(listener);
}
} | java | public void addRootLogListener(LogListener listener) {
if (mParent == null) {
addLogListener(listener);
}
else {
mParent.addRootLogListener(listener);
}
} | [
"public",
"void",
"addRootLogListener",
"(",
"LogListener",
"listener",
")",
"{",
"if",
"(",
"mParent",
"==",
"null",
")",
"{",
"addLogListener",
"(",
"listener",
")",
";",
"}",
"else",
"{",
"mParent",
".",
"addRootLogListener",
"(",
"listener",
")",
";",
... | adds a listener to the root log, the log with a null parent | [
"adds",
"a",
"listener",
"to",
"the",
"root",
"log",
"the",
"log",
"with",
"a",
"null",
"parent"
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/log/Log.java#L150-L157 | train |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/log/Log.java | Log.debug | public void debug(String s) {
if (isEnabled() && isDebugEnabled()) {
dispatchLogMessage(new LogEvent(this, LogEvent.DEBUG_TYPE, s));
}
} | java | public void debug(String s) {
if (isEnabled() && isDebugEnabled()) {
dispatchLogMessage(new LogEvent(this, LogEvent.DEBUG_TYPE, s));
}
} | [
"public",
"void",
"debug",
"(",
"String",
"s",
")",
"{",
"if",
"(",
"isEnabled",
"(",
")",
"&&",
"isDebugEnabled",
"(",
")",
")",
"{",
"dispatchLogMessage",
"(",
"new",
"LogEvent",
"(",
"this",
",",
"LogEvent",
".",
"DEBUG_TYPE",
",",
"s",
")",
")",
... | Simple method for logging a single debugging message. | [
"Simple",
"method",
"for",
"logging",
"a",
"single",
"debugging",
"message",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/log/Log.java#L233-L237 | train |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/log/Log.java | Log.debug | public void debug(Throwable t) {
if (isEnabled() && isDebugEnabled()) {
dispatchLogException(new LogEvent(this, LogEvent.DEBUG_TYPE, t));
}
} | java | public void debug(Throwable t) {
if (isEnabled() && isDebugEnabled()) {
dispatchLogException(new LogEvent(this, LogEvent.DEBUG_TYPE, t));
}
} | [
"public",
"void",
"debug",
"(",
"Throwable",
"t",
")",
"{",
"if",
"(",
"isEnabled",
"(",
")",
"&&",
"isDebugEnabled",
"(",
")",
")",
"{",
"dispatchLogException",
"(",
"new",
"LogEvent",
"(",
"this",
",",
"LogEvent",
".",
"DEBUG_TYPE",
",",
"t",
")",
")... | Simple method for logging a single debugging exception. | [
"Simple",
"method",
"for",
"logging",
"a",
"single",
"debugging",
"exception",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/log/Log.java#L242-L246 | train |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/log/Log.java | Log.info | public void info(String s) {
if (isEnabled() && isInfoEnabled()) {
dispatchLogMessage(new LogEvent(this, LogEvent.INFO_TYPE, s));
}
} | java | public void info(String s) {
if (isEnabled() && isInfoEnabled()) {
dispatchLogMessage(new LogEvent(this, LogEvent.INFO_TYPE, s));
}
} | [
"public",
"void",
"info",
"(",
"String",
"s",
")",
"{",
"if",
"(",
"isEnabled",
"(",
")",
"&&",
"isInfoEnabled",
"(",
")",
")",
"{",
"dispatchLogMessage",
"(",
"new",
"LogEvent",
"(",
"this",
",",
"LogEvent",
".",
"INFO_TYPE",
",",
"s",
")",
")",
";"... | Simple method for logging a single information message. | [
"Simple",
"method",
"for",
"logging",
"a",
"single",
"information",
"message",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/log/Log.java#L258-L262 | train |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/log/Log.java | Log.info | public void info(Throwable t) {
if (isEnabled() && isInfoEnabled()) {
dispatchLogException(new LogEvent(this, LogEvent.INFO_TYPE, t));
}
} | java | public void info(Throwable t) {
if (isEnabled() && isInfoEnabled()) {
dispatchLogException(new LogEvent(this, LogEvent.INFO_TYPE, t));
}
} | [
"public",
"void",
"info",
"(",
"Throwable",
"t",
")",
"{",
"if",
"(",
"isEnabled",
"(",
")",
"&&",
"isInfoEnabled",
"(",
")",
")",
"{",
"dispatchLogException",
"(",
"new",
"LogEvent",
"(",
"this",
",",
"LogEvent",
".",
"INFO_TYPE",
",",
"t",
")",
")",
... | Simple method for logging a single information exception. | [
"Simple",
"method",
"for",
"logging",
"a",
"single",
"information",
"exception",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/log/Log.java#L267-L271 | train |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/log/Log.java | Log.warn | public void warn(String s) {
if (isEnabled() && isWarnEnabled()) {
dispatchLogMessage(new LogEvent(this, LogEvent.WARN_TYPE, s));
}
} | java | public void warn(String s) {
if (isEnabled() && isWarnEnabled()) {
dispatchLogMessage(new LogEvent(this, LogEvent.WARN_TYPE, s));
}
} | [
"public",
"void",
"warn",
"(",
"String",
"s",
")",
"{",
"if",
"(",
"isEnabled",
"(",
")",
"&&",
"isWarnEnabled",
"(",
")",
")",
"{",
"dispatchLogMessage",
"(",
"new",
"LogEvent",
"(",
"this",
",",
"LogEvent",
".",
"WARN_TYPE",
",",
"s",
")",
")",
";"... | Simple method for logging a single warning message. | [
"Simple",
"method",
"for",
"logging",
"a",
"single",
"warning",
"message",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/log/Log.java#L283-L287 | train |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/log/Log.java | Log.warn | public void warn(Throwable t) {
if (isEnabled() && isWarnEnabled()) {
dispatchLogException(new LogEvent(this, LogEvent.WARN_TYPE, t));
}
} | java | public void warn(Throwable t) {
if (isEnabled() && isWarnEnabled()) {
dispatchLogException(new LogEvent(this, LogEvent.WARN_TYPE, t));
}
} | [
"public",
"void",
"warn",
"(",
"Throwable",
"t",
")",
"{",
"if",
"(",
"isEnabled",
"(",
")",
"&&",
"isWarnEnabled",
"(",
")",
")",
"{",
"dispatchLogException",
"(",
"new",
"LogEvent",
"(",
"this",
",",
"LogEvent",
".",
"WARN_TYPE",
",",
"t",
")",
")",
... | Simple method for logging a single warning exception. | [
"Simple",
"method",
"for",
"logging",
"a",
"single",
"warning",
"exception",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/log/Log.java#L292-L296 | train |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/log/Log.java | Log.error | public void error(String s) {
if (isEnabled() && isErrorEnabled()) {
dispatchLogMessage(new LogEvent(this, LogEvent.ERROR_TYPE, s));
}
} | java | public void error(String s) {
if (isEnabled() && isErrorEnabled()) {
dispatchLogMessage(new LogEvent(this, LogEvent.ERROR_TYPE, s));
}
} | [
"public",
"void",
"error",
"(",
"String",
"s",
")",
"{",
"if",
"(",
"isEnabled",
"(",
")",
"&&",
"isErrorEnabled",
"(",
")",
")",
"{",
"dispatchLogMessage",
"(",
"new",
"LogEvent",
"(",
"this",
",",
"LogEvent",
".",
"ERROR_TYPE",
",",
"s",
")",
")",
... | Simple method for logging a single error message. | [
"Simple",
"method",
"for",
"logging",
"a",
"single",
"error",
"message",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/log/Log.java#L308-L312 | train |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/log/Log.java | Log.error | public void error(Throwable t) {
if (isEnabled() && isErrorEnabled()) {
dispatchLogException(new LogEvent(this, LogEvent.ERROR_TYPE, t));
}
} | java | public void error(Throwable t) {
if (isEnabled() && isErrorEnabled()) {
dispatchLogException(new LogEvent(this, LogEvent.ERROR_TYPE, t));
}
} | [
"public",
"void",
"error",
"(",
"Throwable",
"t",
")",
"{",
"if",
"(",
"isEnabled",
"(",
")",
"&&",
"isErrorEnabled",
"(",
")",
")",
"{",
"dispatchLogException",
"(",
"new",
"LogEvent",
"(",
"this",
",",
"LogEvent",
".",
"ERROR_TYPE",
",",
"t",
")",
")... | Simple method for logging a single error exception. | [
"Simple",
"method",
"for",
"logging",
"a",
"single",
"error",
"exception",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/log/Log.java#L317-L321 | train |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/log/Log.java | Log.getChildren | public Log[] getChildren() {
Collection copy;
synchronized (mChildren) {
copy = new ArrayList(mChildren.size());
Iterator it = mChildren.iterator();
while (it.hasNext()) {
Log child = (Log)((WeakReference)it.next()).get();
if (child ==... | java | public Log[] getChildren() {
Collection copy;
synchronized (mChildren) {
copy = new ArrayList(mChildren.size());
Iterator it = mChildren.iterator();
while (it.hasNext()) {
Log child = (Log)((WeakReference)it.next()).get();
if (child ==... | [
"public",
"Log",
"[",
"]",
"getChildren",
"(",
")",
"{",
"Collection",
"copy",
";",
"synchronized",
"(",
"mChildren",
")",
"{",
"copy",
"=",
"new",
"ArrayList",
"(",
"mChildren",
".",
"size",
"(",
")",
")",
";",
"Iterator",
"it",
"=",
"mChildren",
".",... | Returns a copy of the children Logs. | [
"Returns",
"a",
"copy",
"of",
"the",
"children",
"Logs",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/log/Log.java#L326-L344 | train |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/log/Log.java | Log.setEnabled | public void setEnabled(boolean enabled) {
setEnabled(enabled, ENABLED_MASK);
if (enabled) {
Log parent;
if ((parent = mParent) != null) {
parent.setEnabled(true);
}
}
} | java | public void setEnabled(boolean enabled) {
setEnabled(enabled, ENABLED_MASK);
if (enabled) {
Log parent;
if ((parent = mParent) != null) {
parent.setEnabled(true);
}
}
} | [
"public",
"void",
"setEnabled",
"(",
"boolean",
"enabled",
")",
"{",
"setEnabled",
"(",
"enabled",
",",
"ENABLED_MASK",
")",
";",
"if",
"(",
"enabled",
")",
"{",
"Log",
"parent",
";",
"if",
"(",
"(",
"parent",
"=",
"mParent",
")",
"!=",
"null",
")",
... | When this Log is enabled, all parent Logs are also enabled. When this
Log is disabled, parent Logs are unaffected. | [
"When",
"this",
"Log",
"is",
"enabled",
"all",
"parent",
"Logs",
"are",
"also",
"enabled",
".",
"When",
"this",
"Log",
"is",
"disabled",
"parent",
"Logs",
"are",
"unaffected",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/log/Log.java#L379-L387 | train |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/log/Log.java | Log.applyProperties | public void applyProperties(Map properties) {
if (properties.containsKey("enabled")) {
setEnabled(!"false".equalsIgnoreCase
((String)properties.get("enabled")));
}
if (properties.containsKey("debug")) {
setDebugEnabled(!"false".equalsIgnoreCase
... | java | public void applyProperties(Map properties) {
if (properties.containsKey("enabled")) {
setEnabled(!"false".equalsIgnoreCase
((String)properties.get("enabled")));
}
if (properties.containsKey("debug")) {
setDebugEnabled(!"false".equalsIgnoreCase
... | [
"public",
"void",
"applyProperties",
"(",
"Map",
"properties",
")",
"{",
"if",
"(",
"properties",
".",
"containsKey",
"(",
"\"enabled\"",
")",
")",
"{",
"setEnabled",
"(",
"!",
"\"false\"",
".",
"equalsIgnoreCase",
"(",
"(",
"String",
")",
"properties",
".",... | Understands and applies the following boolean properties. True is the
default value if the value doesn't equal "false", ignoring case.
<ul>
<li>enabled
<li>debug
<li>info
<li>warn
<li>error
</ul> | [
"Understands",
"and",
"applies",
"the",
"following",
"boolean",
"properties",
".",
"True",
"is",
"the",
"default",
"value",
"if",
"the",
"value",
"doesn",
"t",
"equal",
"false",
"ignoring",
"case",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/log/Log.java#L481-L506 | train |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/util/BeanPropertyAccessor.java | BeanPropertyAccessor.getBeanProperties | private static PropertyDescriptor[][] getBeanProperties(Class<?> beanType) {
List<PropertyDescriptor> readProperties =
new ArrayList<PropertyDescriptor>();
List<PropertyDescriptor> writeProperties =
new ArrayList<PropertyDescriptor>();
try {
Map<?,... | java | private static PropertyDescriptor[][] getBeanProperties(Class<?> beanType) {
List<PropertyDescriptor> readProperties =
new ArrayList<PropertyDescriptor>();
List<PropertyDescriptor> writeProperties =
new ArrayList<PropertyDescriptor>();
try {
Map<?,... | [
"private",
"static",
"PropertyDescriptor",
"[",
"]",
"[",
"]",
"getBeanProperties",
"(",
"Class",
"<",
"?",
">",
"beanType",
")",
"{",
"List",
"<",
"PropertyDescriptor",
">",
"readProperties",
"=",
"new",
"ArrayList",
"<",
"PropertyDescriptor",
">",
"(",
")",
... | Returns two arrays of PropertyDescriptors. Array 0 has contains read
PropertyDescriptors, array 1 contains the write PropertyDescriptors. | [
"Returns",
"two",
"arrays",
"of",
"PropertyDescriptors",
".",
"Array",
"0",
"has",
"contains",
"read",
"PropertyDescriptors",
"array",
"1",
"contains",
"the",
"write",
"PropertyDescriptors",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/util/BeanPropertyAccessor.java#L419-L452 | train |
teatrove/teatrove | teaservlet/src/main/java/org/teatrove/teaservlet/ApplicationResponseImpl.java | ApplicationResponseImpl.writeShort | static void writeShort(OutputStream out, int i) throws IOException {
out.write((byte)i);
out.write((byte)(i >> 8));
} | java | static void writeShort(OutputStream out, int i) throws IOException {
out.write((byte)i);
out.write((byte)(i >> 8));
} | [
"static",
"void",
"writeShort",
"(",
"OutputStream",
"out",
",",
"int",
"i",
")",
"throws",
"IOException",
"{",
"out",
".",
"write",
"(",
"(",
"byte",
")",
"i",
")",
";",
"out",
".",
"write",
"(",
"(",
"byte",
")",
"(",
"i",
">>",
"8",
")",
")",
... | Writes a short in Intel byte order. | [
"Writes",
"a",
"short",
"in",
"Intel",
"byte",
"order",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaservlet/src/main/java/org/teatrove/teaservlet/ApplicationResponseImpl.java#L66-L69 | train |
teatrove/teatrove | teaservlet/src/main/java/org/teatrove/teaservlet/ApplicationResponseImpl.java | ApplicationResponseImpl.appendCompressed | void appendCompressed(ByteData compressed, ByteData original)
throws IOException
{
mCompressedSegments++;
mBuffer.appendSurrogate(new CompressedData(compressed, original));
} | java | void appendCompressed(ByteData compressed, ByteData original)
throws IOException
{
mCompressedSegments++;
mBuffer.appendSurrogate(new CompressedData(compressed, original));
} | [
"void",
"appendCompressed",
"(",
"ByteData",
"compressed",
",",
"ByteData",
"original",
")",
"throws",
"IOException",
"{",
"mCompressedSegments",
"++",
";",
"mBuffer",
".",
"appendSurrogate",
"(",
"new",
"CompressedData",
"(",
"compressed",
",",
"original",
")",
"... | Called from DetachedResponseImpl. | [
"Called",
"from",
"DetachedResponseImpl",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaservlet/src/main/java/org/teatrove/teaservlet/ApplicationResponseImpl.java#L366-L371 | train |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/util/DecimalConvertor.java | DecimalConvertor.toDecimalDigits | public static int toDecimalDigits(float v,
char[] digits, int offset, int maxDigits,
int maxFractDigits, int roundMode)
{
int bits = Float.floatToIntBits(v);
int f = bits & 0x7fffff;
int e = (bits >> 23) & 0xff;
... | java | public static int toDecimalDigits(float v,
char[] digits, int offset, int maxDigits,
int maxFractDigits, int roundMode)
{
int bits = Float.floatToIntBits(v);
int f = bits & 0x7fffff;
int e = (bits >> 23) & 0xff;
... | [
"public",
"static",
"int",
"toDecimalDigits",
"(",
"float",
"v",
",",
"char",
"[",
"]",
"digits",
",",
"int",
"offset",
",",
"int",
"maxDigits",
",",
"int",
"maxFractDigits",
",",
"int",
"roundMode",
")",
"{",
"int",
"bits",
"=",
"Float",
".",
"floatToIn... | Produces decimal digits for non-zero, finite floating point values.
The sign of the value is discarded. Passing in Infinity or NaN produces
invalid digits. The maximum number of decimal digits that this
function will likely produce is 9.
@param v value
@param digits buffer to receive decimal digits
@param offset offse... | [
"Produces",
"decimal",
"digits",
"for",
"non",
"-",
"zero",
"finite",
"floating",
"point",
"values",
".",
"The",
"sign",
"of",
"the",
"value",
"is",
"discarded",
".",
"Passing",
"in",
"Infinity",
"or",
"NaN",
"produces",
"invalid",
"digits",
".",
"The",
"m... | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/util/DecimalConvertor.java#L819-L836 | train |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/util/DecimalConvertor.java | DecimalConvertor.toDecimalDigits | public static int toDecimalDigits(double v,
char[] digits, int offset, int maxDigits,
int maxFractDigits, int roundMode)
{
// NOTE: The value 144115188075855872 is converted to
// 144115188075855870, which is as correct as p... | java | public static int toDecimalDigits(double v,
char[] digits, int offset, int maxDigits,
int maxFractDigits, int roundMode)
{
// NOTE: The value 144115188075855872 is converted to
// 144115188075855870, which is as correct as p... | [
"public",
"static",
"int",
"toDecimalDigits",
"(",
"double",
"v",
",",
"char",
"[",
"]",
"digits",
",",
"int",
"offset",
",",
"int",
"maxDigits",
",",
"int",
"maxFractDigits",
",",
"int",
"roundMode",
")",
"{",
"// NOTE: The value 144115188075855872 is converted t... | Produces decimal digits for non-zero, finite floating point values.
The sign of the value is discarded. Passing in Infinity or NaN produces
invalid digits. The maximum number of decimal digits that this
function will likely produce is 18.
@param v value
@param digits buffer to receive decimal digits
@param offset offs... | [
"Produces",
"decimal",
"digits",
"for",
"non",
"-",
"zero",
"finite",
"floating",
"point",
"values",
".",
"The",
"sign",
"of",
"the",
"value",
"is",
"discarded",
".",
"Passing",
"in",
"Infinity",
"or",
"NaN",
"produces",
"invalid",
"digits",
".",
"The",
"m... | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/util/DecimalConvertor.java#L853-L875 | train |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/util/tq/TransactionQueueData.java | TransactionQueueData.add | public TransactionQueueData add(TransactionQueueData data) {
return new TransactionQueueData
(null,
Math.min(mSnapshotStart, data.mSnapshotStart),
Math.max(mSnapshotEnd, data.mSnapshotEnd),
mQueueSize + data.mQueueSize,
mThreadCount + data.mThreadC... | java | public TransactionQueueData add(TransactionQueueData data) {
return new TransactionQueueData
(null,
Math.min(mSnapshotStart, data.mSnapshotStart),
Math.max(mSnapshotEnd, data.mSnapshotEnd),
mQueueSize + data.mQueueSize,
mThreadCount + data.mThreadC... | [
"public",
"TransactionQueueData",
"add",
"(",
"TransactionQueueData",
"data",
")",
"{",
"return",
"new",
"TransactionQueueData",
"(",
"null",
",",
"Math",
".",
"min",
"(",
"mSnapshotStart",
",",
"data",
".",
"mSnapshotStart",
")",
",",
"Math",
".",
"max",
"(",... | Adds TransactionQueueData to another. | [
"Adds",
"TransactionQueueData",
"to",
"another",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/util/tq/TransactionQueueData.java#L89-L109 | train |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/util/WrappedCache.java | WrappedCache.get | public Object get(Object key) {
Object value = mCacheMap.get(key);
if (value != null || mCacheMap.containsKey(key)) {
return value;
}
value = mBackingMap.get(key);
if (value != null || mBackingMap.containsKey(key)) {
mCacheMap.put(key, value);
}
... | java | public Object get(Object key) {
Object value = mCacheMap.get(key);
if (value != null || mCacheMap.containsKey(key)) {
return value;
}
value = mBackingMap.get(key);
if (value != null || mBackingMap.containsKey(key)) {
mCacheMap.put(key, value);
}
... | [
"public",
"Object",
"get",
"(",
"Object",
"key",
")",
"{",
"Object",
"value",
"=",
"mCacheMap",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"value",
"!=",
"null",
"||",
"mCacheMap",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"return",
"value",
... | Returns the value from the cache, or if not found, the backing map.
If the backing map is accessed, the value is saved in the cache for
future gets. | [
"Returns",
"the",
"value",
"from",
"the",
"cache",
"or",
"if",
"not",
"found",
"the",
"backing",
"map",
".",
"If",
"the",
"backing",
"map",
"is",
"accessed",
"the",
"value",
"is",
"saved",
"in",
"the",
"cache",
"for",
"future",
"gets",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/util/WrappedCache.java#L80-L90 | train |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/util/WrappedCache.java | WrappedCache.put | public Object put(Object key, Object value) {
mCacheMap.put(key, value);
return mBackingMap.put(key, value);
} | java | public Object put(Object key, Object value) {
mCacheMap.put(key, value);
return mBackingMap.put(key, value);
} | [
"public",
"Object",
"put",
"(",
"Object",
"key",
",",
"Object",
"value",
")",
"{",
"mCacheMap",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"mBackingMap",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Puts the entry into both the cache and backing map. The old value in
the backing map is returned. | [
"Puts",
"the",
"entry",
"into",
"both",
"the",
"cache",
"and",
"backing",
"map",
".",
"The",
"old",
"value",
"in",
"the",
"backing",
"map",
"is",
"returned",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/util/WrappedCache.java#L96-L99 | train |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/util/WrappedCache.java | WrappedCache.remove | public Object remove(Object key) {
mCacheMap.remove(key);
return mBackingMap.remove(key);
} | java | public Object remove(Object key) {
mCacheMap.remove(key);
return mBackingMap.remove(key);
} | [
"public",
"Object",
"remove",
"(",
"Object",
"key",
")",
"{",
"mCacheMap",
".",
"remove",
"(",
"key",
")",
";",
"return",
"mBackingMap",
".",
"remove",
"(",
"key",
")",
";",
"}"
] | Removes the key from both the cache and backing map. The old value in
the backing map is returned. | [
"Removes",
"the",
"key",
"from",
"both",
"the",
"cache",
"and",
"backing",
"map",
".",
"The",
"old",
"value",
"in",
"the",
"backing",
"map",
"is",
"returned",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/util/WrappedCache.java#L105-L108 | train |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/util/plugin/PluginConfigSupport.java | PluginConfigSupport.getPlugin | public Plugin getPlugin(String name) {
if (mPluginContext != null) {
return mPluginContext.getPlugin(name);
}
return null;
} | java | public Plugin getPlugin(String name) {
if (mPluginContext != null) {
return mPluginContext.getPlugin(name);
}
return null;
} | [
"public",
"Plugin",
"getPlugin",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"mPluginContext",
"!=",
"null",
")",
"{",
"return",
"mPluginContext",
".",
"getPlugin",
"(",
"name",
")",
";",
"}",
"return",
"null",
";",
"}"
] | Returns a Plugin by name.
@param name the name of the Plugin.
@return Plugin the Plugin object. | [
"Returns",
"a",
"Plugin",
"by",
"name",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/util/plugin/PluginConfigSupport.java#L66-L71 | train |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/util/plugin/PluginConfigSupport.java | PluginConfigSupport.getPlugins | public Plugin[] getPlugins() {
if (mPluginContext != null) {
Collection c = mPluginContext.getPlugins().values();
if (c != null) {
return (Plugin[])c.toArray(new Plugin[c.size()]);
}
}
return new Plugin[0];
} | java | public Plugin[] getPlugins() {
if (mPluginContext != null) {
Collection c = mPluginContext.getPlugins().values();
if (c != null) {
return (Plugin[])c.toArray(new Plugin[c.size()]);
}
}
return new Plugin[0];
} | [
"public",
"Plugin",
"[",
"]",
"getPlugins",
"(",
")",
"{",
"if",
"(",
"mPluginContext",
"!=",
"null",
")",
"{",
"Collection",
"c",
"=",
"mPluginContext",
".",
"getPlugins",
"(",
")",
".",
"values",
"(",
")",
";",
"if",
"(",
"c",
"!=",
"null",
")",
... | Returns an array of all of the Plugins.
@return the array of Plugins. | [
"Returns",
"an",
"array",
"of",
"all",
"of",
"the",
"Plugins",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/util/plugin/PluginConfigSupport.java#L78-L86 | train |
Azure/azure-sdk-for-java | eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/BaseLease.java | BaseLease.isOwnedBy | public boolean isOwnedBy(String possibleOwner) {
boolean retval = false;
if (this.owner != null) {
retval = (this.owner.compareTo(possibleOwner) == 0);
}
return retval;
} | java | public boolean isOwnedBy(String possibleOwner) {
boolean retval = false;
if (this.owner != null) {
retval = (this.owner.compareTo(possibleOwner) == 0);
}
return retval;
} | [
"public",
"boolean",
"isOwnedBy",
"(",
"String",
"possibleOwner",
")",
"{",
"boolean",
"retval",
"=",
"false",
";",
"if",
"(",
"this",
".",
"owner",
"!=",
"null",
")",
"{",
"retval",
"=",
"(",
"this",
".",
"owner",
".",
"compareTo",
"(",
"possibleOwner",... | Convenience function for comparing possibleOwner against this.owner
@param possibleOwner name to check
@return true if possibleOwner is the same as this.owner, false otherwise | [
"Convenience",
"function",
"for",
"comparing",
"possibleOwner",
"against",
"this",
".",
"owner"
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/BaseLease.java#L120-L126 | train |
Azure/azure-sdk-for-java | policy/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/policy/v2018_03_01/implementation/PolicySetDefinitionsInner.java | PolicySetDefinitionsInner.deleteAtManagementGroup | public void deleteAtManagementGroup(String policySetDefinitionName, String managementGroupId) {
deleteAtManagementGroupWithServiceResponseAsync(policySetDefinitionName, managementGroupId).toBlocking().single().body();
} | java | public void deleteAtManagementGroup(String policySetDefinitionName, String managementGroupId) {
deleteAtManagementGroupWithServiceResponseAsync(policySetDefinitionName, managementGroupId).toBlocking().single().body();
} | [
"public",
"void",
"deleteAtManagementGroup",
"(",
"String",
"policySetDefinitionName",
",",
"String",
"managementGroupId",
")",
"{",
"deleteAtManagementGroupWithServiceResponseAsync",
"(",
"policySetDefinitionName",
",",
"managementGroupId",
")",
".",
"toBlocking",
"(",
")",
... | Deletes a policy set definition.
This operation deletes the policy set definition in the given management group with the given name.
@param policySetDefinitionName The name of the policy set definition to delete.
@param managementGroupId The ID of the management group.
@throws IllegalArgumentException thrown if parame... | [
"Deletes",
"a",
"policy",
"set",
"definition",
".",
"This",
"operation",
"deletes",
"the",
"policy",
"set",
"definition",
"in",
"the",
"given",
"management",
"group",
"with",
"the",
"given",
"name",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policy/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/policy/v2018_03_01/implementation/PolicySetDefinitionsInner.java#L783-L785 | train |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowsInner.java | WorkflowsInner.delete | public void delete(String resourceGroupName, String workflowName) {
deleteWithServiceResponseAsync(resourceGroupName, workflowName).toBlocking().single().body();
} | java | public void delete(String resourceGroupName, String workflowName) {
deleteWithServiceResponseAsync(resourceGroupName, workflowName).toBlocking().single().body();
} | [
"public",
"void",
"delete",
"(",
"String",
"resourceGroupName",
",",
"String",
"workflowName",
")",
"{",
"deleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"workflowName",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
".",
"body",
"(",... | Deletes a workflow.
@param resourceGroupName The resource group name.
@param workflowName The workflow name.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeException all other wrapped checked exceptions if the ... | [
"Deletes",
"a",
"workflow",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowsInner.java#L881-L883 | train |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowsInner.java | WorkflowsInner.listByResourceGroupNextAsync | public Observable<Page<WorkflowInner>> listByResourceGroupNextAsync(final String nextPageLink) {
return listByResourceGroupNextWithServiceResponseAsync(nextPageLink)
.map(new Func1<ServiceResponse<Page<WorkflowInner>>, Page<WorkflowInner>>() {
@Override
public Page<Wo... | java | public Observable<Page<WorkflowInner>> listByResourceGroupNextAsync(final String nextPageLink) {
return listByResourceGroupNextWithServiceResponseAsync(nextPageLink)
.map(new Func1<ServiceResponse<Page<WorkflowInner>>, Page<WorkflowInner>>() {
@Override
public Page<Wo... | [
"public",
"Observable",
"<",
"Page",
"<",
"WorkflowInner",
">",
">",
"listByResourceGroupNextAsync",
"(",
"final",
"String",
"nextPageLink",
")",
"{",
"return",
"listByResourceGroupNextWithServiceResponseAsync",
"(",
"nextPageLink",
")",
".",
"map",
"(",
"new",
"Func1... | Gets a list of workflows by resource group.
@param nextPageLink The NextLink from the previous successful call to List operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<WorkflowInner> object | [
"Gets",
"a",
"list",
"of",
"workflows",
"by",
"resource",
"group",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowsInner.java#L2099-L2107 | train |
Azure/azure-sdk-for-java | kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersInner.java | ClustersInner.listByResourceGroupAsync | public Observable<Page<ClusterInner>> listByResourceGroupAsync(String resourceGroupName) {
return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1<ServiceResponse<List<ClusterInner>>, Page<ClusterInner>>() {
@Override
public Page<ClusterInner> call(ServiceResp... | java | public Observable<Page<ClusterInner>> listByResourceGroupAsync(String resourceGroupName) {
return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1<ServiceResponse<List<ClusterInner>>, Page<ClusterInner>>() {
@Override
public Page<ClusterInner> call(ServiceResp... | [
"public",
"Observable",
"<",
"Page",
"<",
"ClusterInner",
">",
">",
"listByResourceGroupAsync",
"(",
"String",
"resourceGroupName",
")",
"{",
"return",
"listByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
... | Lists all Kusto clusters within a resource group.
@param resourceGroupName The name of the resource group containing the Kusto cluster.
@return the observable to the List<ClusterInner> object | [
"Lists",
"all",
"Kusto",
"clusters",
"within",
"a",
"resource",
"group",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersInner.java#L1062-L1071 | train |
Azure/azure-sdk-for-java | mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/models/AssetDeliveryPolicy.java | AssetDeliveryPolicy.get | public static EntityGetOperation<AssetDeliveryPolicyInfo> get(String assetDeliveryPolicyId) {
return new DefaultGetOperation<AssetDeliveryPolicyInfo>(ENTITY_SET, assetDeliveryPolicyId,
AssetDeliveryPolicyInfo.class);
} | java | public static EntityGetOperation<AssetDeliveryPolicyInfo> get(String assetDeliveryPolicyId) {
return new DefaultGetOperation<AssetDeliveryPolicyInfo>(ENTITY_SET, assetDeliveryPolicyId,
AssetDeliveryPolicyInfo.class);
} | [
"public",
"static",
"EntityGetOperation",
"<",
"AssetDeliveryPolicyInfo",
">",
"get",
"(",
"String",
"assetDeliveryPolicyId",
")",
"{",
"return",
"new",
"DefaultGetOperation",
"<",
"AssetDeliveryPolicyInfo",
">",
"(",
"ENTITY_SET",
",",
"assetDeliveryPolicyId",
",",
"As... | Create an operation that will retrieve the given asset delivery policy
@param assetDeliveryPolicyId
id of asset delivery policy to retrieve
@return the operation | [
"Create",
"an",
"operation",
"that",
"will",
"retrieve",
"the",
"given",
"asset",
"delivery",
"policy"
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/models/AssetDeliveryPolicy.java#L132-L135 | train |
Azure/azure-sdk-for-java | mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/models/AssetDeliveryPolicy.java | AssetDeliveryPolicy.list | public static DefaultListOperation<AssetDeliveryPolicyInfo> list(LinkInfo<AssetDeliveryPolicyInfo> link) {
return new DefaultListOperation<AssetDeliveryPolicyInfo>(link.getHref(),
new GenericType<ListResult<AssetDeliveryPolicyInfo>>() {
});
} | java | public static DefaultListOperation<AssetDeliveryPolicyInfo> list(LinkInfo<AssetDeliveryPolicyInfo> link) {
return new DefaultListOperation<AssetDeliveryPolicyInfo>(link.getHref(),
new GenericType<ListResult<AssetDeliveryPolicyInfo>>() {
});
} | [
"public",
"static",
"DefaultListOperation",
"<",
"AssetDeliveryPolicyInfo",
">",
"list",
"(",
"LinkInfo",
"<",
"AssetDeliveryPolicyInfo",
">",
"link",
")",
"{",
"return",
"new",
"DefaultListOperation",
"<",
"AssetDeliveryPolicyInfo",
">",
"(",
"link",
".",
"getHref",
... | Create an operation that will list all the asset delivery policies at the
given link.
@param link
Link to request all the asset delivery policies.
@return The list operation. | [
"Create",
"an",
"operation",
"that",
"will",
"list",
"all",
"the",
"asset",
"delivery",
"policies",
"at",
"the",
"given",
"link",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/models/AssetDeliveryPolicy.java#L157-L161 | train |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabaseAdvisorsInner.java | DatabaseAdvisorsInner.listByDatabaseAsync | public Observable<AdvisorListResultInner> listByDatabaseAsync(String resourceGroupName, String serverName, String databaseName) {
return listByDatabaseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<AdvisorListResultInner>, AdvisorListResultInner>() {
... | java | public Observable<AdvisorListResultInner> listByDatabaseAsync(String resourceGroupName, String serverName, String databaseName) {
return listByDatabaseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<AdvisorListResultInner>, AdvisorListResultInner>() {
... | [
"public",
"Observable",
"<",
"AdvisorListResultInner",
">",
"listByDatabaseAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
")",
"{",
"return",
"listByDatabaseWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Returns a list of database advisors.
@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.
@param databaseName The name of the database.
@throws IllegalArgumentException ... | [
"Returns",
"a",
"list",
"of",
"database",
"advisors",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabaseAdvisorsInner.java#L109-L116 | train |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabaseAdvisorsInner.java | DatabaseAdvisorsInner.createOrUpdate | public AdvisorInner createOrUpdate(String resourceGroupName, String serverName, String databaseName, String advisorName, AutoExecuteStatus autoExecuteValue) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, advisorName, autoExecuteValue).toBlocking().single().body();
... | java | public AdvisorInner createOrUpdate(String resourceGroupName, String serverName, String databaseName, String advisorName, AutoExecuteStatus autoExecuteValue) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, advisorName, autoExecuteValue).toBlocking().single().body();
... | [
"public",
"AdvisorInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"advisorName",
",",
"AutoExecuteStatus",
"autoExecuteValue",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsyn... | Creates or updates a database advisor.
@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.
@param databaseName The name of the database.
@param advisorName The name of ... | [
"Creates",
"or",
"updates",
"a",
"database",
"advisor",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabaseAdvisorsInner.java#L277-L279 | train |
Azure/azure-sdk-for-java | authorization/msi-auth-token-provider-jar/src/main/java/com/microsoft/azure/msiAuthTokenProvider/MSICredentials.java | MSICredentials.getMSICredentials | public static MSICredentials getMSICredentials(String managementEndpoint) {
//check if we are running in a web app
String websiteName = System.getenv("WEBSITE_SITE_NAME");
if (websiteName != null && !websiteName.isEmpty()) {
// We are in a web app...
MSIConfigurationForA... | java | public static MSICredentials getMSICredentials(String managementEndpoint) {
//check if we are running in a web app
String websiteName = System.getenv("WEBSITE_SITE_NAME");
if (websiteName != null && !websiteName.isEmpty()) {
// We are in a web app...
MSIConfigurationForA... | [
"public",
"static",
"MSICredentials",
"getMSICredentials",
"(",
"String",
"managementEndpoint",
")",
"{",
"//check if we are running in a web app",
"String",
"websiteName",
"=",
"System",
".",
"getenv",
"(",
"\"WEBSITE_SITE_NAME\"",
")",
";",
"if",
"(",
"websiteName",
"... | This method checks if the env vars "MSI_ENDPOINT" and "MSI_SECRET" exist. If they do, we return the msi creds class for APP Svcs
otherwise we return one for VM
@param managementEndpoint Management endpoint in Azure
@return MSICredentials | [
"This",
"method",
"checks",
"if",
"the",
"env",
"vars",
"MSI_ENDPOINT",
"and",
"MSI_SECRET",
"exist",
".",
"If",
"they",
"do",
"we",
"return",
"the",
"msi",
"creds",
"class",
"for",
"APP",
"Svcs",
"otherwise",
"we",
"return",
"one",
"for",
"VM"
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/authorization/msi-auth-token-provider-jar/src/main/java/com/microsoft/azure/msiAuthTokenProvider/MSICredentials.java#L66-L79 | train |
Azure/azure-sdk-for-java | eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/FaultTolerantObject.java | FaultTolerantObject.unsafeGetIfOpened | T unsafeGetIfOpened() {
if (innerObject != null && innerObject.getState() == IOObject.IOObjectState.OPENED) {
return innerObject;
}
return null;
} | java | T unsafeGetIfOpened() {
if (innerObject != null && innerObject.getState() == IOObject.IOObjectState.OPENED) {
return innerObject;
}
return null;
} | [
"T",
"unsafeGetIfOpened",
"(",
")",
"{",
"if",
"(",
"innerObject",
"!=",
"null",
"&&",
"innerObject",
".",
"getState",
"(",
")",
"==",
"IOObject",
".",
"IOObjectState",
".",
"OPENED",
")",
"{",
"return",
"innerObject",
";",
"}",
"return",
"null",
";",
"}... | should be invoked from reactor thread | [
"should",
"be",
"invoked",
"from",
"reactor",
"thread"
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/FaultTolerantObject.java#L32-L38 | train |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TasksInner.java | TasksInner.delete | public void delete(String resourceGroupName, String registryName, String taskName) {
deleteWithServiceResponseAsync(resourceGroupName, registryName, taskName).toBlocking().last().body();
} | java | public void delete(String resourceGroupName, String registryName, String taskName) {
deleteWithServiceResponseAsync(resourceGroupName, registryName, taskName).toBlocking().last().body();
} | [
"public",
"void",
"delete",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"String",
"taskName",
")",
"{",
"deleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"registryName",
",",
"taskName",
")",
".",
"toBlocking",
"(",
")",
... | Deletes a specified task.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param taskName The name of the container registry task.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws C... | [
"Deletes",
"a",
"specified",
"task",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TasksInner.java#L513-L515 | train |
Azure/azure-sdk-for-java | applicationconfig/client/src/samples/java/PipelineSample.java | PipelineSample.main | public static void main(String[] args) throws NoSuchAlgorithmException, InvalidKeyException {
// The connection string value can be obtained by going to your App Configuration instance in the Azure portal
// and navigating to "Access Keys" page under the "Settings" section.
final String connect... | java | public static void main(String[] args) throws NoSuchAlgorithmException, InvalidKeyException {
// The connection string value can be obtained by going to your App Configuration instance in the Azure portal
// and navigating to "Access Keys" page under the "Settings" section.
final String connect... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeyException",
"{",
"// The connection string value can be obtained by going to your App Configuration instance in the Azure portal",
"// and navigating to \"A... | Runs the sample algorithm and demonstrates how to add a custom policy to the HTTP pipeline.
@param args Unused. Arguments to the program.
@throws NoSuchAlgorithmException when credentials cannot be created because the service cannot resolve the
HMAC-SHA256 algorithm.
@throws InvalidKeyException when credentials cannot... | [
"Runs",
"the",
"sample",
"algorithm",
"and",
"demonstrates",
"how",
"to",
"add",
"a",
"custom",
"policy",
"to",
"the",
"HTTP",
"pipeline",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationconfig/client/src/samples/java/PipelineSample.java#L36-L65 | train |
Azure/azure-sdk-for-java | eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/ConnectionStringBuilder.java | ConnectionStringBuilder.setEndpoint | public ConnectionStringBuilder setEndpoint(String namespaceName, String domainName) {
try {
this.endpoint = new URI(String.format(Locale.US, END_POINT_FORMAT, namespaceName, domainName));
} catch (URISyntaxException exception) {
throw new IllegalConnectionStringFormatException(
... | java | public ConnectionStringBuilder setEndpoint(String namespaceName, String domainName) {
try {
this.endpoint = new URI(String.format(Locale.US, END_POINT_FORMAT, namespaceName, domainName));
} catch (URISyntaxException exception) {
throw new IllegalConnectionStringFormatException(
... | [
"public",
"ConnectionStringBuilder",
"setEndpoint",
"(",
"String",
"namespaceName",
",",
"String",
"domainName",
")",
"{",
"try",
"{",
"this",
".",
"endpoint",
"=",
"new",
"URI",
"(",
"String",
".",
"format",
"(",
"Locale",
".",
"US",
",",
"END_POINT_FORMAT",
... | Set an endpoint which can be used to connect to the EventHub instance.
@param namespaceName the name of the namespace to connect to.
@param domainName identifies the domain the namespace is located in. For non-public and national clouds,
the domain will not be "servicebus.windows.net". Available options include:
- ... | [
"Set",
"an",
"endpoint",
"which",
"can",
"be",
"used",
"to",
"connect",
"to",
"the",
"EventHub",
"instance",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/ConnectionStringBuilder.java#L138-L147 | train |
Azure/azure-sdk-for-java | mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/implementation/ODataAtomMarshaller.java | ODataAtomMarshaller.marshalEntry | public void marshalEntry(Object content, OutputStream stream)
throws JAXBException {
marshaller.marshal(createEntry(content), stream);
} | java | public void marshalEntry(Object content, OutputStream stream)
throws JAXBException {
marshaller.marshal(createEntry(content), stream);
} | [
"public",
"void",
"marshalEntry",
"(",
"Object",
"content",
",",
"OutputStream",
"stream",
")",
"throws",
"JAXBException",
"{",
"marshaller",
".",
"marshal",
"(",
"createEntry",
"(",
"content",
")",
",",
"stream",
")",
";",
"}"
] | Convert the given content into an ATOM entry and write it to the given
stream.
@param content
Content object to send
@param stream
Stream to write to
@throws JAXBException
if content is malformed/not marshallable | [
"Convert",
"the",
"given",
"content",
"into",
"an",
"ATOM",
"entry",
"and",
"write",
"it",
"to",
"the",
"given",
"stream",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/implementation/ODataAtomMarshaller.java#L109-L112 | train |
Azure/azure-sdk-for-java | keyvault/resource-manager/v2016_10_01/src/main/java/com/microsoft/azure/management/keyvault/v2016_10_01/implementation/VaultsInner.java | VaultsInner.listByResourceGroupAsync | public Observable<Page<VaultInner>> listByResourceGroupAsync(final String resourceGroupName, final Integer top) {
return listByResourceGroupWithServiceResponseAsync(resourceGroupName, top)
.map(new Func1<ServiceResponse<Page<VaultInner>>, Page<VaultInner>>() {
@Override
... | java | public Observable<Page<VaultInner>> listByResourceGroupAsync(final String resourceGroupName, final Integer top) {
return listByResourceGroupWithServiceResponseAsync(resourceGroupName, top)
.map(new Func1<ServiceResponse<Page<VaultInner>>, Page<VaultInner>>() {
@Override
... | [
"public",
"Observable",
"<",
"Page",
"<",
"VaultInner",
">",
">",
"listByResourceGroupAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"Integer",
"top",
")",
"{",
"return",
"listByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | The List operation gets information about the vaults associated with the subscription and within the specified resource group.
@param resourceGroupName The name of the Resource Group to which the vault belongs.
@param top Maximum number of results to return.
@throws IllegalArgumentException thrown if parameters fail t... | [
"The",
"List",
"operation",
"gets",
"information",
"about",
"the",
"vaults",
"associated",
"with",
"the",
"subscription",
"and",
"within",
"the",
"specified",
"resource",
"group",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/resource-manager/v2016_10_01/src/main/java/com/microsoft/azure/management/keyvault/v2016_10_01/implementation/VaultsInner.java#L767-L775 | train |
Azure/azure-sdk-for-java | common/azure-common/src/main/java/com/azure/common/http/HttpPipelineCallContext.java | HttpPipelineCallContext.setData | public void setData(String key, Object value) {
this.data = this.data.addData(key, value);
} | java | public void setData(String key, Object value) {
this.data = this.data.addData(key, value);
} | [
"public",
"void",
"setData",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"this",
".",
"data",
"=",
"this",
".",
"data",
".",
"addData",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Stores a key-value data in the context.
@param key the key
@param value the value | [
"Stores",
"a",
"key",
"-",
"value",
"data",
"in",
"the",
"context",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/http/HttpPipelineCallContext.java#L57-L59 | train |
Azure/azure-sdk-for-java | mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/implementation/BatchMimeMultipart.java | BatchMimeMultipart.resetInputStreams | private void resetInputStreams() throws IOException, MessagingException {
for (int ix = 0; ix < this.getCount(); ix++) {
BodyPart part = this.getBodyPart(ix);
if (part.getContent() instanceof MimeMultipart) {
MimeMultipart subContent = (MimeMultipart) part.getContent();
... | java | private void resetInputStreams() throws IOException, MessagingException {
for (int ix = 0; ix < this.getCount(); ix++) {
BodyPart part = this.getBodyPart(ix);
if (part.getContent() instanceof MimeMultipart) {
MimeMultipart subContent = (MimeMultipart) part.getContent();
... | [
"private",
"void",
"resetInputStreams",
"(",
")",
"throws",
"IOException",
",",
"MessagingException",
"{",
"for",
"(",
"int",
"ix",
"=",
"0",
";",
"ix",
"<",
"this",
".",
"getCount",
"(",
")",
";",
"ix",
"++",
")",
"{",
"BodyPart",
"part",
"=",
"this",... | reset all input streams to allow redirect filter to write the output twice | [
"reset",
"all",
"input",
"streams",
"to",
"allow",
"redirect",
"filter",
"to",
"write",
"the",
"output",
"twice"
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/implementation/BatchMimeMultipart.java#L26-L39 | train |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/SessionsInner.java | SessionsInner.listByIntegrationAccountsNextAsync | public Observable<Page<IntegrationAccountSessionInner>> listByIntegrationAccountsNextAsync(final String nextPageLink) {
return listByIntegrationAccountsNextWithServiceResponseAsync(nextPageLink)
.map(new Func1<ServiceResponse<Page<IntegrationAccountSessionInner>>, Page<IntegrationAccountSessionInner... | java | public Observable<Page<IntegrationAccountSessionInner>> listByIntegrationAccountsNextAsync(final String nextPageLink) {
return listByIntegrationAccountsNextWithServiceResponseAsync(nextPageLink)
.map(new Func1<ServiceResponse<Page<IntegrationAccountSessionInner>>, Page<IntegrationAccountSessionInner... | [
"public",
"Observable",
"<",
"Page",
"<",
"IntegrationAccountSessionInner",
">",
">",
"listByIntegrationAccountsNextAsync",
"(",
"final",
"String",
"nextPageLink",
")",
"{",
"return",
"listByIntegrationAccountsNextWithServiceResponseAsync",
"(",
"nextPageLink",
")",
".",
"m... | Gets a list of integration account sessions.
@param nextPageLink The NextLink from the previous successful call to List operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<IntegrationAccountSessionInner> object | [
"Gets",
"a",
"list",
"of",
"integration",
"account",
"sessions",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/SessionsInner.java#L672-L680 | train |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/messagesecurity/JWSObject.java | JWSObject.deserialize | public static JWSObject deserialize(String json) throws IOException {
ObjectMapper mapper = new ObjectMapper();
return mapper.readValue(json, JWSObject.class);
} | java | public static JWSObject deserialize(String json) throws IOException {
ObjectMapper mapper = new ObjectMapper();
return mapper.readValue(json, JWSObject.class);
} | [
"public",
"static",
"JWSObject",
"deserialize",
"(",
"String",
"json",
")",
"throws",
"IOException",
"{",
"ObjectMapper",
"mapper",
"=",
"new",
"ObjectMapper",
"(",
")",
";",
"return",
"mapper",
".",
"readValue",
"(",
"json",
",",
"JWSObject",
".",
"class",
... | Construct JWSObject from json string.
@param json
json string.
@return Constructed JWSObject | [
"Construct",
"JWSObject",
"from",
"json",
"string",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/messagesecurity/JWSObject.java#L104-L107 | train |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/custom/KeyBundle.java | KeyBundle.keyIdentifier | public KeyIdentifier keyIdentifier() {
if (key() == null || key().kid() == null || key().kid().length() == 0) {
return null;
}
return new KeyIdentifier(key().kid());
} | java | public KeyIdentifier keyIdentifier() {
if (key() == null || key().kid() == null || key().kid().length() == 0) {
return null;
}
return new KeyIdentifier(key().kid());
} | [
"public",
"KeyIdentifier",
"keyIdentifier",
"(",
")",
"{",
"if",
"(",
"key",
"(",
")",
"==",
"null",
"||",
"key",
"(",
")",
".",
"kid",
"(",
")",
"==",
"null",
"||",
"key",
"(",
")",
".",
"kid",
"(",
")",
".",
"length",
"(",
")",
"==",
"0",
"... | The key identifier.
@return identifier for the key | [
"The",
"key",
"identifier",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/custom/KeyBundle.java#L40-L45 | train |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/authentication/ChallengeCache.java | ChallengeCache.getCachedChallenge | public Map<String, String> getCachedChallenge(HttpUrl url) {
if (url == null) {
return null;
}
String authority = getAuthority(url);
authority = authority.toLowerCase(Locale.ENGLISH);
return cachedChallenges.get(authority);
} | java | public Map<String, String> getCachedChallenge(HttpUrl url) {
if (url == null) {
return null;
}
String authority = getAuthority(url);
authority = authority.toLowerCase(Locale.ENGLISH);
return cachedChallenges.get(authority);
} | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getCachedChallenge",
"(",
"HttpUrl",
"url",
")",
"{",
"if",
"(",
"url",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"String",
"authority",
"=",
"getAuthority",
"(",
"url",
")",
";",
"authorit... | Uses authority to retrieve the cached values.
@param url
the url that is used as a cache key.
@return cached value or null if value is not available. | [
"Uses",
"authority",
"to",
"retrieve",
"the",
"cached",
"values",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/authentication/ChallengeCache.java#L26-L33 | train |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/authentication/ChallengeCache.java | ChallengeCache.addCachedChallenge | public void addCachedChallenge(HttpUrl url, Map<String, String> challenge) {
if (url == null || challenge == null) {
return;
}
String authority = getAuthority(url);
authority = authority.toLowerCase(Locale.ENGLISH);
cachedChallenges.put(authority, challenge);
} | java | public void addCachedChallenge(HttpUrl url, Map<String, String> challenge) {
if (url == null || challenge == null) {
return;
}
String authority = getAuthority(url);
authority = authority.toLowerCase(Locale.ENGLISH);
cachedChallenges.put(authority, challenge);
} | [
"public",
"void",
"addCachedChallenge",
"(",
"HttpUrl",
"url",
",",
"Map",
"<",
"String",
",",
"String",
">",
"challenge",
")",
"{",
"if",
"(",
"url",
"==",
"null",
"||",
"challenge",
"==",
"null",
")",
"{",
"return",
";",
"}",
"String",
"authority",
"... | Uses authority to cache challenge.
@param url
the url that is used as a cache key.
@param challenge
the challenge to cache. | [
"Uses",
"authority",
"to",
"cache",
"challenge",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/authentication/ChallengeCache.java#L43-L50 | train |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/authentication/ChallengeCache.java | ChallengeCache.getAuthority | public String getAuthority(HttpUrl url) {
String scheme = url.scheme();
String host = url.host();
int port = url.port();
StringBuilder builder = new StringBuilder();
if (scheme != null) {
builder.append(scheme).append("://");
}
builder.append(host);
... | java | public String getAuthority(HttpUrl url) {
String scheme = url.scheme();
String host = url.host();
int port = url.port();
StringBuilder builder = new StringBuilder();
if (scheme != null) {
builder.append(scheme).append("://");
}
builder.append(host);
... | [
"public",
"String",
"getAuthority",
"(",
"HttpUrl",
"url",
")",
"{",
"String",
"scheme",
"=",
"url",
".",
"scheme",
"(",
")",
";",
"String",
"host",
"=",
"url",
".",
"host",
"(",
")",
";",
"int",
"port",
"=",
"url",
".",
"port",
"(",
")",
";",
"S... | Gets authority of a url.
@param url
the url to get the authority for.
@return the authority. | [
"Gets",
"authority",
"of",
"a",
"url",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/authentication/ChallengeCache.java#L59-L72 | train |
Azure/azure-sdk-for-java | common/azure-common/src/main/java/com/azure/common/implementation/serializer/HttpResponseHeaderDecoder.java | HttpResponseHeaderDecoder.decode | static Mono<Object> decode(HttpResponse httpResponse, SerializerAdapter serializer, HttpResponseDecodeData decodeData) {
Type headerType = decodeData.headersType();
if (headerType == null) {
return Mono.empty();
} else {
return Mono.defer(() -> {
try {
... | java | static Mono<Object> decode(HttpResponse httpResponse, SerializerAdapter serializer, HttpResponseDecodeData decodeData) {
Type headerType = decodeData.headersType();
if (headerType == null) {
return Mono.empty();
} else {
return Mono.defer(() -> {
try {
... | [
"static",
"Mono",
"<",
"Object",
">",
"decode",
"(",
"HttpResponse",
"httpResponse",
",",
"SerializerAdapter",
"serializer",
",",
"HttpResponseDecodeData",
"decodeData",
")",
"{",
"Type",
"headerType",
"=",
"decodeData",
".",
"headersType",
"(",
")",
";",
"if",
... | Decode headers of the http response.
The decoding happens when caller subscribed to the returned {@code Mono<Object>},
if the response header is not decodable then {@code Mono.empty()} will be returned.
@param httpResponse the response containing the headers to be decoded
@param serializer the adapter to use for deco... | [
"Decode",
"headers",
"of",
"the",
"http",
"response",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/implementation/serializer/HttpResponseHeaderDecoder.java#L38-L51 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.