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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
googleads/googleads-java-lib | modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/v201805/CustomField.java | CustomField.getVisibility | public com.google.api.ads.admanager.axis.v201805.CustomFieldVisibility getVisibility() {
return visibility;
} | java | public com.google.api.ads.admanager.axis.v201805.CustomFieldVisibility getVisibility() {
return visibility;
} | [
"public",
"com",
".",
"google",
".",
"api",
".",
"ads",
".",
"admanager",
".",
"axis",
".",
"v201805",
".",
"CustomFieldVisibility",
"getVisibility",
"(",
")",
"{",
"return",
"visibility",
";",
"}"
] | Gets the visibility value for this CustomField.
@return visibility * How visible/accessible this field is in the UI. | [
"Gets",
"the",
"visibility",
"value",
"for",
"this",
"CustomField",
"."
] | 967957cc4f6076514e3a7926fe653e4f1f7cc9c9 | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/v201805/CustomField.java#L248-L250 | train |
googleads/googleads-java-lib | modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/v201808/ProductTemplate.java | ProductTemplate.setProductTemplateMarketplaceInfo | public void setProductTemplateMarketplaceInfo(com.google.api.ads.admanager.axis.v201808.ProductTemplateMarketplaceInfo productTemplateMarketplaceInfo) {
this.productTemplateMarketplaceInfo = productTemplateMarketplaceInfo;
} | java | public void setProductTemplateMarketplaceInfo(com.google.api.ads.admanager.axis.v201808.ProductTemplateMarketplaceInfo productTemplateMarketplaceInfo) {
this.productTemplateMarketplaceInfo = productTemplateMarketplaceInfo;
} | [
"public",
"void",
"setProductTemplateMarketplaceInfo",
"(",
"com",
".",
"google",
".",
"api",
".",
"ads",
".",
"admanager",
".",
"axis",
".",
"v201808",
".",
"ProductTemplateMarketplaceInfo",
"productTemplateMarketplaceInfo",
")",
"{",
"this",
".",
"productTemplateMar... | Sets the productTemplateMarketplaceInfo value for this ProductTemplate.
@param productTemplateMarketplaceInfo * Marketplace information of this {@code ProductTemplate}.
<span class="constraint Applicable">This attribute
is applicable when:<ul><li>using programmatic guaranteed, using sales
management.</li></ul></span... | [
"Sets",
"the",
"productTemplateMarketplaceInfo",
"value",
"for",
"this",
"ProductTemplate",
"."
] | 967957cc4f6076514e3a7926fe653e4f1f7cc9c9 | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/v201808/ProductTemplate.java#L1458-L1460 | train |
googleads/googleads-java-lib | modules/ads_lib/src/main/java/com/google/api/ads/common/lib/soap/AuthorizationHeaderHandler.java | AuthorizationHeaderHandler.setAuthorization | @SuppressWarnings("unchecked") /* See constructor comments. */
public void setAuthorization(Object soapClient, AdsSession adsSession)
throws AuthenticationException {
final String authorizationHeader =
authorizationHeaderProvider.getAuthorizationHeader(adsSession,
soapClientHandler.getEn... | java | @SuppressWarnings("unchecked") /* See constructor comments. */
public void setAuthorization(Object soapClient, AdsSession adsSession)
throws AuthenticationException {
final String authorizationHeader =
authorizationHeaderProvider.getAuthorizationHeader(adsSession,
soapClientHandler.getEn... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"/* See constructor comments. */",
"public",
"void",
"setAuthorization",
"(",
"Object",
"soapClient",
",",
"AdsSession",
"adsSession",
")",
"throws",
"AuthenticationException",
"{",
"final",
"String",
"authorizationHeader"... | Sets the authorization header created from the session on the soap client.
@param soapClient the SOAP client to set the HTTP header on
@param adsSession the session
@throws AuthenticationException if the authorization header could not be
created | [
"Sets",
"the",
"authorization",
"header",
"created",
"from",
"the",
"session",
"on",
"the",
"soap",
"client",
"."
] | 967957cc4f6076514e3a7926fe653e4f1f7cc9c9 | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/ads_lib/src/main/java/com/google/api/ads/common/lib/soap/AuthorizationHeaderHandler.java#L61-L72 | train |
googleads/googleads-java-lib | modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201809/cm/TrialAsyncErrorPage.java | TrialAsyncErrorPage.getEntries | public com.google.api.ads.adwords.axis.v201809.cm.TrialAsyncError[] getEntries() {
return entries;
} | java | public com.google.api.ads.adwords.axis.v201809.cm.TrialAsyncError[] getEntries() {
return entries;
} | [
"public",
"com",
".",
"google",
".",
"api",
".",
"ads",
".",
"adwords",
".",
"axis",
".",
"v201809",
".",
"cm",
".",
"TrialAsyncError",
"[",
"]",
"getEntries",
"(",
")",
"{",
"return",
"entries",
";",
"}"
] | Gets the entries value for this TrialAsyncErrorPage.
@return entries | [
"Gets",
"the",
"entries",
"value",
"for",
"this",
"TrialAsyncErrorPage",
"."
] | 967957cc4f6076514e3a7926fe653e4f1f7cc9c9 | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201809/cm/TrialAsyncErrorPage.java#L62-L64 | train |
googleads/googleads-java-lib | modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201809/cm/AppUrl.java | AppUrl.getOsType | public com.google.api.ads.adwords.axis.v201809.cm.AppUrlOsType getOsType() {
return osType;
} | java | public com.google.api.ads.adwords.axis.v201809.cm.AppUrlOsType getOsType() {
return osType;
} | [
"public",
"com",
".",
"google",
".",
"api",
".",
"ads",
".",
"adwords",
".",
"axis",
".",
"v201809",
".",
"cm",
".",
"AppUrlOsType",
"getOsType",
"(",
")",
"{",
"return",
"osType",
";",
"}"
] | Gets the osType value for this AppUrl.
@return osType * The operating system targeted by this url.
<span class="constraint Required">This field is required
and should not be {@code null}.</span> | [
"Gets",
"the",
"osType",
"value",
"for",
"this",
"AppUrl",
"."
] | 967957cc4f6076514e3a7926fe653e4f1f7cc9c9 | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201809/cm/AppUrl.java#L83-L85 | train |
googleads/googleads-java-lib | modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/v201808/BaseFlashCreative.java | BaseFlashCreative.getFallbackImageAsset | public com.google.api.ads.admanager.axis.v201808.CreativeAsset getFallbackImageAsset() {
return fallbackImageAsset;
} | java | public com.google.api.ads.admanager.axis.v201808.CreativeAsset getFallbackImageAsset() {
return fallbackImageAsset;
} | [
"public",
"com",
".",
"google",
".",
"api",
".",
"ads",
".",
"admanager",
".",
"axis",
".",
"v201808",
".",
"CreativeAsset",
"getFallbackImageAsset",
"(",
")",
"{",
"return",
"fallbackImageAsset",
";",
"}"
] | Gets the fallbackImageAsset value for this BaseFlashCreative.
@return fallbackImageAsset * The image asset to fall back on if the flash creative cannot
be loaded. To view
the fallback image, use the {@link CreativeAsset#assetUrl}. | [
"Gets",
"the",
"fallbackImageAsset",
"value",
"for",
"this",
"BaseFlashCreative",
"."
] | 967957cc4f6076514e3a7926fe653e4f1f7cc9c9 | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/v201808/BaseFlashCreative.java#L259-L261 | train |
googleads/googleads-java-lib | modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/v201808/BaseFlashCreative.java | BaseFlashCreative.setFallbackImageAsset | public void setFallbackImageAsset(com.google.api.ads.admanager.axis.v201808.CreativeAsset fallbackImageAsset) {
this.fallbackImageAsset = fallbackImageAsset;
} | java | public void setFallbackImageAsset(com.google.api.ads.admanager.axis.v201808.CreativeAsset fallbackImageAsset) {
this.fallbackImageAsset = fallbackImageAsset;
} | [
"public",
"void",
"setFallbackImageAsset",
"(",
"com",
".",
"google",
".",
"api",
".",
"ads",
".",
"admanager",
".",
"axis",
".",
"v201808",
".",
"CreativeAsset",
"fallbackImageAsset",
")",
"{",
"this",
".",
"fallbackImageAsset",
"=",
"fallbackImageAsset",
";",
... | Sets the fallbackImageAsset value for this BaseFlashCreative.
@param fallbackImageAsset * The image asset to fall back on if the flash creative cannot
be loaded. To view
the fallback image, use the {@link CreativeAsset#assetUrl}. | [
"Sets",
"the",
"fallbackImageAsset",
"value",
"for",
"this",
"BaseFlashCreative",
"."
] | 967957cc4f6076514e3a7926fe653e4f1f7cc9c9 | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/v201808/BaseFlashCreative.java#L271-L273 | train |
googleads/googleads-java-lib | modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201809/cm/AdCustomizerFeed.java | AdCustomizerFeed.getFeedStatus | public com.google.api.ads.adwords.axis.v201809.cm.FeedStatus getFeedStatus() {
return feedStatus;
} | java | public com.google.api.ads.adwords.axis.v201809.cm.FeedStatus getFeedStatus() {
return feedStatus;
} | [
"public",
"com",
".",
"google",
".",
"api",
".",
"ads",
".",
"adwords",
".",
"axis",
".",
"v201809",
".",
"cm",
".",
"FeedStatus",
"getFeedStatus",
"(",
")",
"{",
"return",
"feedStatus",
";",
"}"
] | Gets the feedStatus value for this AdCustomizerFeed.
@return feedStatus * Status of the feed.
<span class="constraint Selectable">This field can
be selected using the value "FeedStatus".</span><span class="constraint
Filterable">This field can be filtered on.</span>
<span class="constraint ReadOnly">This field is re... | [
"Gets",
"the",
"feedStatus",
"value",
"for",
"this",
"AdCustomizerFeed",
"."
] | 967957cc4f6076514e3a7926fe653e4f1f7cc9c9 | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201809/cm/AdCustomizerFeed.java#L179-L181 | train |
googleads/googleads-java-lib | modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201809/cm/AdCustomizerFeed.java | AdCustomizerFeed.getFeedAttributes | public com.google.api.ads.adwords.axis.v201809.cm.AdCustomizerFeedAttribute[] getFeedAttributes() {
return feedAttributes;
} | java | public com.google.api.ads.adwords.axis.v201809.cm.AdCustomizerFeedAttribute[] getFeedAttributes() {
return feedAttributes;
} | [
"public",
"com",
".",
"google",
".",
"api",
".",
"ads",
".",
"adwords",
".",
"axis",
".",
"v201809",
".",
"cm",
".",
"AdCustomizerFeedAttribute",
"[",
"]",
"getFeedAttributes",
"(",
")",
"{",
"return",
"feedAttributes",
";",
"}"
] | Gets the feedAttributes value for this AdCustomizerFeed.
@return feedAttributes * The AdCustomizerFeed's schema. In SET operations, these attributes
will be considered new
attributes and will be appended to the existing list
of attributes unless this list is an exact
copy of the existing list (as would be obtained v... | [
"Gets",
"the",
"feedAttributes",
"value",
"for",
"this",
"AdCustomizerFeed",
"."
] | 967957cc4f6076514e3a7926fe653e4f1f7cc9c9 | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201809/cm/AdCustomizerFeed.java#L216-L218 | train |
googleads/googleads-java-lib | modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201809/rm/RuleBasedUserList.java | RuleBasedUserList.getPrepopulationStatus | public com.google.api.ads.adwords.axis.v201809.rm.RuleBasedUserListPrepopulationStatus getPrepopulationStatus() {
return prepopulationStatus;
} | java | public com.google.api.ads.adwords.axis.v201809.rm.RuleBasedUserListPrepopulationStatus getPrepopulationStatus() {
return prepopulationStatus;
} | [
"public",
"com",
".",
"google",
".",
"api",
".",
"ads",
".",
"adwords",
".",
"axis",
".",
"v201809",
".",
"rm",
".",
"RuleBasedUserListPrepopulationStatus",
"getPrepopulationStatus",
"(",
")",
"{",
"return",
"prepopulationStatus",
";",
"}"
] | Gets the prepopulationStatus value for this RuleBasedUserList.
@return prepopulationStatus * Status of pre-population. The field is default to NONE if not
set which means the previous
users will not be considered. If set to REQUESTED,
past site visitors or app users who match
the list definition will be included in ... | [
"Gets",
"the",
"prepopulationStatus",
"value",
"for",
"this",
"RuleBasedUserList",
"."
] | 967957cc4f6076514e3a7926fe653e4f1f7cc9c9 | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201809/rm/RuleBasedUserList.java#L134-L136 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/numbers/NumbersClient.java | NumbersClient.buyNumber | public void buyNumber(String country, String msisdn) throws IOException, NexmoClientException {
this.buyNumber.execute(new BuyNumberRequest(country, msisdn));
} | java | public void buyNumber(String country, String msisdn) throws IOException, NexmoClientException {
this.buyNumber.execute(new BuyNumberRequest(country, msisdn));
} | [
"public",
"void",
"buyNumber",
"(",
"String",
"country",
",",
"String",
"msisdn",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"this",
".",
"buyNumber",
".",
"execute",
"(",
"new",
"BuyNumberRequest",
"(",
"country",
",",
"msisdn",
")",
")",... | Start renting a Nexmo Virtual Number.
@param country A String containing a 2-character ISO country code.
@param msisdn The phone number to be bought.
@throws IOException if an error occurs contacting the Nexmo API
@throws NexmoClientException if an error is returned by the server. | [
"Start",
"renting",
"a",
"Nexmo",
"Virtual",
"Number",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/numbers/NumbersClient.java#L100-L102 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/numbers/NumbersClient.java | NumbersClient.cancelNumber | public void cancelNumber(String country, String msisdn) throws IOException, NexmoClientException {
this.cancelNumber.execute(new CancelNumberRequest(country, msisdn));
} | java | public void cancelNumber(String country, String msisdn) throws IOException, NexmoClientException {
this.cancelNumber.execute(new CancelNumberRequest(country, msisdn));
} | [
"public",
"void",
"cancelNumber",
"(",
"String",
"country",
",",
"String",
"msisdn",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"this",
".",
"cancelNumber",
".",
"execute",
"(",
"new",
"CancelNumberRequest",
"(",
"country",
",",
"msisdn",
")... | Stop renting a Nexmo Virtual Number.
@param country A String containing a 2-character ISO country code.
@param msisdn The phone number to be cancelled.
@throws IOException if an error occurs contacting the Nexmo API
@throws NexmoClientException if an error is returned by the server. | [
"Stop",
"renting",
"a",
"Nexmo",
"Virtual",
"Number",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/numbers/NumbersClient.java#L112-L114 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/numbers/NumbersClient.java | NumbersClient.linkNumber | public void linkNumber(String msisdn, String country, String appId) throws IOException, NexmoClientException {
UpdateNumberRequest request = new UpdateNumberRequest(msisdn, country);
request.setVoiceCallbackType(UpdateNumberRequest.CallbackType.APP);
request.setVoiceCallbackValue(appId);
... | java | public void linkNumber(String msisdn, String country, String appId) throws IOException, NexmoClientException {
UpdateNumberRequest request = new UpdateNumberRequest(msisdn, country);
request.setVoiceCallbackType(UpdateNumberRequest.CallbackType.APP);
request.setVoiceCallbackValue(appId);
... | [
"public",
"void",
"linkNumber",
"(",
"String",
"msisdn",
",",
"String",
"country",
",",
"String",
"appId",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"UpdateNumberRequest",
"request",
"=",
"new",
"UpdateNumberRequest",
"(",
"msisdn",
",",
"cou... | Link a given Nexmo Virtual Number to a Nexmo Application with the given ID.
@param msisdn The Nexmo Virtual Number to be updated.
@param country The country for the given msisdn.
@param appId The ID for the Nexmo Application to be associated with the number.
@throws IOException if an error occurs contactin... | [
"Link",
"a",
"given",
"Nexmo",
"Virtual",
"Number",
"to",
"a",
"Nexmo",
"Application",
"with",
"the",
"given",
"ID",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/numbers/NumbersClient.java#L136-L141 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/legacyutils/XmlParser.java | XmlParser.parseXml | public Document parseXml(String xml) throws NexmoResponseParseException {
// TODO: Maybe an Error subclass for XML initialization errors, as these are serious and unexpected.
Document doc;
this.documentBuilderLock.lock();
try {
if (this.documentBuilder == null) {
... | java | public Document parseXml(String xml) throws NexmoResponseParseException {
// TODO: Maybe an Error subclass for XML initialization errors, as these are serious and unexpected.
Document doc;
this.documentBuilderLock.lock();
try {
if (this.documentBuilder == null) {
... | [
"public",
"Document",
"parseXml",
"(",
"String",
"xml",
")",
"throws",
"NexmoResponseParseException",
"{",
"// TODO: Maybe an Error subclass for XML initialization errors, as these are serious and unexpected.",
"Document",
"doc",
";",
"this",
".",
"documentBuilderLock",
".",
"loc... | Parse a provided XML String and return the generated DOM Document.
@param xml A String containing XML.
@return A Document generated from the parsed XML.
@throws NexmoResponseParseException If there is a problem initializing the XML parser or parsing the XML. | [
"Parse",
"a",
"provided",
"XML",
"String",
"and",
"return",
"the",
"generated",
"DOM",
"Document",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/legacyutils/XmlParser.java#L53-L69 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/insight/AdvancedInsightRequest.java | AdvancedInsightRequest.withNumberAndCountry | public static AdvancedInsightRequest withNumberAndCountry(String number, String country) {
return new Builder(number).country(country).build();
} | java | public static AdvancedInsightRequest withNumberAndCountry(String number, String country) {
return new Builder(number).country(country).build();
} | [
"public",
"static",
"AdvancedInsightRequest",
"withNumberAndCountry",
"(",
"String",
"number",
",",
"String",
"country",
")",
"{",
"return",
"new",
"Builder",
"(",
"number",
")",
".",
"country",
"(",
"country",
")",
".",
"build",
"(",
")",
";",
"}"
] | Construct a AdvancedInsightRequest with a number and country.
@param number A single phone number that you need insight about in national or international format.
@param country If a number does not have a country code or it is uncertain, set the two-character country code.
@return A new {@link AdvancedInsightReques... | [
"Construct",
"a",
"AdvancedInsightRequest",
"with",
"a",
"number",
"and",
"country",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/insight/AdvancedInsightRequest.java#L63-L65 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/voice/VoiceClient.java | VoiceClient.sendDtmf | public DtmfResponse sendDtmf(String uuid, String digits) throws IOException, NexmoClientException {
return dtmf.put(uuid, digits);
} | java | public DtmfResponse sendDtmf(String uuid, String digits) throws IOException, NexmoClientException {
return dtmf.put(uuid, digits);
} | [
"public",
"DtmfResponse",
"sendDtmf",
"(",
"String",
"uuid",
",",
"String",
"digits",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"return",
"dtmf",
".",
"put",
"(",
"uuid",
",",
"digits",
")",
";",
"}"
] | Send DTMF codes to an ongoing call.
@param uuid (required) The UUID of the call, obtained from the object returned by {@link #createCall(Call)}.
This value can be obtained with {@link CallEvent#getUuid()}
@param digits (required) A string specifying the digits to be sent to the call. Valid characters are the digits
... | [
"Send",
"DTMF",
"codes",
"to",
"an",
"ongoing",
"call",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/voice/VoiceClient.java#L130-L132 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/voice/VoiceClient.java | VoiceClient.transferCall | public ModifyCallResponse transferCall(String uuid, String nccoUrl) throws IOException, NexmoClientException {
return this.modifyCall(CallModifier.transferCall(uuid, nccoUrl));
} | java | public ModifyCallResponse transferCall(String uuid, String nccoUrl) throws IOException, NexmoClientException {
return this.modifyCall(CallModifier.transferCall(uuid, nccoUrl));
} | [
"public",
"ModifyCallResponse",
"transferCall",
"(",
"String",
"uuid",
",",
"String",
"nccoUrl",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"return",
"this",
".",
"modifyCall",
"(",
"CallModifier",
".",
"transferCall",
"(",
"uuid",
",",
"nccoU... | Transfer a call to a different NCCO endpoint.
@param uuid The UUID of the call, obtained from the object returned by {@link #createCall(Call)}. This value can
be obtained with {@link CallEvent#getUuid()}
@param nccoUrl The URL of the NCCO endpoint the call should be transferred to
@return A ModifyCallResponse obje... | [
"Transfer",
"a",
"call",
"to",
"a",
"different",
"NCCO",
"endpoint",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/voice/VoiceClient.java#L188-L190 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/voice/VoiceClient.java | VoiceClient.startStream | public StreamResponse startStream(String uuid, String streamUrl, int loop) throws IOException, NexmoClientException {
return streams.put(new StreamRequest(uuid, streamUrl, loop));
} | java | public StreamResponse startStream(String uuid, String streamUrl, int loop) throws IOException, NexmoClientException {
return streams.put(new StreamRequest(uuid, streamUrl, loop));
} | [
"public",
"StreamResponse",
"startStream",
"(",
"String",
"uuid",
",",
"String",
"streamUrl",
",",
"int",
"loop",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"return",
"streams",
".",
"put",
"(",
"new",
"StreamRequest",
"(",
"uuid",
",",
"s... | Stream audio to an ongoing call.
@param uuid The UUID of the call, obtained from the object returned by {@link #createCall(Call)}. This value can
be obtained with {@link CallEvent#getUuid()}
@param streamUrl A URL of an audio file in MP3 or 16-bit WAV format, to be streamed to the call.
@param loop The numbe... | [
"Stream",
"audio",
"to",
"an",
"ongoing",
"call",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/voice/VoiceClient.java#L206-L208 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/auth/MD5Util.java | MD5Util.calculateMd5 | public static String calculateMd5(String input) throws NoSuchAlgorithmException {
try {
return calculateMd5(input, "UTF-8");
} catch (UnsupportedEncodingException e) {
return null; // -- impossible --
}
} | java | public static String calculateMd5(String input) throws NoSuchAlgorithmException {
try {
return calculateMd5(input, "UTF-8");
} catch (UnsupportedEncodingException e) {
return null; // -- impossible --
}
} | [
"public",
"static",
"String",
"calculateMd5",
"(",
"String",
"input",
")",
"throws",
"NoSuchAlgorithmException",
"{",
"try",
"{",
"return",
"calculateMd5",
"(",
"input",
",",
"\"UTF-8\"",
")",
";",
"}",
"catch",
"(",
"UnsupportedEncodingException",
"e",
")",
"{"... | Calculates MD5 hash for string. assume string is UTF-8 encoded
@param input string which is going to be encoded into MD5 format
@return MD5 representation of the input string
@throws NoSuchAlgorithmException if the MD5 algorithm is not available. | [
"Calculates",
"MD5",
"hash",
"for",
"string",
".",
"assume",
"string",
"is",
"UTF",
"-",
"8",
"encoded"
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/auth/MD5Util.java#L42-L48 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/auth/MD5Util.java | MD5Util.calculateMd5 | public static String calculateMd5(String input, String encoding) throws NoSuchAlgorithmException, UnsupportedEncodingException {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(input.getBytes(encoding));
byte digest[] = md.digest();
final StringBuilder hexString = new Str... | java | public static String calculateMd5(String input, String encoding) throws NoSuchAlgorithmException, UnsupportedEncodingException {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(input.getBytes(encoding));
byte digest[] = md.digest();
final StringBuilder hexString = new Str... | [
"public",
"static",
"String",
"calculateMd5",
"(",
"String",
"input",
",",
"String",
"encoding",
")",
"throws",
"NoSuchAlgorithmException",
",",
"UnsupportedEncodingException",
"{",
"MessageDigest",
"md",
"=",
"MessageDigest",
".",
"getInstance",
"(",
"\"MD5\"",
")",
... | Calculates MD5 hash for string.
@param input string which is going to be encoded into MD5 format
@param encoding character encoding of the string which is going to be encoded into MD5 format
@return MD5 representation of the input string
@throws NoSuchAlgorithmException if the MD5 algorithm is not available.
@throws U... | [
"Calculates",
"MD5",
"hash",
"for",
"string",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/auth/MD5Util.java#L58-L72 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/conversion/ConversionClient.java | ConversionClient.submitConversion | public void submitConversion(ConversionRequest.Type type,
String messageId,
boolean delivered,
Date timestamp) throws IOException, NexmoClientException {
this.conversionEndpoint.submitConversion(new ConversionRequ... | java | public void submitConversion(ConversionRequest.Type type,
String messageId,
boolean delivered,
Date timestamp) throws IOException, NexmoClientException {
this.conversionEndpoint.submitConversion(new ConversionRequ... | [
"public",
"void",
"submitConversion",
"(",
"ConversionRequest",
".",
"Type",
"type",
",",
"String",
"messageId",
",",
"boolean",
"delivered",
",",
"Date",
"timestamp",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"this",
".",
"conversionEndpoint",... | Submit a request to the Conversion API indicating whether or not a message was delivered.
@param type The {@link ConversionRequest.Type} type of com.nexmo.client.conversion.
@param messageId The id of the message that was sent.
@param delivered A boolean indicating whether or not it was delivered.
@param timestam... | [
"Submit",
"a",
"request",
"to",
"the",
"Conversion",
"API",
"indicating",
"whether",
"or",
"not",
"a",
"message",
"was",
"delivered",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/conversion/ConversionClient.java#L60-L65 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/sms/SmsClient.java | SmsClient.searchMessages | public SearchSmsResponse searchMessages(String id, String... ids) throws IOException, NexmoClientException {
List<String> idList = new ArrayList<>(ids.length + 1);
idList.add(id);
idList.addAll(Arrays.asList(ids));
return this.searchMessages(new SmsIdSearchRequest(idList));
} | java | public SearchSmsResponse searchMessages(String id, String... ids) throws IOException, NexmoClientException {
List<String> idList = new ArrayList<>(ids.length + 1);
idList.add(id);
idList.addAll(Arrays.asList(ids));
return this.searchMessages(new SmsIdSearchRequest(idList));
} | [
"public",
"SearchSmsResponse",
"searchMessages",
"(",
"String",
"id",
",",
"String",
"...",
"ids",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"List",
"<",
"String",
">",
"idList",
"=",
"new",
"ArrayList",
"<>",
"(",
"ids",
".",
"length",
... | Search for completed SMS transactions by ID
@param id the first ID to look up
@param ids optional extra IDs to look up
@return SMS data matching the provided criteria | [
"Search",
"for",
"completed",
"SMS",
"transactions",
"by",
"ID"
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/sms/SmsClient.java#L99-L104 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/sms/SmsClient.java | SmsClient.searchMessages | public SearchSmsResponse searchMessages(Date date, String to) throws IOException, NexmoClientException {
return this.searchMessages(new SmsDateSearchRequest(date, to));
} | java | public SearchSmsResponse searchMessages(Date date, String to) throws IOException, NexmoClientException {
return this.searchMessages(new SmsDateSearchRequest(date, to));
} | [
"public",
"SearchSmsResponse",
"searchMessages",
"(",
"Date",
"date",
",",
"String",
"to",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"return",
"this",
".",
"searchMessages",
"(",
"new",
"SmsDateSearchRequest",
"(",
"date",
",",
"to",
")",
"... | Search for completed SMS transactions by date and recipient MSISDN.
@param date the date of the SMS message to be looked up
@param to the MSISDN number of the SMS recipient
@return SMS data matching the provided criteria | [
"Search",
"for",
"completed",
"SMS",
"transactions",
"by",
"date",
"and",
"recipient",
"MSISDN",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/sms/SmsClient.java#L114-L116 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/sms/SmsClient.java | SmsClient.searchRejectedMessages | public SearchRejectedMessagesResponse searchRejectedMessages(Date date, String to) throws IOException, NexmoClientException {
return this.searchRejectedMessages(new SearchRejectedMessagesRequest(date, to));
} | java | public SearchRejectedMessagesResponse searchRejectedMessages(Date date, String to) throws IOException, NexmoClientException {
return this.searchRejectedMessages(new SearchRejectedMessagesRequest(date, to));
} | [
"public",
"SearchRejectedMessagesResponse",
"searchRejectedMessages",
"(",
"Date",
"date",
",",
"String",
"to",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"return",
"this",
".",
"searchRejectedMessages",
"(",
"new",
"SearchRejectedMessagesRequest",
"(... | Search for rejected SMS transactions by date and recipient MSISDN.
@param date the date of the rejected SMS message to be looked up
@param to the MSISDN number of the SMS recipient
@return rejection data matching the provided criteria | [
"Search",
"for",
"rejected",
"SMS",
"transactions",
"by",
"date",
"and",
"recipient",
"MSISDN",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/sms/SmsClient.java#L137-L139 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/account/AccountClient.java | AccountClient.getPrefixPrice | public PrefixPricingResponse getPrefixPrice(ServiceType type, String prefix) throws IOException, NexmoClientException {
return getPrefixPrice(new PrefixPricingRequest(type, prefix));
} | java | public PrefixPricingResponse getPrefixPrice(ServiceType type, String prefix) throws IOException, NexmoClientException {
return getPrefixPrice(new PrefixPricingRequest(type, prefix));
} | [
"public",
"PrefixPricingResponse",
"getPrefixPrice",
"(",
"ServiceType",
"type",
",",
"String",
"prefix",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"return",
"getPrefixPrice",
"(",
"new",
"PrefixPricingRequest",
"(",
"type",
",",
"prefix",
")",
... | Retrieve the pricing for a specified prefix.
@param type The type of service to retrieve pricing for.
@param prefix The prefix to retrieve the pricing for.
@return PrefixPricingResponse object which contains the results from the API.
@throws IOException if a network error occurred contacting the Nexmo Acc... | [
"Retrieve",
"the",
"pricing",
"for",
"a",
"specified",
"prefix",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/account/AccountClient.java#L108-L110 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/account/AccountClient.java | AccountClient.getSecret | public SecretResponse getSecret(String apiKey, String secretId) throws IOException, NexmoClientException {
return getSecret(new SecretRequest(apiKey, secretId));
} | java | public SecretResponse getSecret(String apiKey, String secretId) throws IOException, NexmoClientException {
return getSecret(new SecretRequest(apiKey, secretId));
} | [
"public",
"SecretResponse",
"getSecret",
"(",
"String",
"apiKey",
",",
"String",
"secretId",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"return",
"getSecret",
"(",
"new",
"SecretRequest",
"(",
"apiKey",
",",
"secretId",
")",
")",
";",
"}"
] | Get information for a specific secret id associated to a given API key.
@param apiKey The API key that the secret is associated to.
@param secretId The id of the secret to get information on.
@return SecretResponse object which contains the results from the API.
@throws IOException if a network error occu... | [
"Get",
"information",
"for",
"a",
"specific",
"secret",
"id",
"associated",
"to",
"a",
"given",
"API",
"key",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/account/AccountClient.java#L159-L161 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/account/AccountClient.java | AccountClient.createSecret | public SecretResponse createSecret(String apiKey, String secret) throws IOException, NexmoClientException {
return createSecret(new CreateSecretRequest(apiKey, secret));
} | java | public SecretResponse createSecret(String apiKey, String secret) throws IOException, NexmoClientException {
return createSecret(new CreateSecretRequest(apiKey, secret));
} | [
"public",
"SecretResponse",
"createSecret",
"(",
"String",
"apiKey",
",",
"String",
"secret",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"return",
"createSecret",
"(",
"new",
"CreateSecretRequest",
"(",
"apiKey",
",",
"secret",
")",
")",
";",
... | Create a secret to be used with a specific API key.
@param apiKey The API key that the secret is to be used with.
@param secret The contents of the secret.
@return SecretResponse object which contains the created secret from the API.
@throws IOException if a network error occurred contacting the Nexmo Accou... | [
"Create",
"a",
"secret",
"to",
"be",
"used",
"with",
"a",
"specific",
"API",
"key",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/account/AccountClient.java#L178-L180 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/account/AccountClient.java | AccountClient.revokeSecret | public void revokeSecret(String apiKey, String secretId) throws IOException, NexmoClientException {
revokeSecret(new SecretRequest(apiKey, secretId));
} | java | public void revokeSecret(String apiKey, String secretId) throws IOException, NexmoClientException {
revokeSecret(new SecretRequest(apiKey, secretId));
} | [
"public",
"void",
"revokeSecret",
"(",
"String",
"apiKey",
",",
"String",
"secretId",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"revokeSecret",
"(",
"new",
"SecretRequest",
"(",
"apiKey",
",",
"secretId",
")",
")",
";",
"}"
] | Revoke a secret associated with a specific API key.
@param apiKey The API key that the secret is associated to.
@param secretId The id of the secret to revoke.
@throws IOException if a network error occurred contacting the Nexmo Account API
@throws NexmoClientException if there was a problem wit hthe Nexmo... | [
"Revoke",
"a",
"secret",
"associated",
"with",
"a",
"specific",
"API",
"key",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/account/AccountClient.java#L195-L197 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/insight/StandardInsightRequest.java | StandardInsightRequest.withNumberAndCountry | public static StandardInsightRequest withNumberAndCountry(String number, String country) {
return new Builder(number).country(country).build();
} | java | public static StandardInsightRequest withNumberAndCountry(String number, String country) {
return new Builder(number).country(country).build();
} | [
"public",
"static",
"StandardInsightRequest",
"withNumberAndCountry",
"(",
"String",
"number",
",",
"String",
"country",
")",
"{",
"return",
"new",
"Builder",
"(",
"number",
")",
".",
"country",
"(",
"country",
")",
".",
"build",
"(",
")",
";",
"}"
] | Construct a StandardInsightRequest with a number and country.
@param number A single phone number that you need insight about in national or international format.
@param country If a number does not have a country code or it is uncertain, set the two-character country code.
@return A new {@link StandardInsightReques... | [
"Construct",
"a",
"StandardInsightRequest",
"with",
"a",
"number",
"and",
"country",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/insight/StandardInsightRequest.java#L58-L60 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/NexmoClient.java | NexmoClient.generateJwt | public String generateJwt() throws NexmoUnacceptableAuthException {
JWTAuthMethod authMethod = this.httpWrapper.getAuthCollection().getAuth(JWTAuthMethod.class);
return authMethod.constructToken(System.currentTimeMillis() / 1000L, JWTAuthMethod.constructJTI());
} | java | public String generateJwt() throws NexmoUnacceptableAuthException {
JWTAuthMethod authMethod = this.httpWrapper.getAuthCollection().getAuth(JWTAuthMethod.class);
return authMethod.constructToken(System.currentTimeMillis() / 1000L, JWTAuthMethod.constructJTI());
} | [
"public",
"String",
"generateJwt",
"(",
")",
"throws",
"NexmoUnacceptableAuthException",
"{",
"JWTAuthMethod",
"authMethod",
"=",
"this",
".",
"httpWrapper",
".",
"getAuthCollection",
"(",
")",
".",
"getAuth",
"(",
"JWTAuthMethod",
".",
"class",
")",
";",
"return"... | Generate a JWT for the application the client has been configured with.
@return A String containing the token data.
@throws NexmoUnacceptableAuthException if no {@link JWTAuthMethod} is available | [
"Generate",
"a",
"JWT",
"for",
"the",
"application",
"the",
"client",
"has",
"been",
"configured",
"with",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/NexmoClient.java#L131-L134 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/insight/BasicInsightRequest.java | BasicInsightRequest.withNumberAndCountry | public static BasicInsightRequest withNumberAndCountry(String number, String country) {
return new Builder(number).country(country).build();
} | java | public static BasicInsightRequest withNumberAndCountry(String number, String country) {
return new Builder(number).country(country).build();
} | [
"public",
"static",
"BasicInsightRequest",
"withNumberAndCountry",
"(",
"String",
"number",
",",
"String",
"country",
")",
"{",
"return",
"new",
"Builder",
"(",
"number",
")",
".",
"country",
"(",
"country",
")",
".",
"build",
"(",
")",
";",
"}"
] | Construct a BasicInsightRequest with a number and country.
@param number A single phone number that you need insight about in national or international format.
@param country If a number does not have a country code or it is uncertain, set the two-character country code.
@return A new {@link BasicInsightRequest} obj... | [
"Construct",
"a",
"BasicInsightRequest",
"with",
"a",
"number",
"and",
"country",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/insight/BasicInsightRequest.java#L49-L51 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/auth/AuthCollection.java | AuthCollection.getAuth | public <T extends AuthMethod> T getAuth(Class<T> type) throws NexmoUnacceptableAuthException {
for (AuthMethod availableAuthMethod : this.authList) {
if (type.isInstance(availableAuthMethod)) {
return (T) availableAuthMethod;
}
}
throw new NexmoUnacceptabl... | java | public <T extends AuthMethod> T getAuth(Class<T> type) throws NexmoUnacceptableAuthException {
for (AuthMethod availableAuthMethod : this.authList) {
if (type.isInstance(availableAuthMethod)) {
return (T) availableAuthMethod;
}
}
throw new NexmoUnacceptabl... | [
"public",
"<",
"T",
"extends",
"AuthMethod",
">",
"T",
"getAuth",
"(",
"Class",
"<",
"T",
">",
"type",
")",
"throws",
"NexmoUnacceptableAuthException",
"{",
"for",
"(",
"AuthMethod",
"availableAuthMethod",
":",
"this",
".",
"authList",
")",
"{",
"if",
"(",
... | Obtain an AuthMethod of type T, if one is contained in this collection.
@param type The type of AuthMethod to be located
@param <T> The type of AuthMethod which will be returned
@return An AuthMethod subclass matching type
@throws NexmoUnacceptableAuthException if no matching AuthMethod is found. | [
"Obtain",
"an",
"AuthMethod",
"of",
"type",
"T",
"if",
"one",
"is",
"contained",
"in",
"this",
"collection",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/auth/AuthCollection.java#L72-L79 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/sms/HexUtil.java | HexUtil.bytesToHex | public static String bytesToHex(byte[] bytes, String separator) {
StringBuilder tmpBuffer = new StringBuilder();
if (bytes != null) {
for (byte c : bytes) {
int b = c;
if (b < 0)
b += 256;
if (separator != null)
... | java | public static String bytesToHex(byte[] bytes, String separator) {
StringBuilder tmpBuffer = new StringBuilder();
if (bytes != null) {
for (byte c : bytes) {
int b = c;
if (b < 0)
b += 256;
if (separator != null)
... | [
"public",
"static",
"String",
"bytesToHex",
"(",
"byte",
"[",
"]",
"bytes",
",",
"String",
"separator",
")",
"{",
"StringBuilder",
"tmpBuffer",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"bytes",
"!=",
"null",
")",
"{",
"for",
"(",
"byte",
... | translate a byte array of raw data into a String with a hex representation of that data.
Each octet will be separated with a specific separator.
@param bytes raw binary data
@param separator This string will be injected into the output in between each octet in the stream
@return String Hex representation of the raw d... | [
"translate",
"a",
"byte",
"array",
"of",
"raw",
"data",
"into",
"a",
"String",
"with",
"a",
"hex",
"representation",
"of",
"that",
"data",
".",
"Each",
"octet",
"will",
"be",
"separated",
"with",
"a",
"specific",
"separator",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/sms/HexUtil.java#L62-L76 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/sms/HexUtil.java | HexUtil.hexToBytes | public static byte[] hexToBytes(String str) {
if (str == null)
return null;
byte[] hexChars;
try {
hexChars = str.toUpperCase().getBytes("ISO_8859-1");
} catch (UnsupportedEncodingException e) {
throw new NexmoUnexpectedException("ISO_8859_1 is an unsu... | java | public static byte[] hexToBytes(String str) {
if (str == null)
return null;
byte[] hexChars;
try {
hexChars = str.toUpperCase().getBytes("ISO_8859-1");
} catch (UnsupportedEncodingException e) {
throw new NexmoUnexpectedException("ISO_8859_1 is an unsu... | [
"public",
"static",
"byte",
"[",
"]",
"hexToBytes",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"return",
"null",
";",
"byte",
"[",
"]",
"hexChars",
";",
"try",
"{",
"hexChars",
"=",
"str",
".",
"toUpperCase",
"(",
")",
"."... | Converts a Hex encoded String into a byte vector.
@param str The String to be encoded.
@return A byte vector representing the String. | [
"Converts",
"a",
"Hex",
"encoded",
"String",
"into",
"a",
"byte",
"vector",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/sms/HexUtil.java#L85-L126 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/insight/InsightClient.java | InsightClient.getBasicNumberInsight | public BasicInsightResponse getBasicNumberInsight(String number) throws IOException, NexmoClientException {
return getBasicNumberInsight(BasicInsightRequest.withNumber(number));
} | java | public BasicInsightResponse getBasicNumberInsight(String number) throws IOException, NexmoClientException {
return getBasicNumberInsight(BasicInsightRequest.withNumber(number));
} | [
"public",
"BasicInsightResponse",
"getBasicNumberInsight",
"(",
"String",
"number",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"return",
"getBasicNumberInsight",
"(",
"BasicInsightRequest",
".",
"withNumber",
"(",
"number",
")",
")",
";",
"}"
] | Perform a Basic Insight Request with a number.
@param number A single phone number that you need insight about in national or international format.
@return A {@link BasicInsightResponse} representing the response from the Nexmo Number Insight API.
@throws IOException if a network error occurred contacting t... | [
"Perform",
"a",
"Basic",
"Insight",
"Request",
"with",
"a",
"number",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/insight/InsightClient.java#L63-L65 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/insight/InsightClient.java | InsightClient.getBasicNumberInsight | public BasicInsightResponse getBasicNumberInsight(String number, String country) throws IOException, NexmoClientException {
return getBasicNumberInsight(BasicInsightRequest.withNumberAndCountry(number, country));
} | java | public BasicInsightResponse getBasicNumberInsight(String number, String country) throws IOException, NexmoClientException {
return getBasicNumberInsight(BasicInsightRequest.withNumberAndCountry(number, country));
} | [
"public",
"BasicInsightResponse",
"getBasicNumberInsight",
"(",
"String",
"number",
",",
"String",
"country",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"return",
"getBasicNumberInsight",
"(",
"BasicInsightRequest",
".",
"withNumberAndCountry",
"(",
"... | Perform a Basic Insight Request with a number and country.
@param number A single phone number that you need insight about in national or international format
@param country If a number does not have a country code or it is uncertain, set the two-character country code.
@return A {@link BasicInsightResponse} represe... | [
"Perform",
"a",
"Basic",
"Insight",
"Request",
"with",
"a",
"number",
"and",
"country",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/insight/InsightClient.java#L78-L80 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/insight/InsightClient.java | InsightClient.getStandardNumberInsight | public StandardInsightResponse getStandardNumberInsight(String number) throws IOException, NexmoClientException {
return getStandardNumberInsight(StandardInsightRequest.withNumber(number));
} | java | public StandardInsightResponse getStandardNumberInsight(String number) throws IOException, NexmoClientException {
return getStandardNumberInsight(StandardInsightRequest.withNumber(number));
} | [
"public",
"StandardInsightResponse",
"getStandardNumberInsight",
"(",
"String",
"number",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"return",
"getStandardNumberInsight",
"(",
"StandardInsightRequest",
".",
"withNumber",
"(",
"number",
")",
")",
";",
... | Perform a Standard Insight Request with a number.
@param number A single phone number that you need insight about in national or international format.
@return A {@link StandardInsightResponse} representing the response from the Nexmo Number Insight API.
@throws IOException if a network error occurred contac... | [
"Perform",
"a",
"Standard",
"Insight",
"Request",
"with",
"a",
"number",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/insight/InsightClient.java#L106-L108 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/insight/InsightClient.java | InsightClient.getStandardNumberInsight | public StandardInsightResponse getStandardNumberInsight(String number, String country) throws IOException, NexmoClientException {
return getStandardNumberInsight(StandardInsightRequest.withNumberAndCountry(number, country));
} | java | public StandardInsightResponse getStandardNumberInsight(String number, String country) throws IOException, NexmoClientException {
return getStandardNumberInsight(StandardInsightRequest.withNumberAndCountry(number, country));
} | [
"public",
"StandardInsightResponse",
"getStandardNumberInsight",
"(",
"String",
"number",
",",
"String",
"country",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"return",
"getStandardNumberInsight",
"(",
"StandardInsightRequest",
".",
"withNumberAndCountry"... | Perform a Standard Insight Request with a number and country.
@param number A single phone number that you need insight about in national or international format.
@param country If a number does not have a country code or it is uncertain, set the two-character country code.
@return A {@link StandardInsightResponse} ... | [
"Perform",
"a",
"Standard",
"Insight",
"Request",
"with",
"a",
"number",
"and",
"country",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/insight/InsightClient.java#L121-L123 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/insight/InsightClient.java | InsightClient.getStandardNumberInsight | @Deprecated
public StandardInsightResponse getStandardNumberInsight(String number, String country, boolean cnam) throws IOException, NexmoClientException {
return getStandardNumberInsight(StandardInsightRequest.builder(number).country(country).cnam(cnam).build());
} | java | @Deprecated
public StandardInsightResponse getStandardNumberInsight(String number, String country, boolean cnam) throws IOException, NexmoClientException {
return getStandardNumberInsight(StandardInsightRequest.builder(number).country(country).cnam(cnam).build());
} | [
"@",
"Deprecated",
"public",
"StandardInsightResponse",
"getStandardNumberInsight",
"(",
"String",
"number",
",",
"String",
"country",
",",
"boolean",
"cnam",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"return",
"getStandardNumberInsight",
"(",
"Sta... | Perform a Standard Insight Request with a number, country, and cnam.
@param number A single phone number that you need insight about in national or international format.
@param country If a number does not have a country code or it is uncertain, set the two-character country code.
@param cnam Indicates if the name... | [
"Perform",
"a",
"Standard",
"Insight",
"Request",
"with",
"a",
"number",
"country",
"and",
"cnam",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/insight/InsightClient.java#L140-L143 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/insight/InsightClient.java | InsightClient.getAdvancedNumberInsight | public AdvancedInsightResponse getAdvancedNumberInsight(String number) throws IOException, NexmoClientException {
return getAdvancedNumberInsight(AdvancedInsightRequest.withNumber(number));
} | java | public AdvancedInsightResponse getAdvancedNumberInsight(String number) throws IOException, NexmoClientException {
return getAdvancedNumberInsight(AdvancedInsightRequest.withNumber(number));
} | [
"public",
"AdvancedInsightResponse",
"getAdvancedNumberInsight",
"(",
"String",
"number",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"return",
"getAdvancedNumberInsight",
"(",
"AdvancedInsightRequest",
".",
"withNumber",
"(",
"number",
")",
")",
";",
... | Perform an Advanced Insight Request with a number.
@param number A single phone number that you need insight about in national or international format.
@return A {@link AdvancedInsightResponse} representing the response from the Nexmo Number Insight API.
@throws IOException if a network error occurred conta... | [
"Perform",
"an",
"Advanced",
"Insight",
"Request",
"with",
"a",
"number",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/insight/InsightClient.java#L169-L171 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/insight/InsightClient.java | InsightClient.getAdvancedNumberInsight | public AdvancedInsightResponse getAdvancedNumberInsight(String number, String country) throws IOException, NexmoClientException {
return getAdvancedNumberInsight(AdvancedInsightRequest.withNumberAndCountry(number, country));
} | java | public AdvancedInsightResponse getAdvancedNumberInsight(String number, String country) throws IOException, NexmoClientException {
return getAdvancedNumberInsight(AdvancedInsightRequest.withNumberAndCountry(number, country));
} | [
"public",
"AdvancedInsightResponse",
"getAdvancedNumberInsight",
"(",
"String",
"number",
",",
"String",
"country",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"return",
"getAdvancedNumberInsight",
"(",
"AdvancedInsightRequest",
".",
"withNumberAndCountry"... | Perform an Advanced Insight Request with a number and country.
@param number A single phone number that you need insight about in national or international format.
@param country If a number does not have a country code or it is uncertain, set the two-character country code.
@return A {@link AdvancedInsightResponse}... | [
"Perform",
"an",
"Advanced",
"Insight",
"Request",
"with",
"a",
"number",
"and",
"country",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/insight/InsightClient.java#L184-L186 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/insight/InsightClient.java | InsightClient.getAdvancedNumberInsight | @Deprecated
public AdvancedInsightResponse getAdvancedNumberInsight(String number, String country, String ipAddress) throws IOException, NexmoClientException {
return getAdvancedNumberInsight(AdvancedInsightRequest.builder(number)
.country(country)
.ipAddress(ipAddress)
... | java | @Deprecated
public AdvancedInsightResponse getAdvancedNumberInsight(String number, String country, String ipAddress) throws IOException, NexmoClientException {
return getAdvancedNumberInsight(AdvancedInsightRequest.builder(number)
.country(country)
.ipAddress(ipAddress)
... | [
"@",
"Deprecated",
"public",
"AdvancedInsightResponse",
"getAdvancedNumberInsight",
"(",
"String",
"number",
",",
"String",
"country",
",",
"String",
"ipAddress",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"return",
"getAdvancedNumberInsight",
"(",
... | Perform an Advanced Insight Request with a number, country, and ipAddress.
@param number A single phone number that you need insight about in national or international format.
@param country If a number does not have a country code or it is uncertain, set the two-character country code.
@param ipAddress The IP ad... | [
"Perform",
"an",
"Advanced",
"Insight",
"Request",
"with",
"a",
"number",
"country",
"and",
"ipAddress",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/insight/InsightClient.java#L202-L208 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/AbstractMethod.java | AbstractMethod.execute | public ResultT execute(RequestT request) throws IOException, NexmoClientException {
try {
RequestBuilder requestBuilder = applyAuth(makeRequest(request));
HttpUriRequest httpRequest = requestBuilder.build();
// If we have a URL Encoded form entity, we may need to regenerate ... | java | public ResultT execute(RequestT request) throws IOException, NexmoClientException {
try {
RequestBuilder requestBuilder = applyAuth(makeRequest(request));
HttpUriRequest httpRequest = requestBuilder.build();
// If we have a URL Encoded form entity, we may need to regenerate ... | [
"public",
"ResultT",
"execute",
"(",
"RequestT",
"request",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"try",
"{",
"RequestBuilder",
"requestBuilder",
"=",
"applyAuth",
"(",
"makeRequest",
"(",
"request",
")",
")",
";",
"HttpUriRequest",
"http... | Execute the REST call represented by this method object.
@param request A RequestT representing input to the REST call to be made
@return A ResultT representing the response from the executed REST call
@throws IOException if an exception occurs making the REST call
@throws NexmoClientException if there is a... | [
"Execute",
"the",
"REST",
"call",
"represented",
"by",
"this",
"method",
"object",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/AbstractMethod.java#L78-L112 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/verify/VerifyClient.java | VerifyClient.verify | public VerifyResponse verify(final String number,
final String brand,
final String from,
final int length,
final Locale locale) throws IOException, NexmoClientException {
return this.verif... | java | public VerifyResponse verify(final String number,
final String brand,
final String from,
final int length,
final Locale locale) throws IOException, NexmoClientException {
return this.verif... | [
"public",
"VerifyResponse",
"verify",
"(",
"final",
"String",
"number",
",",
"final",
"String",
"brand",
",",
"final",
"String",
"from",
",",
"final",
"int",
"length",
",",
"final",
"Locale",
"locale",
")",
"throws",
"IOException",
",",
"NexmoClientException",
... | Send a verification request to a phone number.
@param number (required) The recipient's phone number in <a href="https://en.wikipedia.org/wiki/E.164">E.164</a>
format.
@param brand (required) The name of the company or app to be verified for. Must not be longer than 18
characters.
@param from (optional The Nexmo nu... | [
"Send",
"a",
"verification",
"request",
"to",
"a",
"phone",
"number",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/verify/VerifyClient.java#L114-L120 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/verify/VerifyClient.java | VerifyClient.advanceVerification | public ControlResponse advanceVerification(String requestId) throws IOException, NexmoClientException {
return this.control.execute(new ControlRequest(requestId, VerifyControlCommand.TRIGGER_NEXT_EVENT));
} | java | public ControlResponse advanceVerification(String requestId) throws IOException, NexmoClientException {
return this.control.execute(new ControlRequest(requestId, VerifyControlCommand.TRIGGER_NEXT_EVENT));
} | [
"public",
"ControlResponse",
"advanceVerification",
"(",
"String",
"requestId",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"return",
"this",
".",
"control",
".",
"execute",
"(",
"new",
"ControlRequest",
"(",
"requestId",
",",
"VerifyControlCommand... | Advance a current verification request to the next stage in the process.
@param requestId The requestId of the ongoing verification request.
@return A {@link ControlResponse} representing the response from the API.
@throws IOException If an IO error occurred while making the request.
@throws NexmoClientExcept... | [
"Advance",
"a",
"current",
"verification",
"request",
"to",
"the",
"next",
"stage",
"in",
"the",
"process",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/verify/VerifyClient.java#L219-L221 | train |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/verify/VerifyClient.java | VerifyClient.cancelVerification | public ControlResponse cancelVerification(String requestId) throws IOException, NexmoClientException {
return this.control.execute(new ControlRequest(requestId, VerifyControlCommand.CANCEL));
} | java | public ControlResponse cancelVerification(String requestId) throws IOException, NexmoClientException {
return this.control.execute(new ControlRequest(requestId, VerifyControlCommand.CANCEL));
} | [
"public",
"ControlResponse",
"cancelVerification",
"(",
"String",
"requestId",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"return",
"this",
".",
"control",
".",
"execute",
"(",
"new",
"ControlRequest",
"(",
"requestId",
",",
"VerifyControlCommand"... | Cancel a current verification request.
@param requestId The requestId of the ongoing verification request.
@return A {@link ControlResponse} representing the response from the API.
@throws IOException If an IO error occurred while making the request.
@throws NexmoClientException If the request failed for some... | [
"Cancel",
"a",
"current",
"verification",
"request",
"."
] | 7427eff6d6baa5a5bd9197fa096bcf2564191cf5 | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/verify/VerifyClient.java#L231-L233 | train |
elastic/elasticsearch-river-wikipedia | src/main/java/org/elasticsearch/river/wikipedia/support/WikiXMLSAXParser.java | WikiXMLSAXParser.parseWikipediaDump | public static void parseWikipediaDump(URL dumpFile,
PageCallbackHandler handler) throws Exception {
WikiXMLParser wxsp = WikiXMLParserFactory.getSAXParser(dumpFile);
wxsp.setPageCallback(handler);
wxsp.parse();
} | java | public static void parseWikipediaDump(URL dumpFile,
PageCallbackHandler handler) throws Exception {
WikiXMLParser wxsp = WikiXMLParserFactory.getSAXParser(dumpFile);
wxsp.setPageCallback(handler);
wxsp.parse();
} | [
"public",
"static",
"void",
"parseWikipediaDump",
"(",
"URL",
"dumpFile",
",",
"PageCallbackHandler",
"handler",
")",
"throws",
"Exception",
"{",
"WikiXMLParser",
"wxsp",
"=",
"WikiXMLParserFactory",
".",
"getSAXParser",
"(",
"dumpFile",
")",
";",
"wxsp",
".",
"se... | A convenience method for the Wikipedia SAX interface
@param dumpFile - path to the Wikipedia dump
@param handler - callback handler used for parsing
@throws Exception | [
"A",
"convenience",
"method",
"for",
"the",
"Wikipedia",
"SAX",
"interface"
] | fa005d7adc99e701d2812a7721ecfa94a03866ff | https://github.com/elastic/elasticsearch-river-wikipedia/blob/fa005d7adc99e701d2812a7721ecfa94a03866ff/src/main/java/org/elasticsearch/river/wikipedia/support/WikiXMLSAXParser.java#L89-L94 | train |
krasa/krasa-jaxb-tools | src/main/java/com/sun/tools/xjc/addon/krasa/PrimitiveFixerPlugin.java | PrimitiveFixerPlugin.getMethodsMap | private JMethod getMethodsMap(MethodType type, JFieldVar field, ClassOutline co) {
String getterBody = "return " + field.name() + ";";
for (JMethod method : co.implClass.methods()) {
String name = method.name();
if (method.type().isPrimitive()) {
if (MethodType.GE... | java | private JMethod getMethodsMap(MethodType type, JFieldVar field, ClassOutline co) {
String getterBody = "return " + field.name() + ";";
for (JMethod method : co.implClass.methods()) {
String name = method.name();
if (method.type().isPrimitive()) {
if (MethodType.GE... | [
"private",
"JMethod",
"getMethodsMap",
"(",
"MethodType",
"type",
",",
"JFieldVar",
"field",
",",
"ClassOutline",
"co",
")",
"{",
"String",
"getterBody",
"=",
"\"return \"",
"+",
"field",
".",
"name",
"(",
")",
"+",
"\";\"",
";",
"for",
"(",
"JMethod",
"me... | I hate this shit | [
"I",
"hate",
"this",
"shit"
] | bc16bfbd83c856bf159e06347bf2e1157cc258ba | https://github.com/krasa/krasa-jaxb-tools/blob/bc16bfbd83c856bf159e06347bf2e1157cc258ba/src/main/java/com/sun/tools/xjc/addon/krasa/PrimitiveFixerPlugin.java#L90-L112 | train |
sakserv/hadoop-mini-clusters | hadoop-mini-clusters-yarn/src/main/java/com/github/sakserv/minicluster/yarn/InJvmContainerExecutor.java | InJvmContainerExecutor.createExecCommandParser | private ExecJavaCliParser createExecCommandParser(String containerWorkDir) {
String execLine =
this.filterAndExecuteLaunchScriptAndReturnExecLine(containerWorkDir);
String[] values = execLine.split("\"");
String javaCli = values[1];
String[] javaCliValues = javaCli.split(... | java | private ExecJavaCliParser createExecCommandParser(String containerWorkDir) {
String execLine =
this.filterAndExecuteLaunchScriptAndReturnExecLine(containerWorkDir);
String[] values = execLine.split("\"");
String javaCli = values[1];
String[] javaCliValues = javaCli.split(... | [
"private",
"ExecJavaCliParser",
"createExecCommandParser",
"(",
"String",
"containerWorkDir",
")",
"{",
"String",
"execLine",
"=",
"this",
".",
"filterAndExecuteLaunchScriptAndReturnExecLine",
"(",
"containerWorkDir",
")",
";",
"String",
"[",
"]",
"values",
"=",
"execLi... | Creates CLI parser which can be used to extract Container's class name and
its launch arguments.
@param containerWorkDir
@return | [
"Creates",
"CLI",
"parser",
"which",
"can",
"be",
"used",
"to",
"extract",
"Container",
"s",
"class",
"name",
"and",
"its",
"launch",
"arguments",
"."
] | c3915274714b457cf7e1af62f2f289274510dc0b | https://github.com/sakserv/hadoop-mini-clusters/blob/c3915274714b457cf7e1af62f2f289274510dc0b/hadoop-mini-clusters-yarn/src/main/java/com/github/sakserv/minicluster/yarn/InJvmContainerExecutor.java#L320-L338 | train |
sakserv/hadoop-mini-clusters | hadoop-mini-clusters-yarn/src/main/java/com/github/sakserv/minicluster/yarn/InJvmContainerExecutor.java | InJvmContainerExecutor.filterAndExecuteLaunchScriptAndReturnExecLine | private String filterAndExecuteLaunchScriptAndReturnExecLine(String containerWorkDir) {
BufferedReader reader = null;
BufferedWriter writer = null;
String execLine = null;
File inJvmlaunchScript = null;
try {
File launchScript = new File(containerWorkDir, "launch_cont... | java | private String filterAndExecuteLaunchScriptAndReturnExecLine(String containerWorkDir) {
BufferedReader reader = null;
BufferedWriter writer = null;
String execLine = null;
File inJvmlaunchScript = null;
try {
File launchScript = new File(containerWorkDir, "launch_cont... | [
"private",
"String",
"filterAndExecuteLaunchScriptAndReturnExecLine",
"(",
"String",
"containerWorkDir",
")",
"{",
"BufferedReader",
"reader",
"=",
"null",
";",
"BufferedWriter",
"writer",
"=",
"null",
";",
"String",
"execLine",
"=",
"null",
";",
"File",
"inJvmlaunchS... | This method does three things 1. It creates an updated version of the
initial launch script where it simply copies its contents less the 'exec'
line 2. It extract the 'exec' line and returns it so the Container's class
name and launch arguments could be retrieved. 3. It executes the
'exec'-less launch script to ensure ... | [
"This",
"method",
"does",
"three",
"things",
"1",
".",
"It",
"creates",
"an",
"updated",
"version",
"of",
"the",
"initial",
"launch",
"script",
"where",
"it",
"simply",
"copies",
"its",
"contents",
"less",
"the",
"exec",
"line",
"2",
".",
"It",
"extract",
... | c3915274714b457cf7e1af62f2f289274510dc0b | https://github.com/sakserv/hadoop-mini-clusters/blob/c3915274714b457cf7e1af62f2f289274510dc0b/hadoop-mini-clusters-yarn/src/main/java/com/github/sakserv/minicluster/yarn/InJvmContainerExecutor.java#L351-L412 | train |
sakserv/hadoop-mini-clusters | hadoop-mini-clusters-yarn/src/main/java/com/github/sakserv/minicluster/yarn/InJvmContainerExecutor.java | InJvmContainerExecutor.cleanUp | private void cleanUp() {
try {
File file = new File(System.getProperty("user.dir"));
String[] links = file.list();
for (String name : links) {
File potentialSymLink = new File(file, name);
if (FileUtils.isSymlink(potentialSymLink)) {
... | java | private void cleanUp() {
try {
File file = new File(System.getProperty("user.dir"));
String[] links = file.list();
for (String name : links) {
File potentialSymLink = new File(file, name);
if (FileUtils.isSymlink(potentialSymLink)) {
... | [
"private",
"void",
"cleanUp",
"(",
")",
"{",
"try",
"{",
"File",
"file",
"=",
"new",
"File",
"(",
"System",
".",
"getProperty",
"(",
"\"user.dir\"",
")",
")",
";",
"String",
"[",
"]",
"links",
"=",
"file",
".",
"list",
"(",
")",
";",
"for",
"(",
... | Will clean up symlinks that were created by a launch script | [
"Will",
"clean",
"up",
"symlinks",
"that",
"were",
"created",
"by",
"a",
"launch",
"script"
] | c3915274714b457cf7e1af62f2f289274510dc0b | https://github.com/sakserv/hadoop-mini-clusters/blob/c3915274714b457cf7e1af62f2f289274510dc0b/hadoop-mini-clusters-yarn/src/main/java/com/github/sakserv/minicluster/yarn/InJvmContainerExecutor.java#L450-L467 | train |
sakserv/hadoop-mini-clusters | hadoop-mini-clusters-knox/src/main/java/com/github/sakserv/minicluster/impl/LocalGatewayConfig.java | LocalGatewayConfig.getGatewayPortMappings | @Override
public Map<String, Integer> getGatewayPortMappings() {
final Map<String, Integer> result = new ConcurrentHashMap<String, Integer>();
final Map<String, String> properties = getValByRegex(GATEWAY_PORT_MAPPING_REGEX);
// Convert port no. from string to int
for(final Map.Entr... | java | @Override
public Map<String, Integer> getGatewayPortMappings() {
final Map<String, Integer> result = new ConcurrentHashMap<String, Integer>();
final Map<String, String> properties = getValByRegex(GATEWAY_PORT_MAPPING_REGEX);
// Convert port no. from string to int
for(final Map.Entr... | [
"@",
"Override",
"public",
"Map",
"<",
"String",
",",
"Integer",
">",
"getGatewayPortMappings",
"(",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"Integer",
">",
"result",
"=",
"new",
"ConcurrentHashMap",
"<",
"String",
",",
"Integer",
">",
"(",
")",
";... | Map of Topology names and their ports.
@return | [
"Map",
"of",
"Topology",
"names",
"and",
"their",
"ports",
"."
] | c3915274714b457cf7e1af62f2f289274510dc0b | https://github.com/sakserv/hadoop-mini-clusters/blob/c3915274714b457cf7e1af62f2f289274510dc0b/hadoop-mini-clusters-knox/src/main/java/com/github/sakserv/minicluster/impl/LocalGatewayConfig.java#L494-L511 | train |
sakserv/hadoop-mini-clusters | hadoop-mini-clusters-yarn/src/main/java/com/github/sakserv/minicluster/yarn/util/EnvironmentUtils.java | EnvironmentUtils.put | public static void put(String key, String value) throws Exception {
Map<String, String> environemnt = new HashMap<String, String>(System.getenv());
environemnt.put(key, value);
updateEnvironment(environemnt);
} | java | public static void put(String key, String value) throws Exception {
Map<String, String> environemnt = new HashMap<String, String>(System.getenv());
environemnt.put(key, value);
updateEnvironment(environemnt);
} | [
"public",
"static",
"void",
"put",
"(",
"String",
"key",
",",
"String",
"value",
")",
"throws",
"Exception",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"environemnt",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
"System",
".",
"ge... | Allows dynamic update to the environment variables.
@param key
@param value | [
"Allows",
"dynamic",
"update",
"to",
"the",
"environment",
"variables",
"."
] | c3915274714b457cf7e1af62f2f289274510dc0b | https://github.com/sakserv/hadoop-mini-clusters/blob/c3915274714b457cf7e1af62f2f289274510dc0b/hadoop-mini-clusters-yarn/src/main/java/com/github/sakserv/minicluster/yarn/util/EnvironmentUtils.java#L33-L37 | train |
sakserv/hadoop-mini-clusters | hadoop-mini-clusters-oozie/src/main/java/com/github/sakserv/minicluster/oozie/sharelib/util/OozieShareLibUtil.java | OozieShareLibUtil.createShareLib | public void createShareLib() {
if (!oozieShareLibCreate) {
LOG.info("OOZIE: Share Lib Create Disabled... skipping");
} else {
final String fullOozieTarFilePath = shareLibCacheDir + Path.SEPARATOR + getOozieTarFileName();
try {
// Get and extract th... | java | public void createShareLib() {
if (!oozieShareLibCreate) {
LOG.info("OOZIE: Share Lib Create Disabled... skipping");
} else {
final String fullOozieTarFilePath = shareLibCacheDir + Path.SEPARATOR + getOozieTarFileName();
try {
// Get and extract th... | [
"public",
"void",
"createShareLib",
"(",
")",
"{",
"if",
"(",
"!",
"oozieShareLibCreate",
")",
"{",
"LOG",
".",
"info",
"(",
"\"OOZIE: Share Lib Create Disabled... skipping\"",
")",
";",
"}",
"else",
"{",
"final",
"String",
"fullOozieTarFilePath",
"=",
"shareLibCa... | Main driver that downloads, extracts, and deploys the oozie sharelib | [
"Main",
"driver",
"that",
"downloads",
"extracts",
"and",
"deploys",
"the",
"oozie",
"sharelib"
] | c3915274714b457cf7e1af62f2f289274510dc0b | https://github.com/sakserv/hadoop-mini-clusters/blob/c3915274714b457cf7e1af62f2f289274510dc0b/hadoop-mini-clusters-oozie/src/main/java/com/github/sakserv/minicluster/oozie/sharelib/util/OozieShareLibUtil.java#L75-L110 | train |
mkotsur/restito | examples/popular-page/src/main/java/com/xebialabs/restito/examples/WikiClient.java | WikiClient.getMostRecentRevision | public PageRevision getMostRecentRevision(String... titles) throws Exception {
URL url = new URL(entryPoint +
"/w/api.php?format=json&action=query&prop=revisions&rvprop=user|timestamp&titles=" +
encode(Joiner.on("|").join(titles), "UTF-8")
);
String response = r... | java | public PageRevision getMostRecentRevision(String... titles) throws Exception {
URL url = new URL(entryPoint +
"/w/api.php?format=json&action=query&prop=revisions&rvprop=user|timestamp&titles=" +
encode(Joiner.on("|").join(titles), "UTF-8")
);
String response = r... | [
"public",
"PageRevision",
"getMostRecentRevision",
"(",
"String",
"...",
"titles",
")",
"throws",
"Exception",
"{",
"URL",
"url",
"=",
"new",
"URL",
"(",
"entryPoint",
"+",
"\"/w/api.php?format=json&action=query&prop=revisions&rvprop=user|timestamp&titles=\"",
"+",
"encode"... | Returns the latest revision of the page which was edited last | [
"Returns",
"the",
"latest",
"revision",
"of",
"the",
"page",
"which",
"was",
"edited",
"last"
] | b999293616ca84fdea1ffe929e92a5db29c7e415 | https://github.com/mkotsur/restito/blob/b999293616ca84fdea1ffe929e92a5db29c7e415/examples/popular-page/src/main/java/com/xebialabs/restito/examples/WikiClient.java#L32-L51 | train |
mkotsur/restito | src/main/java/com/xebialabs/restito/builder/stub/StubHttp.java | StubHttp.match | public StubWithCondition match(String label, Condition... conditions) {
StubWithCondition swc = new StubWithCondition(stubServer, Condition.composite(conditions));
swc.stub.withLabel(label);
return swc;
} | java | public StubWithCondition match(String label, Condition... conditions) {
StubWithCondition swc = new StubWithCondition(stubServer, Condition.composite(conditions));
swc.stub.withLabel(label);
return swc;
} | [
"public",
"StubWithCondition",
"match",
"(",
"String",
"label",
",",
"Condition",
"...",
"conditions",
")",
"{",
"StubWithCondition",
"swc",
"=",
"new",
"StubWithCondition",
"(",
"stubServer",
",",
"Condition",
".",
"composite",
"(",
"conditions",
")",
")",
";",... | Creates a stub with a label, and adds a condition to it | [
"Creates",
"a",
"stub",
"with",
"a",
"label",
"and",
"adds",
"a",
"condition",
"to",
"it"
] | b999293616ca84fdea1ffe929e92a5db29c7e415 | https://github.com/mkotsur/restito/blob/b999293616ca84fdea1ffe929e92a5db29c7e415/src/main/java/com/xebialabs/restito/builder/stub/StubHttp.java#L34-L38 | train |
mkotsur/restito | src/main/java/com/xebialabs/restito/semantics/Stub.java | Stub.isApplicable | public boolean isApplicable(Call call) {
return when.getPredicate().test(call) && (actionSequence.size() == 0 || exceededAction != null || actionSequence.size() > appliedTimes);
} | java | public boolean isApplicable(Call call) {
return when.getPredicate().test(call) && (actionSequence.size() == 0 || exceededAction != null || actionSequence.size() > appliedTimes);
} | [
"public",
"boolean",
"isApplicable",
"(",
"Call",
"call",
")",
"{",
"return",
"when",
".",
"getPredicate",
"(",
")",
".",
"test",
"(",
"call",
")",
"&&",
"(",
"actionSequence",
".",
"size",
"(",
")",
"==",
"0",
"||",
"exceededAction",
"!=",
"null",
"||... | Checks whether the call satisfies condition of this stub | [
"Checks",
"whether",
"the",
"call",
"satisfies",
"condition",
"of",
"this",
"stub"
] | b999293616ca84fdea1ffe929e92a5db29c7e415 | https://github.com/mkotsur/restito/blob/b999293616ca84fdea1ffe929e92a5db29c7e415/src/main/java/com/xebialabs/restito/semantics/Stub.java#L90-L92 | train |
mkotsur/restito | src/main/java/com/xebialabs/restito/semantics/Stub.java | Stub.apply | public Response apply(Response response) {
if (when instanceof ConditionWithApplicables) {
for (Applicable applicable : ((ConditionWithApplicables) when).getApplicables()) {
response = applicable.apply(response);
}
}
Applicable chosenAction;
if (... | java | public Response apply(Response response) {
if (when instanceof ConditionWithApplicables) {
for (Applicable applicable : ((ConditionWithApplicables) when).getApplicables()) {
response = applicable.apply(response);
}
}
Applicable chosenAction;
if (... | [
"public",
"Response",
"apply",
"(",
"Response",
"response",
")",
"{",
"if",
"(",
"when",
"instanceof",
"ConditionWithApplicables",
")",
"{",
"for",
"(",
"Applicable",
"applicable",
":",
"(",
"(",
"ConditionWithApplicables",
")",
"when",
")",
".",
"getApplicables... | Executes all actions against the response. | [
"Executes",
"all",
"actions",
"against",
"the",
"response",
"."
] | b999293616ca84fdea1ffe929e92a5db29c7e415 | https://github.com/mkotsur/restito/blob/b999293616ca84fdea1ffe929e92a5db29c7e415/src/main/java/com/xebialabs/restito/semantics/Stub.java#L97-L119 | train |
mkotsur/restito | src/main/java/com/xebialabs/restito/builder/stub/StubWithCondition.java | StubWithCondition.then | public StubWithAction then(Applicable... actions) {
Stub s = this.stub.withAction(composite(actions));
stubServer.addStub(s);
return new StubWithAction(s);
} | java | public StubWithAction then(Applicable... actions) {
Stub s = this.stub.withAction(composite(actions));
stubServer.addStub(s);
return new StubWithAction(s);
} | [
"public",
"StubWithAction",
"then",
"(",
"Applicable",
"...",
"actions",
")",
"{",
"Stub",
"s",
"=",
"this",
".",
"stub",
".",
"withAction",
"(",
"composite",
"(",
"actions",
")",
")",
";",
"stubServer",
".",
"addStub",
"(",
"s",
")",
";",
"return",
"n... | Attach actions to the stub | [
"Attach",
"actions",
"to",
"the",
"stub"
] | b999293616ca84fdea1ffe929e92a5db29c7e415 | https://github.com/mkotsur/restito/blob/b999293616ca84fdea1ffe929e92a5db29c7e415/src/main/java/com/xebialabs/restito/builder/stub/StubWithCondition.java#L61-L65 | train |
mkotsur/restito | src/main/java/com/xebialabs/restito/semantics/Action.java | Action.status | public static Action status(final HttpStatus status) {
return new Action(input -> {
input.setStatus(status);
return input;
});
} | java | public static Action status(final HttpStatus status) {
return new Action(input -> {
input.setStatus(status);
return input;
});
} | [
"public",
"static",
"Action",
"status",
"(",
"final",
"HttpStatus",
"status",
")",
"{",
"return",
"new",
"Action",
"(",
"input",
"->",
"{",
"input",
".",
"setStatus",
"(",
"status",
")",
";",
"return",
"input",
";",
"}",
")",
";",
"}"
] | Sets HTTP status to response | [
"Sets",
"HTTP",
"status",
"to",
"response"
] | b999293616ca84fdea1ffe929e92a5db29c7e415 | https://github.com/mkotsur/restito/blob/b999293616ca84fdea1ffe929e92a5db29c7e415/src/main/java/com/xebialabs/restito/semantics/Action.java#L64-L69 | train |
mkotsur/restito | src/main/java/com/xebialabs/restito/semantics/Action.java | Action.bytesContent | public static Action bytesContent(final byte[] content) {
return new Action(response -> {
response.setContentLength(content.length);
try {
response.getOutputStream().write(content);
} catch (IOException e) {
throw new RuntimeException("Can not... | java | public static Action bytesContent(final byte[] content) {
return new Action(response -> {
response.setContentLength(content.length);
try {
response.getOutputStream().write(content);
} catch (IOException e) {
throw new RuntimeException("Can not... | [
"public",
"static",
"Action",
"bytesContent",
"(",
"final",
"byte",
"[",
"]",
"content",
")",
"{",
"return",
"new",
"Action",
"(",
"response",
"->",
"{",
"response",
".",
"setContentLength",
"(",
"content",
".",
"length",
")",
";",
"try",
"{",
"response",
... | Writes bytes content to response | [
"Writes",
"bytes",
"content",
"to",
"response"
] | b999293616ca84fdea1ffe929e92a5db29c7e415 | https://github.com/mkotsur/restito/blob/b999293616ca84fdea1ffe929e92a5db29c7e415/src/main/java/com/xebialabs/restito/semantics/Action.java#L140-L151 | train |
mkotsur/restito | src/main/java/com/xebialabs/restito/semantics/Action.java | Action.header | public static Action header(final String key, final String value) {
return new Action(input -> {
input.setHeader(key, value);
return input;
});
} | java | public static Action header(final String key, final String value) {
return new Action(input -> {
input.setHeader(key, value);
return input;
});
} | [
"public",
"static",
"Action",
"header",
"(",
"final",
"String",
"key",
",",
"final",
"String",
"value",
")",
"{",
"return",
"new",
"Action",
"(",
"input",
"->",
"{",
"input",
".",
"setHeader",
"(",
"key",
",",
"value",
")",
";",
"return",
"input",
";",... | Sets key-value header on response | [
"Sets",
"key",
"-",
"value",
"header",
"on",
"response"
] | b999293616ca84fdea1ffe929e92a5db29c7e415 | https://github.com/mkotsur/restito/blob/b999293616ca84fdea1ffe929e92a5db29c7e415/src/main/java/com/xebialabs/restito/semantics/Action.java#L178-L183 | train |
mkotsur/restito | src/main/java/com/xebialabs/restito/semantics/Action.java | Action.contentType | public static Action contentType(final String contentType) {
return new Action(r -> {
r.setContentType(contentType);
return r;
});
} | java | public static Action contentType(final String contentType) {
return new Action(r -> {
r.setContentType(contentType);
return r;
});
} | [
"public",
"static",
"Action",
"contentType",
"(",
"final",
"String",
"contentType",
")",
"{",
"return",
"new",
"Action",
"(",
"r",
"->",
"{",
"r",
".",
"setContentType",
"(",
"contentType",
")",
";",
"return",
"r",
";",
"}",
")",
";",
"}"
] | Sets content type to the response | [
"Sets",
"content",
"type",
"to",
"the",
"response"
] | b999293616ca84fdea1ffe929e92a5db29c7e415 | https://github.com/mkotsur/restito/blob/b999293616ca84fdea1ffe929e92a5db29c7e415/src/main/java/com/xebialabs/restito/semantics/Action.java#L188-L193 | train |
mkotsur/restito | src/main/java/com/xebialabs/restito/semantics/Action.java | Action.unauthorized | public static Action unauthorized(final String realm) {
return new Action(r -> {
r.addHeader("WWW-Authenticate", "Basic realm=\"" + realm + "\"");
r.setStatus(HttpStatus.UNAUTHORIZED_401);
return r;
});
} | java | public static Action unauthorized(final String realm) {
return new Action(r -> {
r.addHeader("WWW-Authenticate", "Basic realm=\"" + realm + "\"");
r.setStatus(HttpStatus.UNAUTHORIZED_401);
return r;
});
} | [
"public",
"static",
"Action",
"unauthorized",
"(",
"final",
"String",
"realm",
")",
"{",
"return",
"new",
"Action",
"(",
"r",
"->",
"{",
"r",
".",
"addHeader",
"(",
"\"WWW-Authenticate\"",
",",
"\"Basic realm=\\\"\"",
"+",
"realm",
"+",
"\"\\\"\"",
")",
";",... | Returns unauthorized response | [
"Returns",
"unauthorized",
"response"
] | b999293616ca84fdea1ffe929e92a5db29c7e415 | https://github.com/mkotsur/restito/blob/b999293616ca84fdea1ffe929e92a5db29c7e415/src/main/java/com/xebialabs/restito/semantics/Action.java#L222-L228 | train |
mkotsur/restito | src/main/java/com/xebialabs/restito/semantics/Action.java | Action.delay | public static Action delay(final Integer delay) {
return new Action(input -> {
try {
Thread.sleep(delay);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
return input;
});
} | java | public static Action delay(final Integer delay) {
return new Action(input -> {
try {
Thread.sleep(delay);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
return input;
});
} | [
"public",
"static",
"Action",
"delay",
"(",
"final",
"Integer",
"delay",
")",
"{",
"return",
"new",
"Action",
"(",
"input",
"->",
"{",
"try",
"{",
"Thread",
".",
"sleep",
"(",
"delay",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"e",
")",
"{",... | Sleeps so many milliseconds, emulating slow requests. | [
"Sleeps",
"so",
"many",
"milliseconds",
"emulating",
"slow",
"requests",
"."
] | b999293616ca84fdea1ffe929e92a5db29c7e415 | https://github.com/mkotsur/restito/blob/b999293616ca84fdea1ffe929e92a5db29c7e415/src/main/java/com/xebialabs/restito/semantics/Action.java#L289-L298 | train |
mkotsur/restito | src/main/java/com/xebialabs/restito/server/StubServer.java | StubServer.run | public StubServer run() {
simpleServer.getServerConfiguration().addHttpHandler(stubsToHandler(), "/");
try {
if (secured) {
for (NetworkListener networkListener : simpleServer.getListeners()) {
networkListener.setSecure(true);
SSLEngine... | java | public StubServer run() {
simpleServer.getServerConfiguration().addHttpHandler(stubsToHandler(), "/");
try {
if (secured) {
for (NetworkListener networkListener : simpleServer.getListeners()) {
networkListener.setSecure(true);
SSLEngine... | [
"public",
"StubServer",
"run",
"(",
")",
"{",
"simpleServer",
".",
"getServerConfiguration",
"(",
")",
".",
"addHttpHandler",
"(",
"stubsToHandler",
"(",
")",
",",
"\"/\"",
")",
";",
"try",
"{",
"if",
"(",
"secured",
")",
"{",
"for",
"(",
"NetworkListener"... | Starts the server | [
"Starts",
"the",
"server"
] | b999293616ca84fdea1ffe929e92a5db29c7e415 | https://github.com/mkotsur/restito/blob/b999293616ca84fdea1ffe929e92a5db29c7e415/src/main/java/com/xebialabs/restito/server/StubServer.java#L128-L143 | train |
mkotsur/restito | src/main/java/com/xebialabs/restito/server/StubServer.java | StubServer.createCertificateStore | private String createCertificateStore(String resourceName) throws IOException {
URL resource = StubServer.class.getResource("/" + resourceName);
File store = File.createTempFile(resourceName, "store");
try (InputStream input = resource.openStream()) {
Files.copy(input, store.toPath()... | java | private String createCertificateStore(String resourceName) throws IOException {
URL resource = StubServer.class.getResource("/" + resourceName);
File store = File.createTempFile(resourceName, "store");
try (InputStream input = resource.openStream()) {
Files.copy(input, store.toPath()... | [
"private",
"String",
"createCertificateStore",
"(",
"String",
"resourceName",
")",
"throws",
"IOException",
"{",
"URL",
"resource",
"=",
"StubServer",
".",
"class",
".",
"getResource",
"(",
"\"/\"",
"+",
"resourceName",
")",
";",
"File",
"store",
"=",
"File",
... | Copy the Certificate store to the temporary directory, as it needs to be in a real file, not inside a jar for Grizzly to pick it up.
@param resourceName The Store to copy
@return The absolute path to the temporary keystore.
@throws IOException If the store could not be copied. | [
"Copy",
"the",
"Certificate",
"store",
"to",
"the",
"temporary",
"directory",
"as",
"it",
"needs",
"to",
"be",
"in",
"a",
"real",
"file",
"not",
"inside",
"a",
"jar",
"for",
"Grizzly",
"to",
"pick",
"it",
"up",
"."
] | b999293616ca84fdea1ffe929e92a5db29c7e415 | https://github.com/mkotsur/restito/blob/b999293616ca84fdea1ffe929e92a5db29c7e415/src/main/java/com/xebialabs/restito/server/StubServer.java#L166-L175 | train |
mkotsur/restito | src/main/java/com/xebialabs/restito/semantics/Condition.java | Condition.method | public static Condition method(final Method m) {
return new Condition(input -> m.equals(input.getMethod()));
} | java | public static Condition method(final Method m) {
return new Condition(input -> m.equals(input.getMethod()));
} | [
"public",
"static",
"Condition",
"method",
"(",
"final",
"Method",
"m",
")",
"{",
"return",
"new",
"Condition",
"(",
"input",
"->",
"m",
".",
"equals",
"(",
"input",
".",
"getMethod",
"(",
")",
")",
")",
";",
"}"
] | Checks HTTP method | [
"Checks",
"HTTP",
"method"
] | b999293616ca84fdea1ffe929e92a5db29c7e415 | https://github.com/mkotsur/restito/blob/b999293616ca84fdea1ffe929e92a5db29c7e415/src/main/java/com/xebialabs/restito/semantics/Condition.java#L59-L61 | train |
mkotsur/restito | src/main/java/com/xebialabs/restito/semantics/Condition.java | Condition.methodWithUriAndAutoDiscovery | private static ConditionWithApplicables methodWithUriAndAutoDiscovery(final Method m, String uri) {
try {
final URL resource = new SmartDiscoverer("restito").discoverResource(m, uri);
return new ConditionWithApplicables(composite(method(m), uri(uri)), resourceContent(resource));
... | java | private static ConditionWithApplicables methodWithUriAndAutoDiscovery(final Method m, String uri) {
try {
final URL resource = new SmartDiscoverer("restito").discoverResource(m, uri);
return new ConditionWithApplicables(composite(method(m), uri(uri)), resourceContent(resource));
... | [
"private",
"static",
"ConditionWithApplicables",
"methodWithUriAndAutoDiscovery",
"(",
"final",
"Method",
"m",
",",
"String",
"uri",
")",
"{",
"try",
"{",
"final",
"URL",
"resource",
"=",
"new",
"SmartDiscoverer",
"(",
"\"restito\"",
")",
".",
"discoverResource",
... | Checks HTTP method, URI and enables AutoDiscovery | [
"Checks",
"HTTP",
"method",
"URI",
"and",
"enables",
"AutoDiscovery"
] | b999293616ca84fdea1ffe929e92a5db29c7e415 | https://github.com/mkotsur/restito/blob/b999293616ca84fdea1ffe929e92a5db29c7e415/src/main/java/com/xebialabs/restito/semantics/Condition.java#L66-L75 | train |
mkotsur/restito | src/main/java/com/xebialabs/restito/semantics/Condition.java | Condition.parameter | public static Condition parameter(final String key, final String... parameterValues) {
return new Condition(input -> Arrays.equals(input.getParameters().get(key), parameterValues));
} | java | public static Condition parameter(final String key, final String... parameterValues) {
return new Condition(input -> Arrays.equals(input.getParameters().get(key), parameterValues));
} | [
"public",
"static",
"Condition",
"parameter",
"(",
"final",
"String",
"key",
",",
"final",
"String",
"...",
"parameterValues",
")",
"{",
"return",
"new",
"Condition",
"(",
"input",
"->",
"Arrays",
".",
"equals",
"(",
"input",
".",
"getParameters",
"(",
")",
... | Checks HTTP parameters. Also work with multi-valued parameters | [
"Checks",
"HTTP",
"parameters",
".",
"Also",
"work",
"with",
"multi",
"-",
"valued",
"parameters"
] | b999293616ca84fdea1ffe929e92a5db29c7e415 | https://github.com/mkotsur/restito/blob/b999293616ca84fdea1ffe929e92a5db29c7e415/src/main/java/com/xebialabs/restito/semantics/Condition.java#L80-L82 | train |
mkotsur/restito | src/main/java/com/xebialabs/restito/semantics/Condition.java | Condition.endsWithUri | public static Condition endsWithUri(final String uri) {
return new Condition(input -> input.getUri().endsWith(uri));
} | java | public static Condition endsWithUri(final String uri) {
return new Condition(input -> input.getUri().endsWith(uri));
} | [
"public",
"static",
"Condition",
"endsWithUri",
"(",
"final",
"String",
"uri",
")",
"{",
"return",
"new",
"Condition",
"(",
"input",
"->",
"input",
".",
"getUri",
"(",
")",
".",
"endsWith",
"(",
"uri",
")",
")",
";",
"}"
] | URI ends with | [
"URI",
"ends",
"with"
] | b999293616ca84fdea1ffe929e92a5db29c7e415 | https://github.com/mkotsur/restito/blob/b999293616ca84fdea1ffe929e92a5db29c7e415/src/main/java/com/xebialabs/restito/semantics/Condition.java#L101-L103 | train |
mkotsur/restito | src/main/java/com/xebialabs/restito/semantics/Condition.java | Condition.withPostBody | public static Condition withPostBody() {
return new Condition(input -> input.getPostBody() != null && input.getPostBody().length() > 0);
} | java | public static Condition withPostBody() {
return new Condition(input -> input.getPostBody() != null && input.getPostBody().length() > 0);
} | [
"public",
"static",
"Condition",
"withPostBody",
"(",
")",
"{",
"return",
"new",
"Condition",
"(",
"input",
"->",
"input",
".",
"getPostBody",
"(",
")",
"!=",
"null",
"&&",
"input",
".",
"getPostBody",
"(",
")",
".",
"length",
"(",
")",
">",
"0",
")",
... | Contains non-empty POST body | [
"Contains",
"non",
"-",
"empty",
"POST",
"body"
] | b999293616ca84fdea1ffe929e92a5db29c7e415 | https://github.com/mkotsur/restito/blob/b999293616ca84fdea1ffe929e92a5db29c7e415/src/main/java/com/xebialabs/restito/semantics/Condition.java#L122-L124 | train |
mkotsur/restito | src/main/java/com/xebialabs/restito/semantics/Condition.java | Condition.basicAuth | public static Condition basicAuth(String username, String password) {
final String authString = username + ":" + password;
final String encodedAuthString = new String(Base64.encodeBase64(authString.getBytes()));
return new Condition(input -> ("Basic " + encodedAuthString).equals(input.getAuthori... | java | public static Condition basicAuth(String username, String password) {
final String authString = username + ":" + password;
final String encodedAuthString = new String(Base64.encodeBase64(authString.getBytes()));
return new Condition(input -> ("Basic " + encodedAuthString).equals(input.getAuthori... | [
"public",
"static",
"Condition",
"basicAuth",
"(",
"String",
"username",
",",
"String",
"password",
")",
"{",
"final",
"String",
"authString",
"=",
"username",
"+",
"\":\"",
"+",
"password",
";",
"final",
"String",
"encodedAuthString",
"=",
"new",
"String",
"(... | If basic authentication is provided | [
"If",
"basic",
"authentication",
"is",
"provided"
] | b999293616ca84fdea1ffe929e92a5db29c7e415 | https://github.com/mkotsur/restito/blob/b999293616ca84fdea1ffe929e92a5db29c7e415/src/main/java/com/xebialabs/restito/semantics/Condition.java#L129-L133 | train |
mkotsur/restito | src/main/java/com/xebialabs/restito/semantics/Condition.java | Condition.withPostBodyContaining | public static Condition withPostBodyContaining(final String str) {
return new Condition(input -> input.getPostBody() != null && input.getPostBody().contains(str));
} | java | public static Condition withPostBodyContaining(final String str) {
return new Condition(input -> input.getPostBody() != null && input.getPostBody().contains(str));
} | [
"public",
"static",
"Condition",
"withPostBodyContaining",
"(",
"final",
"String",
"str",
")",
"{",
"return",
"new",
"Condition",
"(",
"input",
"->",
"input",
".",
"getPostBody",
"(",
")",
"!=",
"null",
"&&",
"input",
".",
"getPostBody",
"(",
")",
".",
"co... | With POST body containing string | [
"With",
"POST",
"body",
"containing",
"string"
] | b999293616ca84fdea1ffe929e92a5db29c7e415 | https://github.com/mkotsur/restito/blob/b999293616ca84fdea1ffe929e92a5db29c7e415/src/main/java/com/xebialabs/restito/semantics/Condition.java#L152-L154 | train |
mkotsur/restito | src/main/java/com/xebialabs/restito/semantics/Condition.java | Condition.withPostBodyContaining | public static Condition withPostBodyContaining(final Pattern pattern) {
return new Condition(input -> input.getPostBody().matches(pattern.pattern()));
} | java | public static Condition withPostBodyContaining(final Pattern pattern) {
return new Condition(input -> input.getPostBody().matches(pattern.pattern()));
} | [
"public",
"static",
"Condition",
"withPostBodyContaining",
"(",
"final",
"Pattern",
"pattern",
")",
"{",
"return",
"new",
"Condition",
"(",
"input",
"->",
"input",
".",
"getPostBody",
"(",
")",
".",
"matches",
"(",
"pattern",
".",
"pattern",
"(",
")",
")",
... | With post body matching pattern | [
"With",
"post",
"body",
"matching",
"pattern"
] | b999293616ca84fdea1ffe929e92a5db29c7e415 | https://github.com/mkotsur/restito/blob/b999293616ca84fdea1ffe929e92a5db29c7e415/src/main/java/com/xebialabs/restito/semantics/Condition.java#L159-L161 | train |
treasure-data/td-client-java | src/main/java/com/treasuredata/client/TDHttpClient.java | TDHttpClient.submitRequest | public <Result> Result submitRequest(TDApiRequest apiRequest, Optional<String> apiKeyCache, TDHttpRequestHandler<Result> handler)
throws TDClientException
{
RequestContext requestContext = new RequestContext(config, apiRequest, apiKeyCache);
try {
return submitRequest(request... | java | public <Result> Result submitRequest(TDApiRequest apiRequest, Optional<String> apiKeyCache, TDHttpRequestHandler<Result> handler)
throws TDClientException
{
RequestContext requestContext = new RequestContext(config, apiRequest, apiKeyCache);
try {
return submitRequest(request... | [
"public",
"<",
"Result",
">",
"Result",
"submitRequest",
"(",
"TDApiRequest",
"apiRequest",
",",
"Optional",
"<",
"String",
">",
"apiKeyCache",
",",
"TDHttpRequestHandler",
"<",
"Result",
">",
"handler",
")",
"throws",
"TDClientException",
"{",
"RequestContext",
"... | A low-level method to submit a TD API request.
@param apiRequest
@param apiKeyCache
@param handler
@param <Result>
@return
@throws TDClientException | [
"A",
"low",
"-",
"level",
"method",
"to",
"submit",
"a",
"TD",
"API",
"request",
"."
] | 2769cbcf0e787d457344422cfcdde467399bd684 | https://github.com/treasure-data/td-client-java/blob/2769cbcf0e787d457344422cfcdde467399bd684/src/main/java/com/treasuredata/client/TDHttpClient.java#L455-L472 | train |
treasure-data/td-client-java | src/main/java/com/treasuredata/client/TDHttpClient.java | TDHttpClient.call | public <Result> Result call(TDApiRequest apiRequest, Optional<String> apiKeyCache, final Function<InputStream, Result> contentStreamHandler)
{
return submitRequest(apiRequest, apiKeyCache, newByteStreamHandler(contentStreamHandler));
} | java | public <Result> Result call(TDApiRequest apiRequest, Optional<String> apiKeyCache, final Function<InputStream, Result> contentStreamHandler)
{
return submitRequest(apiRequest, apiKeyCache, newByteStreamHandler(contentStreamHandler));
} | [
"public",
"<",
"Result",
">",
"Result",
"call",
"(",
"TDApiRequest",
"apiRequest",
",",
"Optional",
"<",
"String",
">",
"apiKeyCache",
",",
"final",
"Function",
"<",
"InputStream",
",",
"Result",
">",
"contentStreamHandler",
")",
"{",
"return",
"submitRequest",
... | Submit an API request, and returns the byte InputStream. This stream is valid until exiting this function.
@param apiRequest
@param apiKeyCache
@param contentStreamHandler
@param <Result>
@return | [
"Submit",
"an",
"API",
"request",
"and",
"returns",
"the",
"byte",
"InputStream",
".",
"This",
"stream",
"is",
"valid",
"until",
"exiting",
"this",
"function",
"."
] | 2769cbcf0e787d457344422cfcdde467399bd684 | https://github.com/treasure-data/td-client-java/blob/2769cbcf0e787d457344422cfcdde467399bd684/src/main/java/com/treasuredata/client/TDHttpClient.java#L499-L502 | train |
treasure-data/td-client-java | src/main/java/com/treasuredata/client/TDHttpClient.java | TDHttpClient.call | public <Result> Result call(TDApiRequest apiRequest, Optional<String> apiKeyCache, final Class<Result> resultType)
throws TDClientException
{
return call(apiRequest, apiKeyCache, objectMapper.getTypeFactory().constructType(resultType));
} | java | public <Result> Result call(TDApiRequest apiRequest, Optional<String> apiKeyCache, final Class<Result> resultType)
throws TDClientException
{
return call(apiRequest, apiKeyCache, objectMapper.getTypeFactory().constructType(resultType));
} | [
"public",
"<",
"Result",
">",
"Result",
"call",
"(",
"TDApiRequest",
"apiRequest",
",",
"Optional",
"<",
"String",
">",
"apiKeyCache",
",",
"final",
"Class",
"<",
"Result",
">",
"resultType",
")",
"throws",
"TDClientException",
"{",
"return",
"call",
"(",
"a... | Submit an API request, and bind the returned JSON data into an object of the given result type.
For mapping it uses Jackson object mapper.
@param apiRequest
@param resultType
@param <Result>
@return
@throws TDClientException | [
"Submit",
"an",
"API",
"request",
"and",
"bind",
"the",
"returned",
"JSON",
"data",
"into",
"an",
"object",
"of",
"the",
"given",
"result",
"type",
".",
"For",
"mapping",
"it",
"uses",
"Jackson",
"object",
"mapper",
"."
] | 2769cbcf0e787d457344422cfcdde467399bd684 | https://github.com/treasure-data/td-client-java/blob/2769cbcf0e787d457344422cfcdde467399bd684/src/main/java/com/treasuredata/client/TDHttpClient.java#L514-L518 | train |
treasure-data/td-client-java | src/main/java/com/treasuredata/client/TDHttpClient.java | TDHttpClient.call | @SuppressWarnings(value = "unchecked cast")
public <Result> Result call(TDApiRequest apiRequest, Optional<String> apiKeyCache, final JavaType resultType)
throws TDClientException
{
try {
byte[] content = submitRequest(apiRequest, apiKeyCache, byteArrayContentHandler);
... | java | @SuppressWarnings(value = "unchecked cast")
public <Result> Result call(TDApiRequest apiRequest, Optional<String> apiKeyCache, final JavaType resultType)
throws TDClientException
{
try {
byte[] content = submitRequest(apiRequest, apiKeyCache, byteArrayContentHandler);
... | [
"@",
"SuppressWarnings",
"(",
"value",
"=",
"\"unchecked cast\"",
")",
"public",
"<",
"Result",
">",
"Result",
"call",
"(",
"TDApiRequest",
"apiRequest",
",",
"Optional",
"<",
"String",
">",
"apiKeyCache",
",",
"final",
"JavaType",
"resultType",
")",
"throws",
... | Submit an API request, and bind the returned JSON data into an object of the given result jackson JavaType.
For mapping it uses Jackson object mapper.
@param apiRequest
@param resultType
@param <Result>
@return
@throws TDClientException | [
"Submit",
"an",
"API",
"request",
"and",
"bind",
"the",
"returned",
"JSON",
"data",
"into",
"an",
"object",
"of",
"the",
"given",
"result",
"jackson",
"JavaType",
".",
"For",
"mapping",
"it",
"uses",
"Jackson",
"object",
"mapper",
"."
] | 2769cbcf0e787d457344422cfcdde467399bd684 | https://github.com/treasure-data/td-client-java/blob/2769cbcf0e787d457344422cfcdde467399bd684/src/main/java/com/treasuredata/client/TDHttpClient.java#L546-L569 | train |
treasure-data/td-client-java | src/main/java/com/treasuredata/client/TDClientConfig.java | TDClientConfig.toProperties | public Properties toProperties()
{
Properties p = new Properties();
saveProperty(p, Type.API_ENDPOINT, endpoint);
saveProperty(p, Type.API_PORT, port);
saveProperty(p, Type.USESSL, useSSL);
saveProperty(p, Type.APIKEY, apiKey);
saveProperty(p, Type.USER, user);
... | java | public Properties toProperties()
{
Properties p = new Properties();
saveProperty(p, Type.API_ENDPOINT, endpoint);
saveProperty(p, Type.API_PORT, port);
saveProperty(p, Type.USESSL, useSSL);
saveProperty(p, Type.APIKEY, apiKey);
saveProperty(p, Type.USER, user);
... | [
"public",
"Properties",
"toProperties",
"(",
")",
"{",
"Properties",
"p",
"=",
"new",
"Properties",
"(",
")",
";",
"saveProperty",
"(",
"p",
",",
"Type",
".",
"API_ENDPOINT",
",",
"endpoint",
")",
";",
"saveProperty",
"(",
"p",
",",
"Type",
".",
"API_POR... | Output this configuration as a Properties object
@return | [
"Output",
"this",
"configuration",
"as",
"a",
"Properties",
"object"
] | 2769cbcf0e787d457344422cfcdde467399bd684 | https://github.com/treasure-data/td-client-java/blob/2769cbcf0e787d457344422cfcdde467399bd684/src/main/java/com/treasuredata/client/TDClientConfig.java#L191-L215 | train |
treasure-data/td-client-java | src/main/java/com/treasuredata/client/TDClient.java | TDClient.withApiKey | @Override
public TDClient withApiKey(String newApiKey)
{
return new TDClient(config, httpClient, Optional.of(newApiKey));
} | java | @Override
public TDClient withApiKey(String newApiKey)
{
return new TDClient(config, httpClient, Optional.of(newApiKey));
} | [
"@",
"Override",
"public",
"TDClient",
"withApiKey",
"(",
"String",
"newApiKey",
")",
"{",
"return",
"new",
"TDClient",
"(",
"config",
",",
"httpClient",
",",
"Optional",
".",
"of",
"(",
"newApiKey",
")",
")",
";",
"}"
] | Create a new TDClient that uses the given api key for the authentication.
The new instance of TDClient shares the same HttpClient, so closing this will invalidate the other copy of TDClient instances
@param newApiKey
@return | [
"Create",
"a",
"new",
"TDClient",
"that",
"uses",
"the",
"given",
"api",
"key",
"for",
"the",
"authentication",
".",
"The",
"new",
"instance",
"of",
"TDClient",
"shares",
"the",
"same",
"HttpClient",
"so",
"closing",
"this",
"will",
"invalidate",
"the",
"oth... | 2769cbcf0e787d457344422cfcdde467399bd684 | https://github.com/treasure-data/td-client-java/blob/2769cbcf0e787d457344422cfcdde467399bd684/src/main/java/com/treasuredata/client/TDClient.java#L143-L147 | train |
treasure-data/td-client-java | src/main/java/com/treasuredata/client/TDRequestErrorHandler.java | TDRequestErrorHandler.clientError | private static TDClientHttpException clientError(TDClientHttpException e, ResponseContext responseContext)
{
boolean showWarning = true;
boolean showStackTrace = false;
int code = e.getStatusCode();
switch (code) {
case HttpStatus.NOT_FOUND_404:
// Not fou... | java | private static TDClientHttpException clientError(TDClientHttpException e, ResponseContext responseContext)
{
boolean showWarning = true;
boolean showStackTrace = false;
int code = e.getStatusCode();
switch (code) {
case HttpStatus.NOT_FOUND_404:
// Not fou... | [
"private",
"static",
"TDClientHttpException",
"clientError",
"(",
"TDClientHttpException",
"e",
",",
"ResponseContext",
"responseContext",
")",
"{",
"boolean",
"showWarning",
"=",
"true",
";",
"boolean",
"showStackTrace",
"=",
"false",
";",
"int",
"code",
"=",
"e",
... | Show or suppress warning messages for TDClientHttpException | [
"Show",
"or",
"suppress",
"warning",
"messages",
"for",
"TDClientHttpException"
] | 2769cbcf0e787d457344422cfcdde467399bd684 | https://github.com/treasure-data/td-client-java/blob/2769cbcf0e787d457344422cfcdde467399bd684/src/main/java/com/treasuredata/client/TDRequestErrorHandler.java#L66-L96 | train |
treasure-data/td-client-java | src/main/java/com/treasuredata/client/model/TDSavedQueryUpdateRequest.java | TDSavedQueryUpdateRequest.merge | @VisibleForTesting
public TDSaveQueryRequest merge(TDSavedQuery base)
{
return new TDSaveQueryRequest(
name.or(base.getName()),
cron.or(base.getCron()),
type.or(base.getType()),
query.or(base.getQuery()),
timezone.or(base.ge... | java | @VisibleForTesting
public TDSaveQueryRequest merge(TDSavedQuery base)
{
return new TDSaveQueryRequest(
name.or(base.getName()),
cron.or(base.getCron()),
type.or(base.getType()),
query.or(base.getQuery()),
timezone.or(base.ge... | [
"@",
"VisibleForTesting",
"public",
"TDSaveQueryRequest",
"merge",
"(",
"TDSavedQuery",
"base",
")",
"{",
"return",
"new",
"TDSaveQueryRequest",
"(",
"name",
".",
"or",
"(",
"base",
".",
"getName",
"(",
")",
")",
",",
"cron",
".",
"or",
"(",
"base",
".",
... | Apply this update to the given TDSaveQuery objects and create a new TDSaveQueryRequest object.
@param base
@return | [
"Apply",
"this",
"update",
"to",
"the",
"given",
"TDSaveQuery",
"objects",
"and",
"create",
"a",
"new",
"TDSaveQueryRequest",
"object",
"."
] | 2769cbcf0e787d457344422cfcdde467399bd684 | https://github.com/treasure-data/td-client-java/blob/2769cbcf0e787d457344422cfcdde467399bd684/src/main/java/com/treasuredata/client/model/TDSavedQueryUpdateRequest.java#L102-L117 | train |
treasure-data/td-client-java | src/main/java/com/treasuredata/client/model/TDJob.java | TDJob.getCmdOut | public String getCmdOut()
{
return debug.transform(new Function<Debug, String>()
{
@Override
public String apply(Debug input)
{
return input.getCmdout();
}
}).or("");
} | java | public String getCmdOut()
{
return debug.transform(new Function<Debug, String>()
{
@Override
public String apply(Debug input)
{
return input.getCmdout();
}
}).or("");
} | [
"public",
"String",
"getCmdOut",
"(",
")",
"{",
"return",
"debug",
".",
"transform",
"(",
"new",
"Function",
"<",
"Debug",
",",
"String",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"String",
"apply",
"(",
"Debug",
"input",
")",
"{",
"return",
"inpu... | A short cut for reading cmdout message
@return | [
"A",
"short",
"cut",
"for",
"reading",
"cmdout",
"message"
] | 2769cbcf0e787d457344422cfcdde467399bd684 | https://github.com/treasure-data/td-client-java/blob/2769cbcf0e787d457344422cfcdde467399bd684/src/main/java/com/treasuredata/client/model/TDJob.java#L347-L357 | train |
treasure-data/td-client-java | src/main/java/com/treasuredata/client/model/TDJob.java | TDJob.getStdErr | public String getStdErr()
{
return debug.transform(new Function<Debug, String>()
{
@Override
public String apply(Debug input)
{
return input.getStderr();
}
}).or("");
} | java | public String getStdErr()
{
return debug.transform(new Function<Debug, String>()
{
@Override
public String apply(Debug input)
{
return input.getStderr();
}
}).or("");
} | [
"public",
"String",
"getStdErr",
"(",
")",
"{",
"return",
"debug",
".",
"transform",
"(",
"new",
"Function",
"<",
"Debug",
",",
"String",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"String",
"apply",
"(",
"Debug",
"input",
")",
"{",
"return",
"inpu... | A short cut for reading stderr messsage
@return | [
"A",
"short",
"cut",
"for",
"reading",
"stderr",
"messsage"
] | 2769cbcf0e787d457344422cfcdde467399bd684 | https://github.com/treasure-data/td-client-java/blob/2769cbcf0e787d457344422cfcdde467399bd684/src/main/java/com/treasuredata/client/model/TDJob.java#L364-L374 | train |
treasure-data/td-client-java | src/main/java/com/treasuredata/client/AbstractTDClientBuilder.java | AbstractTDClientBuilder.buildConfig | public TDClientConfig buildConfig()
{
return new TDClientConfig(
endpoint,
port,
useSSL,
apiKey,
user,
password,
proxy,
retryLimit,
retryInitialIntervalMillis,
... | java | public TDClientConfig buildConfig()
{
return new TDClientConfig(
endpoint,
port,
useSSL,
apiKey,
user,
password,
proxy,
retryLimit,
retryInitialIntervalMillis,
... | [
"public",
"TDClientConfig",
"buildConfig",
"(",
")",
"{",
"return",
"new",
"TDClientConfig",
"(",
"endpoint",
",",
"port",
",",
"useSSL",
",",
"apiKey",
",",
"user",
",",
"password",
",",
"proxy",
",",
"retryLimit",
",",
"retryInitialIntervalMillis",
",",
"ret... | Build a config object.
@return | [
"Build",
"a",
"config",
"object",
"."
] | 2769cbcf0e787d457344422cfcdde467399bd684 | https://github.com/treasure-data/td-client-java/blob/2769cbcf0e787d457344422cfcdde467399bd684/src/main/java/com/treasuredata/client/AbstractTDClientBuilder.java#L335-L353 | train |
twitter/chill | chill-java/src/main/java/com/twitter/chill/config/ConfiguredInstantiator.java | ConfiguredInstantiator.fastSplitKey | public static String[] fastSplitKey(String key) {
int i = key.indexOf(':');
if(-1 == i) {
return new String[]{key};
}
else {
int j = key.indexOf(':', i+1);
if (-1 != j) {
return null;
}
else {
return new String[]{key.substring(0, i), key.substring(i+1)};
... | java | public static String[] fastSplitKey(String key) {
int i = key.indexOf(':');
if(-1 == i) {
return new String[]{key};
}
else {
int j = key.indexOf(':', i+1);
if (-1 != j) {
return null;
}
else {
return new String[]{key.substring(0, i), key.substring(i+1)};
... | [
"public",
"static",
"String",
"[",
"]",
"fastSplitKey",
"(",
"String",
"key",
")",
"{",
"int",
"i",
"=",
"key",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"-",
"1",
"==",
"i",
")",
"{",
"return",
"new",
"String",
"[",
"]",
"{",
"key",
... | Java's string split is very expensive due to regexes.
Implement our own simple version instead. | [
"Java",
"s",
"string",
"split",
"is",
"very",
"expensive",
"due",
"to",
"regexes",
".",
"Implement",
"our",
"own",
"simple",
"version",
"instead",
"."
] | 0919984ec3aeb320ff522911c726425e9f18ea41 | https://github.com/twitter/chill/blob/0919984ec3aeb320ff522911c726425e9f18ea41/chill-java/src/main/java/com/twitter/chill/config/ConfiguredInstantiator.java#L177-L191 | train |
twitter/chill | chill-java/src/main/java/com/twitter/chill/config/ReflectingInstantiator.java | ReflectingInstantiator.newKryoWithEx | protected Kryo newKryoWithEx() throws InstantiationException, IllegalAccessException {
Kryo k = kryoClass.newInstance();
k.setInstantiatorStrategy(instStratClass.newInstance());
k.setRegistrationRequired(regRequired);
for(IKryoRegistrar kr: registrations) {
kr.apply(k);
}
for(IKryoRegistra... | java | protected Kryo newKryoWithEx() throws InstantiationException, IllegalAccessException {
Kryo k = kryoClass.newInstance();
k.setInstantiatorStrategy(instStratClass.newInstance());
k.setRegistrationRequired(regRequired);
for(IKryoRegistrar kr: registrations) {
kr.apply(k);
}
for(IKryoRegistra... | [
"protected",
"Kryo",
"newKryoWithEx",
"(",
")",
"throws",
"InstantiationException",
",",
"IllegalAccessException",
"{",
"Kryo",
"k",
"=",
"kryoClass",
".",
"newInstance",
"(",
")",
";",
"k",
".",
"setInstantiatorStrategy",
"(",
"instStratClass",
".",
"newInstance",
... | This one adds expeption annotations that the interface does not have | [
"This",
"one",
"adds",
"expeption",
"annotations",
"that",
"the",
"interface",
"does",
"not",
"have"
] | 0919984ec3aeb320ff522911c726425e9f18ea41 | https://github.com/twitter/chill/blob/0919984ec3aeb320ff522911c726425e9f18ea41/chill-java/src/main/java/com/twitter/chill/config/ReflectingInstantiator.java#L113-L124 | train |
twitter/chill | chill-java/src/main/java/com/twitter/chill/KryoInstantiator.java | KryoInstantiator.setClassLoader | public KryoInstantiator setClassLoader(final ClassLoader cl) {
return new KryoInstantiator() {
public Kryo newKryo() {
Kryo k = KryoInstantiator.this.newKryo();
k.setClassLoader(cl);
return k;
}
};
} | java | public KryoInstantiator setClassLoader(final ClassLoader cl) {
return new KryoInstantiator() {
public Kryo newKryo() {
Kryo k = KryoInstantiator.this.newKryo();
k.setClassLoader(cl);
return k;
}
};
} | [
"public",
"KryoInstantiator",
"setClassLoader",
"(",
"final",
"ClassLoader",
"cl",
")",
"{",
"return",
"new",
"KryoInstantiator",
"(",
")",
"{",
"public",
"Kryo",
"newKryo",
"(",
")",
"{",
"Kryo",
"k",
"=",
"KryoInstantiator",
".",
"this",
".",
"newKryo",
"(... | Use this to set a specific classloader | [
"Use",
"this",
"to",
"set",
"a",
"specific",
"classloader"
] | 0919984ec3aeb320ff522911c726425e9f18ea41 | https://github.com/twitter/chill/blob/0919984ec3aeb320ff522911c726425e9f18ea41/chill-java/src/main/java/com/twitter/chill/KryoInstantiator.java#L32-L40 | train |
twitter/chill | chill-java/src/main/java/com/twitter/chill/KryoInstantiator.java | KryoInstantiator.setReferences | public KryoInstantiator setReferences(final boolean ref) {
return new KryoInstantiator() {
public Kryo newKryo() {
Kryo k = KryoInstantiator.this.newKryo();
/**
* Kryo 2.17, used in storm, has this method returning void,
* 2.21 has it returning boolean.
* Try not to ... | java | public KryoInstantiator setReferences(final boolean ref) {
return new KryoInstantiator() {
public Kryo newKryo() {
Kryo k = KryoInstantiator.this.newKryo();
/**
* Kryo 2.17, used in storm, has this method returning void,
* 2.21 has it returning boolean.
* Try not to ... | [
"public",
"KryoInstantiator",
"setReferences",
"(",
"final",
"boolean",
"ref",
")",
"{",
"return",
"new",
"KryoInstantiator",
"(",
")",
"{",
"public",
"Kryo",
"newKryo",
"(",
")",
"{",
"Kryo",
"k",
"=",
"KryoInstantiator",
".",
"this",
".",
"newKryo",
"(",
... | If true, Kryo keeps a map of all the objects it has seen.
this can use a ton of memory on hadoop, but save serialization costs in
some cases | [
"If",
"true",
"Kryo",
"keeps",
"a",
"map",
"of",
"all",
"the",
"objects",
"it",
"has",
"seen",
".",
"this",
"can",
"use",
"a",
"ton",
"of",
"memory",
"on",
"hadoop",
"but",
"save",
"serialization",
"costs",
"in",
"some",
"cases"
] | 0919984ec3aeb320ff522911c726425e9f18ea41 | https://github.com/twitter/chill/blob/0919984ec3aeb320ff522911c726425e9f18ea41/chill-java/src/main/java/com/twitter/chill/KryoInstantiator.java#L57-L70 | train |
twitter/chill | chill-java/src/main/java/com/twitter/chill/config/JavaMapConfig.java | JavaMapConfig.get | @Override
public String get(String key) {
Object value = conf.get(key);
if(null != value) {
return value.toString();
}
else {
return null;
}
} | java | @Override
public String get(String key) {
Object value = conf.get(key);
if(null != value) {
return value.toString();
}
else {
return null;
}
} | [
"@",
"Override",
"public",
"String",
"get",
"(",
"String",
"key",
")",
"{",
"Object",
"value",
"=",
"conf",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"null",
"!=",
"value",
")",
"{",
"return",
"value",
".",
"toString",
"(",
")",
";",
"}",
"els... | Return null if this key is undefined | [
"Return",
"null",
"if",
"this",
"key",
"is",
"undefined"
] | 0919984ec3aeb320ff522911c726425e9f18ea41 | https://github.com/twitter/chill/blob/0919984ec3aeb320ff522911c726425e9f18ea41/chill-java/src/main/java/com/twitter/chill/config/JavaMapConfig.java#L35-L44 | train |
twitter/chill | chill-java/src/main/java/com/twitter/chill/SerDeState.java | SerDeState.writeOutputTo | public void writeOutputTo(OutputStream os) throws IOException {
os.write(output.getBuffer(), 0, output.position());
} | java | public void writeOutputTo(OutputStream os) throws IOException {
os.write(output.getBuffer(), 0, output.position());
} | [
"public",
"void",
"writeOutputTo",
"(",
"OutputStream",
"os",
")",
"throws",
"IOException",
"{",
"os",
".",
"write",
"(",
"output",
".",
"getBuffer",
"(",
")",
",",
"0",
",",
"output",
".",
"position",
"(",
")",
")",
";",
"}"
] | There for ByteArrayOutputStream cases this can be optimized | [
"There",
"for",
"ByteArrayOutputStream",
"cases",
"this",
"can",
"be",
"optimized"
] | 0919984ec3aeb320ff522911c726425e9f18ea41 | https://github.com/twitter/chill/blob/0919984ec3aeb320ff522911c726425e9f18ea41/chill-java/src/main/java/com/twitter/chill/SerDeState.java#L68-L70 | train |
pmwmedia/tinylog | benchmarks/src/main/java/org/tinylog/benchmarks/converters/BenchmarkOutputParser.java | BenchmarkOutputParser.openResource | private static InputStream openResource(final String file) throws IOException {
InputStream stream = HtmlConverterApplication.class.getResourceAsStream("/" + file);
if (stream == null) {
throw new FileNotFoundException(file);
} else {
return stream;
}
} | java | private static InputStream openResource(final String file) throws IOException {
InputStream stream = HtmlConverterApplication.class.getResourceAsStream("/" + file);
if (stream == null) {
throw new FileNotFoundException(file);
} else {
return stream;
}
} | [
"private",
"static",
"InputStream",
"openResource",
"(",
"final",
"String",
"file",
")",
"throws",
"IOException",
"{",
"InputStream",
"stream",
"=",
"HtmlConverterApplication",
".",
"class",
".",
"getResourceAsStream",
"(",
"\"/\"",
"+",
"file",
")",
";",
"if",
... | Opens a resource from classpath.
@param file
Filename of resource
@return Stream of given file
@throws IOException
Failed to open resource | [
"Opens",
"a",
"resource",
"from",
"classpath",
"."
] | d03d4ef84a1310155037e08ca8822a91697d1086 | https://github.com/pmwmedia/tinylog/blob/d03d4ef84a1310155037e08ca8822a91697d1086/benchmarks/src/main/java/org/tinylog/benchmarks/converters/BenchmarkOutputParser.java#L114-L121 | train |
pmwmedia/tinylog | tinylog-api/src/main/java/org/tinylog/runtime/RuntimeProvider.java | RuntimeProvider.resolveDialect | private static RuntimeDialect resolveDialect() {
if (getJavaVersion() >= MINIMUM_VERSION_MODERN_JAVA) {
return new ModernJavaRuntime();
} else if ("Android Runtime".equalsIgnoreCase(System.getProperty("java.runtime.name"))) {
return new AndroidRuntime();
} else {
return new LegacyJavaRuntime();
}
} | java | private static RuntimeDialect resolveDialect() {
if (getJavaVersion() >= MINIMUM_VERSION_MODERN_JAVA) {
return new ModernJavaRuntime();
} else if ("Android Runtime".equalsIgnoreCase(System.getProperty("java.runtime.name"))) {
return new AndroidRuntime();
} else {
return new LegacyJavaRuntime();
}
} | [
"private",
"static",
"RuntimeDialect",
"resolveDialect",
"(",
")",
"{",
"if",
"(",
"getJavaVersion",
"(",
")",
">=",
"MINIMUM_VERSION_MODERN_JAVA",
")",
"{",
"return",
"new",
"ModernJavaRuntime",
"(",
")",
";",
"}",
"else",
"if",
"(",
"\"Android Runtime\"",
".",... | Resolves the runtime dialect for the current VM.
@return Resolved runtime dialect | [
"Resolves",
"the",
"runtime",
"dialect",
"for",
"the",
"current",
"VM",
"."
] | d03d4ef84a1310155037e08ca8822a91697d1086 | https://github.com/pmwmedia/tinylog/blob/d03d4ef84a1310155037e08ca8822a91697d1086/tinylog-api/src/main/java/org/tinylog/runtime/RuntimeProvider.java#L123-L131 | train |
pmwmedia/tinylog | tinylog-api/src/main/java/org/tinylog/runtime/RuntimeProvider.java | RuntimeProvider.getJavaVersion | private static int getJavaVersion() {
String version = System.getProperty("java.version");
if (version == null) {
return -1;
} else {
int index = version.indexOf('.');
if (index > 0) {
version = version.substring(0, index);
}
try {
return Integer.parseInt(version);
} catch (NumberFormat... | java | private static int getJavaVersion() {
String version = System.getProperty("java.version");
if (version == null) {
return -1;
} else {
int index = version.indexOf('.');
if (index > 0) {
version = version.substring(0, index);
}
try {
return Integer.parseInt(version);
} catch (NumberFormat... | [
"private",
"static",
"int",
"getJavaVersion",
"(",
")",
"{",
"String",
"version",
"=",
"System",
".",
"getProperty",
"(",
"\"java.version\"",
")",
";",
"if",
"(",
"version",
"==",
"null",
")",
"{",
"return",
"-",
"1",
";",
"}",
"else",
"{",
"int",
"ind... | Gets the major version number of Java.
@return Major version number of Java or -1 if unknown | [
"Gets",
"the",
"major",
"version",
"number",
"of",
"Java",
"."
] | d03d4ef84a1310155037e08ca8822a91697d1086 | https://github.com/pmwmedia/tinylog/blob/d03d4ef84a1310155037e08ca8822a91697d1086/tinylog-api/src/main/java/org/tinylog/runtime/RuntimeProvider.java#L138-L154 | train |
pmwmedia/tinylog | tinylog-api/src/main/java/org/tinylog/runtime/RuntimeProvider.java | RuntimeProvider.stripAnonymousPart | private static String stripAnonymousPart(final String className) {
for (int index = className.indexOf("$", 0); index != -1; index = className.indexOf('$', index + 2)) {
/* Trailing dollar sign */
if (index >= className.length() - 1) {
return className.substring(0, index);
}
char firstLetter = classNa... | java | private static String stripAnonymousPart(final String className) {
for (int index = className.indexOf("$", 0); index != -1; index = className.indexOf('$', index + 2)) {
/* Trailing dollar sign */
if (index >= className.length() - 1) {
return className.substring(0, index);
}
char firstLetter = classNa... | [
"private",
"static",
"String",
"stripAnonymousPart",
"(",
"final",
"String",
"className",
")",
"{",
"for",
"(",
"int",
"index",
"=",
"className",
".",
"indexOf",
"(",
"\"$\"",
",",
"0",
")",
";",
"index",
"!=",
"-",
"1",
";",
"index",
"=",
"className",
... | Strips the the anonymous part from a class name.
@param className
Fully-qualified class name
@return Human-readable class name without any anonymous part | [
"Strips",
"the",
"the",
"anonymous",
"part",
"from",
"a",
"class",
"name",
"."
] | d03d4ef84a1310155037e08ca8822a91697d1086 | https://github.com/pmwmedia/tinylog/blob/d03d4ef84a1310155037e08ca8822a91697d1086/tinylog-api/src/main/java/org/tinylog/runtime/RuntimeProvider.java#L163-L178 | train |
pmwmedia/tinylog | tinylog-api/src/main/java/org/tinylog/runtime/RuntimeProvider.java | RuntimeProvider.normalizeClassName | private static StackTraceElement normalizeClassName(final StackTraceElement element) {
String className = element.getClassName();
int dollarIndex = className.indexOf("$");
if (dollarIndex == -1) {
return element;
} else {
className = stripAnonymousPart(className);
return new StackTraceElement(className... | java | private static StackTraceElement normalizeClassName(final StackTraceElement element) {
String className = element.getClassName();
int dollarIndex = className.indexOf("$");
if (dollarIndex == -1) {
return element;
} else {
className = stripAnonymousPart(className);
return new StackTraceElement(className... | [
"private",
"static",
"StackTraceElement",
"normalizeClassName",
"(",
"final",
"StackTraceElement",
"element",
")",
"{",
"String",
"className",
"=",
"element",
".",
"getClassName",
"(",
")",
";",
"int",
"dollarIndex",
"=",
"className",
".",
"indexOf",
"(",
"\"$\"",... | Strips the the anonymous part from a class name of stack trace element.
@param element
Original stack trace element
@return New or same stack trace element with an human-readable class name without any anonymous part | [
"Strips",
"the",
"the",
"anonymous",
"part",
"from",
"a",
"class",
"name",
"of",
"stack",
"trace",
"element",
"."
] | d03d4ef84a1310155037e08ca8822a91697d1086 | https://github.com/pmwmedia/tinylog/blob/d03d4ef84a1310155037e08ca8822a91697d1086/tinylog-api/src/main/java/org/tinylog/runtime/RuntimeProvider.java#L187-L196 | train |
pmwmedia/tinylog | tinylog-impl/src/main/java/org/tinylog/writers/LogcatWriter.java | LogcatWriter.renderTag | protected String renderTag(final LogEntry logEntry) {
StringBuilder builder = reuseOrCreate(tagBuilder, TAG_MAX_LENGTH);
tagToken.render(logEntry, builder);
if (builder.length() > TAG_MAX_LENGTH) {
return builder.substring(0, TAG_MAX_LENGTH - ELLIPSIS.length()) + ELLIPSIS;
} else {
return builder.toStrin... | java | protected String renderTag(final LogEntry logEntry) {
StringBuilder builder = reuseOrCreate(tagBuilder, TAG_MAX_LENGTH);
tagToken.render(logEntry, builder);
if (builder.length() > TAG_MAX_LENGTH) {
return builder.substring(0, TAG_MAX_LENGTH - ELLIPSIS.length()) + ELLIPSIS;
} else {
return builder.toStrin... | [
"protected",
"String",
"renderTag",
"(",
"final",
"LogEntry",
"logEntry",
")",
"{",
"StringBuilder",
"builder",
"=",
"reuseOrCreate",
"(",
"tagBuilder",
",",
"TAG_MAX_LENGTH",
")",
";",
"tagToken",
".",
"render",
"(",
"logEntry",
",",
"builder",
")",
";",
"if"... | Renders the tag from a log entry.
@param logEntry
Log entry for rendering tag
@return Rendered tag | [
"Renders",
"the",
"tag",
"from",
"a",
"log",
"entry",
"."
] | d03d4ef84a1310155037e08ca8822a91697d1086 | https://github.com/pmwmedia/tinylog/blob/d03d4ef84a1310155037e08ca8822a91697d1086/tinylog-impl/src/main/java/org/tinylog/writers/LogcatWriter.java#L126-L135 | train |
pmwmedia/tinylog | tinylog-impl/src/main/java/org/tinylog/writers/LogcatWriter.java | LogcatWriter.renderMessage | protected String renderMessage(final LogEntry logEntry) {
StringBuilder builder = reuseOrCreate(messageBuilder, MESSAGE_BUILDER_CAPACITY);
messageToken.render(logEntry, builder);
return builder.toString();
} | java | protected String renderMessage(final LogEntry logEntry) {
StringBuilder builder = reuseOrCreate(messageBuilder, MESSAGE_BUILDER_CAPACITY);
messageToken.render(logEntry, builder);
return builder.toString();
} | [
"protected",
"String",
"renderMessage",
"(",
"final",
"LogEntry",
"logEntry",
")",
"{",
"StringBuilder",
"builder",
"=",
"reuseOrCreate",
"(",
"messageBuilder",
",",
"MESSAGE_BUILDER_CAPACITY",
")",
";",
"messageToken",
".",
"render",
"(",
"logEntry",
",",
"builder"... | Renders the log message from a log entry.
@param logEntry
Log entry for rendering log message
@return Rendered log message | [
"Renders",
"the",
"log",
"message",
"from",
"a",
"log",
"entry",
"."
] | d03d4ef84a1310155037e08ca8822a91697d1086 | https://github.com/pmwmedia/tinylog/blob/d03d4ef84a1310155037e08ca8822a91697d1086/tinylog-impl/src/main/java/org/tinylog/writers/LogcatWriter.java#L144-L148 | train |
pmwmedia/tinylog | tinylog-api/src/main/java/org/tinylog/TaggedLogger.java | TaggedLogger.isCoveredByMinimumLevel | private static boolean isCoveredByMinimumLevel(final String tag, final Level level) {
return provider.getMinimumLevel(tag).ordinal() <= level.ordinal();
} | java | private static boolean isCoveredByMinimumLevel(final String tag, final Level level) {
return provider.getMinimumLevel(tag).ordinal() <= level.ordinal();
} | [
"private",
"static",
"boolean",
"isCoveredByMinimumLevel",
"(",
"final",
"String",
"tag",
",",
"final",
"Level",
"level",
")",
"{",
"return",
"provider",
".",
"getMinimumLevel",
"(",
"tag",
")",
".",
"ordinal",
"(",
")",
"<=",
"level",
".",
"ordinal",
"(",
... | Checks if a given tag and severity level is covered by the logging provider's minimum level.
@param tag
Tag to check
@param level
Severity level to check
@return {@code true} if given severity level is covered, otherwise {@code false} | [
"Checks",
"if",
"a",
"given",
"tag",
"and",
"severity",
"level",
"is",
"covered",
"by",
"the",
"logging",
"provider",
"s",
"minimum",
"level",
"."
] | d03d4ef84a1310155037e08ca8822a91697d1086 | https://github.com/pmwmedia/tinylog/blob/d03d4ef84a1310155037e08ca8822a91697d1086/tinylog-api/src/main/java/org/tinylog/TaggedLogger.java#L757-L759 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.