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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerTableAuditingPoliciesInner.java | ServerTableAuditingPoliciesInner.createOrUpdateAsync | public Observable<ServerTableAuditingPolicyInner> createOrUpdateAsync(String resourceGroupName, String serverName, ServerTableAuditingPolicyInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1<ServiceResponse<ServerTableAuditingPolicyInner>, ... | java | public Observable<ServerTableAuditingPolicyInner> createOrUpdateAsync(String resourceGroupName, String serverName, ServerTableAuditingPolicyInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1<ServiceResponse<ServerTableAuditingPolicyInner>, ... | [
"public",
"Observable",
"<",
"ServerTableAuditingPolicyInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"ServerTableAuditingPolicyInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
... | Creates or updates a servers's table auditing policy. Table auditing is deprecated, use blob auditing instead.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@para... | [
"Creates",
"or",
"updates",
"a",
"servers",
"s",
"table",
"auditing",
"policy",
".",
"Table",
"auditing",
"is",
"deprecated",
"use",
"blob",
"auditing",
"instead",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerTableAuditingPoliciesInner.java#L196-L203 | train |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerTableAuditingPoliciesInner.java | ServerTableAuditingPoliciesInner.listByServerAsync | public Observable<ServerTableAuditingPolicyListResultInner> listByServerAsync(String resourceGroupName, String serverName) {
return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<ServerTableAuditingPolicyListResultInner>, ServerTableAuditingPolicyListResultInne... | java | public Observable<ServerTableAuditingPolicyListResultInner> listByServerAsync(String resourceGroupName, String serverName) {
return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<ServerTableAuditingPolicyListResultInner>, ServerTableAuditingPolicyListResultInne... | [
"public",
"Observable",
"<",
"ServerTableAuditingPolicyListResultInner",
">",
"listByServerAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
")",
"{",
"return",
"listByServerWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
")",
... | Lists a servers's table auditing policies. Table auditing is deprecated, use blob auditing instead.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@throws IllegalA... | [
"Lists",
"a",
"servers",
"s",
"table",
"auditing",
"policies",
".",
"Table",
"auditing",
"is",
"deprecated",
"use",
"blob",
"auditing",
"instead",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerTableAuditingPoliciesInner.java#L289-L296 | train |
Azure/azure-sdk-for-java | mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/Exports.java | Exports.register | @Override
public void register(Builder.Registry registry) {
registry.add(new AzureAdTokenFactory());
registry.add(MediaContract.class, MediaExceptionProcessor.class);
registry.add(MediaRestProxy.class);
registry.add(OAuthFilter.class);
registry.add(ResourceLocationManager.cl... | java | @Override
public void register(Builder.Registry registry) {
registry.add(new AzureAdTokenFactory());
registry.add(MediaContract.class, MediaExceptionProcessor.class);
registry.add(MediaRestProxy.class);
registry.add(OAuthFilter.class);
registry.add(ResourceLocationManager.cl... | [
"@",
"Override",
"public",
"void",
"register",
"(",
"Builder",
".",
"Registry",
"registry",
")",
"{",
"registry",
".",
"add",
"(",
"new",
"AzureAdTokenFactory",
"(",
")",
")",
";",
"registry",
".",
"add",
"(",
"MediaContract",
".",
"class",
",",
"MediaExce... | register the Media services. | [
"register",
"the",
"Media",
"services",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/Exports.java#L43-L88 | train |
Azure/azure-sdk-for-java | eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReceivePump.java | ReceivePump.run | public void run() {
try {
ReceivePump.this.receiveAndProcess();
} catch (final Exception exception) {
if (TRACE_LOGGER.isErrorEnabled()) {
TRACE_LOGGER.error(
String.format(Locale.US, "Receive pump for eventHub (%s), consumerGroup (%s), par... | java | public void run() {
try {
ReceivePump.this.receiveAndProcess();
} catch (final Exception exception) {
if (TRACE_LOGGER.isErrorEnabled()) {
TRACE_LOGGER.error(
String.format(Locale.US, "Receive pump for eventHub (%s), consumerGroup (%s), par... | [
"public",
"void",
"run",
"(",
")",
"{",
"try",
"{",
"ReceivePump",
".",
"this",
".",
"receiveAndProcess",
"(",
")",
";",
"}",
"catch",
"(",
"final",
"Exception",
"exception",
")",
"{",
"if",
"(",
"TRACE_LOGGER",
".",
"isErrorEnabled",
"(",
")",
")",
"{... | entry-point - for runnable | [
"entry",
"-",
"point",
"-",
"for",
"runnable"
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReceivePump.java#L53-L66 | train |
Azure/azure-sdk-for-java | eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReceivePump.java | ReceivePump.receiveAndProcess | public void receiveAndProcess() {
if (this.shouldContinue()) {
this.receiver.receive(this.onReceiveHandler.getMaxEventCount())
.handleAsync(this.processAndReschedule, this.executor);
} else {
if (TRACE_LOGGER.isInfoEnabled()) {
TRACE_LOGGER.inf... | java | public void receiveAndProcess() {
if (this.shouldContinue()) {
this.receiver.receive(this.onReceiveHandler.getMaxEventCount())
.handleAsync(this.processAndReschedule, this.executor);
} else {
if (TRACE_LOGGER.isInfoEnabled()) {
TRACE_LOGGER.inf... | [
"public",
"void",
"receiveAndProcess",
"(",
")",
"{",
"if",
"(",
"this",
".",
"shouldContinue",
"(",
")",
")",
"{",
"this",
".",
"receiver",
".",
"receive",
"(",
"this",
".",
"onReceiveHandler",
".",
"getMaxEventCount",
"(",
")",
")",
".",
"handleAsync",
... | receives and invokes user-callback if success or stops pump if fails | [
"receives",
"and",
"invokes",
"user",
"-",
"callback",
"if",
"success",
"or",
"stops",
"pump",
"if",
"fails"
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReceivePump.java#L69-L82 | train |
Azure/azure-sdk-for-java | profiles/2018-03-01-hybrid/azure/src/main/java/com/microsoft/azure/management/profile_2018_03_01_hybrid/Azure.java | Azure.authenticate | public static Authenticated authenticate(AzureTokenCredentials credentials) {
return new AuthenticatedImpl(new RestClient.Builder()
.withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER)
.withCredentials(credentials)
.withSerializerAda... | java | public static Authenticated authenticate(AzureTokenCredentials credentials) {
return new AuthenticatedImpl(new RestClient.Builder()
.withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER)
.withCredentials(credentials)
.withSerializerAda... | [
"public",
"static",
"Authenticated",
"authenticate",
"(",
"AzureTokenCredentials",
"credentials",
")",
"{",
"return",
"new",
"AuthenticatedImpl",
"(",
"new",
"RestClient",
".",
"Builder",
"(",
")",
".",
"withBaseUrl",
"(",
"credentials",
".",
"environment",
"(",
"... | Creates an instance of Azure.Authenticated that exposes subscription, tenant, and authorization API entry points.
@param credentials the credentials to use
@return the Azure.Authenticated | [
"Creates",
"an",
"instance",
"of",
"Azure",
".",
"Authenticated",
"that",
"exposes",
"subscription",
"tenant",
"and",
"authorization",
"API",
"entry",
"points",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/profiles/2018-03-01-hybrid/azure/src/main/java/com/microsoft/azure/management/profile_2018_03_01_hybrid/Azure.java#L131-L138 | train |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DataMaskingPoliciesInner.java | DataMaskingPoliciesInner.getAsync | public Observable<DataMaskingPolicyInner> getAsync(String resourceGroupName, String serverName, String databaseName) {
return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<DataMaskingPolicyInner>, DataMaskingPolicyInner>() {
@Override
... | java | public Observable<DataMaskingPolicyInner> getAsync(String resourceGroupName, String serverName, String databaseName) {
return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<DataMaskingPolicyInner>, DataMaskingPolicyInner>() {
@Override
... | [
"public",
"Observable",
"<",
"DataMaskingPolicyInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
",",
... | Gets a database data masking policy.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database.
@throws IllegalArgumentException ... | [
"Gets",
"a",
"database",
"data",
"masking",
"policy",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DataMaskingPoliciesInner.java#L207-L214 | train |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/DscNodeConfigurationsInner.java | DscNodeConfigurationsInner.listByAutomationAccountNextAsync | public Observable<Page<DscNodeConfigurationInner>> listByAutomationAccountNextAsync(final String nextPageLink) {
return listByAutomationAccountNextWithServiceResponseAsync(nextPageLink)
.map(new Func1<ServiceResponse<Page<DscNodeConfigurationInner>>, Page<DscNodeConfigurationInner>>() {
... | java | public Observable<Page<DscNodeConfigurationInner>> listByAutomationAccountNextAsync(final String nextPageLink) {
return listByAutomationAccountNextWithServiceResponseAsync(nextPageLink)
.map(new Func1<ServiceResponse<Page<DscNodeConfigurationInner>>, Page<DscNodeConfigurationInner>>() {
... | [
"public",
"Observable",
"<",
"Page",
"<",
"DscNodeConfigurationInner",
">",
">",
"listByAutomationAccountNextAsync",
"(",
"final",
"String",
"nextPageLink",
")",
"{",
"return",
"listByAutomationAccountNextWithServiceResponseAsync",
"(",
"nextPageLink",
")",
".",
"map",
"(... | Retrieve a list of dsc node configurations.
@param nextPageLink The NextLink from the previous successful call to List operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<DscNodeConfigurationInner> object | [
"Retrieve",
"a",
"list",
"of",
"dsc",
"node",
"configurations",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/DscNodeConfigurationsInner.java#L655-L663 | train |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/IntegrationAccountAssembliesInner.java | IntegrationAccountAssembliesInner.listAsync | public Observable<List<AssemblyDefinitionInner>> listAsync(String resourceGroupName, String integrationAccountName) {
return listWithServiceResponseAsync(resourceGroupName, integrationAccountName).map(new Func1<ServiceResponse<List<AssemblyDefinitionInner>>, List<AssemblyDefinitionInner>>() {
@Overr... | java | public Observable<List<AssemblyDefinitionInner>> listAsync(String resourceGroupName, String integrationAccountName) {
return listWithServiceResponseAsync(resourceGroupName, integrationAccountName).map(new Func1<ServiceResponse<List<AssemblyDefinitionInner>>, List<AssemblyDefinitionInner>>() {
@Overr... | [
"public",
"Observable",
"<",
"List",
"<",
"AssemblyDefinitionInner",
">",
">",
"listAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"integrationAccountName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"integrationAccountN... | List the assemblies for an integration account.
@param resourceGroupName The resource group name.
@param integrationAccountName The integration account name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the List<AssemblyDefinitionInner> object | [
"List",
"the",
"assemblies",
"for",
"an",
"integration",
"account",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/IntegrationAccountAssembliesInner.java#L117-L124 | train |
Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/primitives/TrackingUtil.java | TrackingUtil.parseRoleIdentifier | static String parseRoleIdentifier(final String trackingId)
{
if (StringUtil.isNullOrWhiteSpace(trackingId) || !trackingId.contains(TRACKING_ID_TOKEN_SEPARATOR))
{
return null;
}
return trackingId.substring(trackingId.indexOf(TRACKING_ID_TOKEN_SEPARATOR));
} | java | static String parseRoleIdentifier(final String trackingId)
{
if (StringUtil.isNullOrWhiteSpace(trackingId) || !trackingId.contains(TRACKING_ID_TOKEN_SEPARATOR))
{
return null;
}
return trackingId.substring(trackingId.indexOf(TRACKING_ID_TOKEN_SEPARATOR));
} | [
"static",
"String",
"parseRoleIdentifier",
"(",
"final",
"String",
"trackingId",
")",
"{",
"if",
"(",
"StringUtil",
".",
"isNullOrWhiteSpace",
"(",
"trackingId",
")",
"||",
"!",
"trackingId",
".",
"contains",
"(",
"TRACKING_ID_TOKEN_SEPARATOR",
")",
")",
"{",
"r... | parses ServiceBus role identifiers from trackingId
@return null if no roleIdentifier found | [
"parses",
"ServiceBus",
"role",
"identifiers",
"from",
"trackingId"
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/primitives/TrackingUtil.java#L19-L27 | train |
Azure/azure-sdk-for-java | mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/MySQLManager.java | MySQLManager.authenticate | public static MySQLManager authenticate(AzureTokenCredentials credentials, String subscriptionId) {
return new MySQLManager(new RestClient.Builder()
.withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER)
.withCredentials(credentials)
.withSerializ... | java | public static MySQLManager authenticate(AzureTokenCredentials credentials, String subscriptionId) {
return new MySQLManager(new RestClient.Builder()
.withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER)
.withCredentials(credentials)
.withSerializ... | [
"public",
"static",
"MySQLManager",
"authenticate",
"(",
"AzureTokenCredentials",
"credentials",
",",
"String",
"subscriptionId",
")",
"{",
"return",
"new",
"MySQLManager",
"(",
"new",
"RestClient",
".",
"Builder",
"(",
")",
".",
"withBaseUrl",
"(",
"credentials",
... | Creates an instance of MySQLManager that exposes DBforMySQL resource management API entry points.
@param credentials the credentials to use
@param subscriptionId the subscription UUID
@return the MySQLManager | [
"Creates",
"an",
"instance",
"of",
"MySQLManager",
"that",
"exposes",
"DBforMySQL",
"resource",
"management",
"API",
"entry",
"points",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/MySQLManager.java#L59-L66 | train |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/JobSchedulesInner.java | JobSchedulesInner.delete | public void delete(String resourceGroupName, String automationAccountName, UUID jobScheduleId) {
deleteWithServiceResponseAsync(resourceGroupName, automationAccountName, jobScheduleId).toBlocking().single().body();
} | java | public void delete(String resourceGroupName, String automationAccountName, UUID jobScheduleId) {
deleteWithServiceResponseAsync(resourceGroupName, automationAccountName, jobScheduleId).toBlocking().single().body();
} | [
"public",
"void",
"delete",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"UUID",
"jobScheduleId",
")",
"{",
"deleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"automationAccountName",
",",
"jobScheduleId",
")",
".",
"toB... | Delete the job schedule identified by job schedule name.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param jobScheduleId The job schedule name.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponse... | [
"Delete",
"the",
"job",
"schedule",
"identified",
"by",
"job",
"schedule",
"name",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/JobSchedulesInner.java#L98-L100 | train |
Azure/azure-sdk-for-java | applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentsInner.java | ComponentsInner.getByResourceGroupAsync | public Observable<ApplicationInsightsComponentInner> getByResourceGroupAsync(String resourceGroupName, String resourceName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<ApplicationInsightsComponentInner>, ApplicationInsightsComponentInner>() ... | java | public Observable<ApplicationInsightsComponentInner> getByResourceGroupAsync(String resourceGroupName, String resourceName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<ApplicationInsightsComponentInner>, ApplicationInsightsComponentInner>() ... | [
"public",
"Observable",
"<",
"ApplicationInsightsComponentInner",
">",
"getByResourceGroupAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
... | Returns an Application Insights component.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights component resource.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ApplicationInsightsComponentInner obje... | [
"Returns",
"an",
"Application",
"Insights",
"component",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentsInner.java#L457-L464 | train |
Azure/azure-sdk-for-java | common/azure-common/src/main/java/com/azure/common/implementation/Validator.java | Validator.validate | public static void validate(Object parameter) {
// Validation of top level payload is done outside
if (parameter == null) {
return;
}
Class<?> type = parameter.getClass();
if (type == Double.class
|| type == Float.class
|| type == Long... | java | public static void validate(Object parameter) {
// Validation of top level payload is done outside
if (parameter == null) {
return;
}
Class<?> type = parameter.getClass();
if (type == Double.class
|| type == Float.class
|| type == Long... | [
"public",
"static",
"void",
"validate",
"(",
"Object",
"parameter",
")",
"{",
"// Validation of top level payload is done outside",
"if",
"(",
"parameter",
"==",
"null",
")",
"{",
"return",
";",
"}",
"Class",
"<",
"?",
">",
"type",
"=",
"parameter",
".",
"getC... | Validates a user provided required parameter to be not null.
An {@link IllegalArgumentException} is thrown if a property fails the validation.
@param parameter the parameter to validate
@throws IllegalArgumentException thrown when the Validator determines the argument is invalid | [
"Validates",
"a",
"user",
"provided",
"required",
"parameter",
"to",
"be",
"not",
"null",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/implementation/Validator.java#L36-L73 | train |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabasesInner.java | DatabasesInner.getAsync | public Observable<DatabaseInner> getAsync(String resourceGroupName, String serverName, String databaseName, String expand) {
return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName, expand).map(new Func1<ServiceResponse<DatabaseInner>, DatabaseInner>() {
@Override
... | java | public Observable<DatabaseInner> getAsync(String resourceGroupName, String serverName, String databaseName, String expand) {
return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName, expand).map(new Func1<ServiceResponse<DatabaseInner>, DatabaseInner>() {
@Override
... | [
"public",
"Observable",
"<",
"DatabaseInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"expand",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Gets a database.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database to be retrieved.
@param expand A comma separated list ... | [
"Gets",
"a",
"database",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabasesInner.java#L1089-L1096 | train |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabasesInner.java | DatabasesInner.listByServer | public List<DatabaseInner> listByServer(String resourceGroupName, String serverName, String expand, String filter) {
return listByServerWithServiceResponseAsync(resourceGroupName, serverName, expand, filter).toBlocking().single().body();
} | java | public List<DatabaseInner> listByServer(String resourceGroupName, String serverName, String expand, String filter) {
return listByServerWithServiceResponseAsync(resourceGroupName, serverName, expand, filter).toBlocking().single().body();
} | [
"public",
"List",
"<",
"DatabaseInner",
">",
"listByServer",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"expand",
",",
"String",
"filter",
")",
"{",
"return",
"listByServerWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Returns a list of databases in a server.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param expand A comma separated list of child objects to expand in the resp... | [
"Returns",
"a",
"list",
"of",
"databases",
"in",
"a",
"server",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabasesInner.java#L1243-L1245 | train |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobExecutionsInner.java | JobExecutionsInner.get | public JobExecutionInner get(String resourceGroupName, String serverName, String jobAgentName, String jobName, UUID jobExecutionId) {
return getWithServiceResponseAsync(resourceGroupName, serverName, jobAgentName, jobName, jobExecutionId).toBlocking().single().body();
} | java | public JobExecutionInner get(String resourceGroupName, String serverName, String jobAgentName, String jobName, UUID jobExecutionId) {
return getWithServiceResponseAsync(resourceGroupName, serverName, jobAgentName, jobName, jobExecutionId).toBlocking().single().body();
} | [
"public",
"JobExecutionInner",
"get",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"jobAgentName",
",",
"String",
"jobName",
",",
"UUID",
"jobExecutionId",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
... | Gets a job execution.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param jobAgentName The name of the job agent.
@param jobName The name of the job.
@param jobE... | [
"Gets",
"a",
"job",
"execution",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobExecutionsInner.java#L1019-L1021 | train |
Azure/azure-sdk-for-java | datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/VirtualNetworkRulesInner.java | VirtualNetworkRulesInner.getAsync | public Observable<VirtualNetworkRuleInner> getAsync(String resourceGroupName, String accountName, String virtualNetworkRuleName) {
return getWithServiceResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName).map(new Func1<ServiceResponse<VirtualNetworkRuleInner>, VirtualNetworkRuleInner>() {
... | java | public Observable<VirtualNetworkRuleInner> getAsync(String resourceGroupName, String accountName, String virtualNetworkRuleName) {
return getWithServiceResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName).map(new Func1<ServiceResponse<VirtualNetworkRuleInner>, VirtualNetworkRuleInner>() {
... | [
"public",
"Observable",
"<",
"VirtualNetworkRuleInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"virtualNetworkRuleName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountNa... | Gets the specified Data Lake Store virtual network rule.
@param resourceGroupName The name of the Azure resource group.
@param accountName The name of the Data Lake Store account.
@param virtualNetworkRuleName The name of the virtual network rule to retrieve.
@throws IllegalArgumentException thrown if parameters fail ... | [
"Gets",
"the",
"specified",
"Data",
"Lake",
"Store",
"virtual",
"network",
"rule",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/VirtualNetworkRulesInner.java#L355-L362 | train |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildsInner.java | BuildsInner.cancelAsync | public Observable<Void> cancelAsync(String resourceGroupName, String registryName, String buildId) {
return cancelWithServiceResponseAsync(resourceGroupName, registryName, buildId).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {... | java | public Observable<Void> cancelAsync(String resourceGroupName, String registryName, String buildId) {
return cancelWithServiceResponseAsync(resourceGroupName, registryName, buildId).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {... | [
"public",
"Observable",
"<",
"Void",
">",
"cancelAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"String",
"buildId",
")",
"{",
"return",
"cancelWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"registryName",
",",
"buildId",
... | Cancel an existing build.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param buildId The build ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the reques... | [
"Cancel",
"an",
"existing",
"build",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildsInner.java#L911-L918 | train |
Azure/azure-sdk-for-java | common/azure-common-mgmt/src/main/java/com/azure/common/mgmt/PagedList.java | PagedList.loadNextPage | public void loadNextPage() {
this.currentPage = cachedPage;
cachedPage = null;
this.items.addAll(currentPage.items());
cachePage(currentPage.nextPageLink());
} | java | public void loadNextPage() {
this.currentPage = cachedPage;
cachedPage = null;
this.items.addAll(currentPage.items());
cachePage(currentPage.nextPageLink());
} | [
"public",
"void",
"loadNextPage",
"(",
")",
"{",
"this",
".",
"currentPage",
"=",
"cachedPage",
";",
"cachedPage",
"=",
"null",
";",
"this",
".",
"items",
".",
"addAll",
"(",
"currentPage",
".",
"items",
"(",
")",
")",
";",
"cachePage",
"(",
"currentPage... | Loads a page from next page link.
The exceptions are wrapped into Java Runtime exceptions. | [
"Loads",
"a",
"page",
"from",
"next",
"page",
"link",
".",
"The",
"exceptions",
"are",
"wrapped",
"into",
"Java",
"Runtime",
"exceptions",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common-mgmt/src/main/java/com/azure/common/mgmt/PagedList.java#L97-L102 | train |
Azure/azure-sdk-for-java | common/azure-common-mgmt/src/main/java/com/azure/common/mgmt/PagedList.java | PagedList.setCurrentPage | protected void setCurrentPage(Page<E> currentPage) {
this.currentPage = currentPage;
List<E> retrievedItems = currentPage.items();
if (retrievedItems != null) {
items.addAll(retrievedItems);
}
cachePage(currentPage.nextPageLink());
} | java | protected void setCurrentPage(Page<E> currentPage) {
this.currentPage = currentPage;
List<E> retrievedItems = currentPage.items();
if (retrievedItems != null) {
items.addAll(retrievedItems);
}
cachePage(currentPage.nextPageLink());
} | [
"protected",
"void",
"setCurrentPage",
"(",
"Page",
"<",
"E",
">",
"currentPage",
")",
"{",
"this",
".",
"currentPage",
"=",
"currentPage",
";",
"List",
"<",
"E",
">",
"retrievedItems",
"=",
"currentPage",
".",
"items",
"(",
")",
";",
"if",
"(",
"retriev... | Sets the current page.
@param currentPage the current page. | [
"Sets",
"the",
"current",
"page",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common-mgmt/src/main/java/com/azure/common/mgmt/PagedList.java#L127-L134 | train |
Azure/azure-sdk-for-java | eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/customization/EventGridSubscriber.java | EventGridSubscriber.putCustomEventMapping | @Beta
public void putCustomEventMapping(final String eventType, final Type eventDataType) {
if (eventType == null || eventType.isEmpty()) {
throw new IllegalArgumentException("eventType parameter is required and cannot be null or empty");
}
if (eventDataType == null) {
... | java | @Beta
public void putCustomEventMapping(final String eventType, final Type eventDataType) {
if (eventType == null || eventType.isEmpty()) {
throw new IllegalArgumentException("eventType parameter is required and cannot be null or empty");
}
if (eventDataType == null) {
... | [
"@",
"Beta",
"public",
"void",
"putCustomEventMapping",
"(",
"final",
"String",
"eventType",
",",
"final",
"Type",
"eventDataType",
")",
"{",
"if",
"(",
"eventType",
"==",
"null",
"||",
"eventType",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"Ille... | Add a custom event mapping. If a mapping with same eventType exists then the old eventDataType is replaced by
the specified eventDataType.
@param eventType the event type name.
@param eventDataType type of the Java model that the event type name mapped to. | [
"Add",
"a",
"custom",
"event",
"mapping",
".",
"If",
"a",
"mapping",
"with",
"same",
"eventType",
"exists",
"then",
"the",
"old",
"eventDataType",
"is",
"replaced",
"by",
"the",
"specified",
"eventDataType",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/customization/EventGridSubscriber.java#L52-L61 | train |
Azure/azure-sdk-for-java | eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/customization/EventGridSubscriber.java | EventGridSubscriber.getCustomEventMapping | @Beta
public Type getCustomEventMapping(final String eventType) {
if (!containsCustomEventMappingFor(eventType)) {
return null;
} else {
return this.eventTypeToEventDataMapping.get(canonicalizeEventType(eventType));
}
} | java | @Beta
public Type getCustomEventMapping(final String eventType) {
if (!containsCustomEventMappingFor(eventType)) {
return null;
} else {
return this.eventTypeToEventDataMapping.get(canonicalizeEventType(eventType));
}
} | [
"@",
"Beta",
"public",
"Type",
"getCustomEventMapping",
"(",
"final",
"String",
"eventType",
")",
"{",
"if",
"(",
"!",
"containsCustomEventMappingFor",
"(",
"eventType",
")",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"return",
"this",
".",
"eventTyp... | Get type of the Java model that is mapped to the given eventType.
@param eventType the event type name.
@return type of the Java model if mapping exists, null otherwise. | [
"Get",
"type",
"of",
"the",
"Java",
"model",
"that",
"is",
"mapped",
"to",
"the",
"given",
"eventType",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/customization/EventGridSubscriber.java#L69-L76 | train |
Azure/azure-sdk-for-java | eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/customization/EventGridSubscriber.java | EventGridSubscriber.removeCustomEventMapping | @Beta
public boolean removeCustomEventMapping(final String eventType) {
if (!containsCustomEventMappingFor(eventType)) {
return false;
} else {
this.eventTypeToEventDataMapping.remove(canonicalizeEventType(eventType));
return true;
}
} | java | @Beta
public boolean removeCustomEventMapping(final String eventType) {
if (!containsCustomEventMappingFor(eventType)) {
return false;
} else {
this.eventTypeToEventDataMapping.remove(canonicalizeEventType(eventType));
return true;
}
} | [
"@",
"Beta",
"public",
"boolean",
"removeCustomEventMapping",
"(",
"final",
"String",
"eventType",
")",
"{",
"if",
"(",
"!",
"containsCustomEventMappingFor",
"(",
"eventType",
")",
")",
"{",
"return",
"false",
";",
"}",
"else",
"{",
"this",
".",
"eventTypeToEv... | Removes the mapping with the given eventType.
@param eventType the event type name.
@return true if the mapping exists and removed, false if mapping does not exists. | [
"Removes",
"the",
"mapping",
"with",
"the",
"given",
"eventType",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/customization/EventGridSubscriber.java#L92-L100 | train |
Azure/azure-sdk-for-java | eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/customization/EventGridSubscriber.java | EventGridSubscriber.containsCustomEventMappingFor | @Beta
public boolean containsCustomEventMappingFor(final String eventType) {
if (eventType == null || eventType.isEmpty()) {
return false;
} else {
return this.eventTypeToEventDataMapping.containsKey(canonicalizeEventType(eventType));
}
} | java | @Beta
public boolean containsCustomEventMappingFor(final String eventType) {
if (eventType == null || eventType.isEmpty()) {
return false;
} else {
return this.eventTypeToEventDataMapping.containsKey(canonicalizeEventType(eventType));
}
} | [
"@",
"Beta",
"public",
"boolean",
"containsCustomEventMappingFor",
"(",
"final",
"String",
"eventType",
")",
"{",
"if",
"(",
"eventType",
"==",
"null",
"||",
"eventType",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"else",
"{",
"return... | Checks if an event mapping with the given eventType exists.
@param eventType the event type name.
@return true if the mapping exists, false otherwise. | [
"Checks",
"if",
"an",
"event",
"mapping",
"with",
"the",
"given",
"eventType",
"exists",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/customization/EventGridSubscriber.java#L108-L115 | train |
Azure/azure-sdk-for-java | eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/customization/EventGridSubscriber.java | EventGridSubscriber.deserializeEventGridEvents | @Beta
public EventGridEvent[] deserializeEventGridEvents(final String requestContent, final SerializerAdapter<ObjectMapper> serializerAdapter) throws IOException {
EventGridEvent[] eventGridEvents = serializerAdapter.<EventGridEvent[]>deserialize(requestContent, EventGridEvent[].class);
for (EventGr... | java | @Beta
public EventGridEvent[] deserializeEventGridEvents(final String requestContent, final SerializerAdapter<ObjectMapper> serializerAdapter) throws IOException {
EventGridEvent[] eventGridEvents = serializerAdapter.<EventGridEvent[]>deserialize(requestContent, EventGridEvent[].class);
for (EventGr... | [
"@",
"Beta",
"public",
"EventGridEvent",
"[",
"]",
"deserializeEventGridEvents",
"(",
"final",
"String",
"requestContent",
",",
"final",
"SerializerAdapter",
"<",
"ObjectMapper",
">",
"serializerAdapter",
")",
"throws",
"IOException",
"{",
"EventGridEvent",
"[",
"]",
... | De-serialize the events in the given requested content using the provided de-serializer.
@param requestContent the request content as string.
@param serializerAdapter the de-serializer.
@return de-serialized events.
@throws IOException | [
"De",
"-",
"serialize",
"the",
"events",
"in",
"the",
"given",
"requested",
"content",
"using",
"the",
"provided",
"de",
"-",
"serializer",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/data-plane/src/main/java/com/microsoft/azure/eventgrid/customization/EventGridSubscriber.java#L138-L162 | train |
Azure/azure-sdk-for-java | applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentAvailableFeaturesInner.java | ComponentAvailableFeaturesInner.getAsync | public Observable<ApplicationInsightsComponentAvailableFeaturesInner> getAsync(String resourceGroupName, String resourceName) {
return getWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<ApplicationInsightsComponentAvailableFeaturesInner>, ApplicationInsightsComponentAvail... | java | public Observable<ApplicationInsightsComponentAvailableFeaturesInner> getAsync(String resourceGroupName, String resourceName) {
return getWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<ApplicationInsightsComponentAvailableFeaturesInner>, ApplicationInsightsComponentAvail... | [
"public",
"Observable",
"<",
"ApplicationInsightsComponentAvailableFeaturesInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
")",
".",... | Returns all available features of the application insights component.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights component resource.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the Application... | [
"Returns",
"all",
"available",
"features",
"of",
"the",
"application",
"insights",
"component",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentAvailableFeaturesInner.java#L95-L102 | train |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/RestorableDroppedDatabasesInner.java | RestorableDroppedDatabasesInner.listByServerAsync | public Observable<List<RestorableDroppedDatabaseInner>> listByServerAsync(String resourceGroupName, String serverName) {
return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<List<RestorableDroppedDatabaseInner>>, List<RestorableDroppedDatabaseInner>>() {
... | java | public Observable<List<RestorableDroppedDatabaseInner>> listByServerAsync(String resourceGroupName, String serverName) {
return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<List<RestorableDroppedDatabaseInner>>, List<RestorableDroppedDatabaseInner>>() {
... | [
"public",
"Observable",
"<",
"List",
"<",
"RestorableDroppedDatabaseInner",
">",
">",
"listByServerAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
")",
"{",
"return",
"listByServerWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverNa... | Gets a list of deleted databases that can be restored.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@throws IllegalArgumentException thrown if parameters fail th... | [
"Gets",
"a",
"list",
"of",
"deleted",
"databases",
"that",
"can",
"be",
"restored",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/RestorableDroppedDatabasesInner.java#L193-L200 | train |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/ComputerVisionManager.java | ComputerVisionManager.authenticate | public static ComputerVisionClient authenticate(ServiceClientCredentials credentials, String endpoint) {
return authenticate("https://{endpoint}/vision/v2.0/", credentials)
.withEndpoint(endpoint);
} | java | public static ComputerVisionClient authenticate(ServiceClientCredentials credentials, String endpoint) {
return authenticate("https://{endpoint}/vision/v2.0/", credentials)
.withEndpoint(endpoint);
} | [
"public",
"static",
"ComputerVisionClient",
"authenticate",
"(",
"ServiceClientCredentials",
"credentials",
",",
"String",
"endpoint",
")",
"{",
"return",
"authenticate",
"(",
"\"https://{endpoint}/vision/v2.0/\"",
",",
"credentials",
")",
".",
"withEndpoint",
"(",
"endpo... | Initializes an instance of Computer Vision API client.
@param credentials the management credentials for Azure
@param endpoint Supported Cognitive Services endpoints.
@return the Computer Vision API client | [
"Initializes",
"an",
"instance",
"of",
"Computer",
"Vision",
"API",
"client",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/ComputerVisionManager.java#L69-L72 | train |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ExamplesImpl.java | ExamplesImpl.deleteAsync | public Observable<OperationStatus> deleteAsync(UUID appId, String versionId, int exampleId) {
return deleteWithServiceResponseAsync(appId, versionId, exampleId).map(new Func1<ServiceResponse<OperationStatus>, OperationStatus>() {
@Override
public OperationStatus call(ServiceResponse<Oper... | java | public Observable<OperationStatus> deleteAsync(UUID appId, String versionId, int exampleId) {
return deleteWithServiceResponseAsync(appId, versionId, exampleId).map(new Func1<ServiceResponse<OperationStatus>, OperationStatus>() {
@Override
public OperationStatus call(ServiceResponse<Oper... | [
"public",
"Observable",
"<",
"OperationStatus",
">",
"deleteAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"int",
"exampleId",
")",
"{",
"return",
"deleteWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"exampleId",
")",
".",
"map"... | Deletes the labeled example with the specified ID.
@param appId The application ID.
@param versionId The version ID.
@param exampleId The example ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the OperationStatus object | [
"Deletes",
"the",
"labeled",
"example",
"with",
"the",
"specified",
"ID",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ExamplesImpl.java#L487-L494 | train |
Azure/azure-sdk-for-java | common/azure-common/src/main/java/com/azure/common/implementation/util/Base64Util.java | Base64Util.encodeURLWithoutPadding | public static byte[] encodeURLWithoutPadding(byte[] src) {
return src == null ? null : Base64.getUrlEncoder().withoutPadding().encode(src);
} | java | public static byte[] encodeURLWithoutPadding(byte[] src) {
return src == null ? null : Base64.getUrlEncoder().withoutPadding().encode(src);
} | [
"public",
"static",
"byte",
"[",
"]",
"encodeURLWithoutPadding",
"(",
"byte",
"[",
"]",
"src",
")",
"{",
"return",
"src",
"==",
"null",
"?",
"null",
":",
"Base64",
".",
"getUrlEncoder",
"(",
")",
".",
"withoutPadding",
"(",
")",
".",
"encode",
"(",
"sr... | Encodes a byte array to base64 URL format.
@param src the byte array to encode
@return the base64 URL encoded bytes | [
"Encodes",
"a",
"byte",
"array",
"to",
"base64",
"URL",
"format",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/implementation/util/Base64Util.java#L26-L28 | train |
Azure/azure-sdk-for-java | common/azure-common/src/main/java/com/azure/common/implementation/util/Base64Util.java | Base64Util.encodeToString | public static String encodeToString(byte[] src) {
return src == null ? null : Base64.getEncoder().encodeToString(src);
} | java | public static String encodeToString(byte[] src) {
return src == null ? null : Base64.getEncoder().encodeToString(src);
} | [
"public",
"static",
"String",
"encodeToString",
"(",
"byte",
"[",
"]",
"src",
")",
"{",
"return",
"src",
"==",
"null",
"?",
"null",
":",
"Base64",
".",
"getEncoder",
"(",
")",
".",
"encodeToString",
"(",
"src",
")",
";",
"}"
] | Encodes a byte array to a base 64 string.
@param src the byte array to encode
@return the base64 encoded string | [
"Encodes",
"a",
"byte",
"array",
"to",
"a",
"base",
"64",
"string",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/implementation/util/Base64Util.java#L35-L37 | train |
Azure/azure-sdk-for-java | common/azure-common/src/main/java/com/azure/common/implementation/util/Base64Util.java | Base64Util.decodeString | public static byte[] decodeString(String encoded) {
return encoded == null ? null : Base64.getDecoder().decode(encoded);
} | java | public static byte[] decodeString(String encoded) {
return encoded == null ? null : Base64.getDecoder().decode(encoded);
} | [
"public",
"static",
"byte",
"[",
"]",
"decodeString",
"(",
"String",
"encoded",
")",
"{",
"return",
"encoded",
"==",
"null",
"?",
"null",
":",
"Base64",
".",
"getDecoder",
"(",
")",
".",
"decode",
"(",
"encoded",
")",
";",
"}"
] | Decodes a base64 encoded string.
@param encoded the string to decode
@return the decoded byte array | [
"Decodes",
"a",
"base64",
"encoded",
"string",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/implementation/util/Base64Util.java#L62-L64 | train |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabaseThreatDetectionPoliciesInner.java | DatabaseThreatDetectionPoliciesInner.getAsync | public Observable<DatabaseSecurityAlertPolicyInner> getAsync(String resourceGroupName, String serverName, String databaseName) {
return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<DatabaseSecurityAlertPolicyInner>, DatabaseSecurityAlertPolicyInner>() {
... | java | public Observable<DatabaseSecurityAlertPolicyInner> getAsync(String resourceGroupName, String serverName, String databaseName) {
return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<DatabaseSecurityAlertPolicyInner>, DatabaseSecurityAlertPolicyInner>() {
... | [
"public",
"Observable",
"<",
"DatabaseSecurityAlertPolicyInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName"... | Gets a database's threat detection policy.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database for which database Threat De... | [
"Gets",
"a",
"database",
"s",
"threat",
"detection",
"policy",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabaseThreatDetectionPoliciesInner.java#L105-L112 | train |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabaseThreatDetectionPoliciesInner.java | DatabaseThreatDetectionPoliciesInner.createOrUpdateAsync | public Observable<DatabaseSecurityAlertPolicyInner> createOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseSecurityAlertPolicyInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1<ServiceRes... | java | public Observable<DatabaseSecurityAlertPolicyInner> createOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseSecurityAlertPolicyInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1<ServiceRes... | [
"public",
"Observable",
"<",
"DatabaseSecurityAlertPolicyInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"DatabaseSecurityAlertPolicyInner",
"parameters",
")",
"{",
"return",
"createOrU... | Creates or updates a database's threat detection policy.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database for which data... | [
"Creates",
"or",
"updates",
"a",
"database",
"s",
"threat",
"detection",
"policy",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabaseThreatDetectionPoliciesInner.java#L202-L209 | train |
Azure/azure-sdk-for-java | common/azure-common/src/main/java/com/azure/common/implementation/util/TypeUtil.java | TypeUtil.getAllClasses | public static List<Class<?>> getAllClasses(Class<?> clazz) {
List<Class<?>> types = new ArrayList<>();
while (clazz != null) {
types.add(clazz);
clazz = clazz.getSuperclass();
}
return types;
} | java | public static List<Class<?>> getAllClasses(Class<?> clazz) {
List<Class<?>> types = new ArrayList<>();
while (clazz != null) {
types.add(clazz);
clazz = clazz.getSuperclass();
}
return types;
} | [
"public",
"static",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"getAllClasses",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"types",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"while",
"(",
"clazz",... | Find all super classes including provided class.
@param clazz the raw class to find super types for
@return the list of super classes | [
"Find",
"all",
"super",
"classes",
"including",
"provided",
"class",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/implementation/util/TypeUtil.java#L22-L29 | train |
Azure/azure-sdk-for-java | common/azure-common/src/main/java/com/azure/common/implementation/util/TypeUtil.java | TypeUtil.getTypeArguments | public static Type[] getTypeArguments(Type type) {
if (!(type instanceof ParameterizedType)) {
return new Type[0];
}
return ((ParameterizedType) type).getActualTypeArguments();
} | java | public static Type[] getTypeArguments(Type type) {
if (!(type instanceof ParameterizedType)) {
return new Type[0];
}
return ((ParameterizedType) type).getActualTypeArguments();
} | [
"public",
"static",
"Type",
"[",
"]",
"getTypeArguments",
"(",
"Type",
"type",
")",
"{",
"if",
"(",
"!",
"(",
"type",
"instanceof",
"ParameterizedType",
")",
")",
"{",
"return",
"new",
"Type",
"[",
"0",
"]",
";",
"}",
"return",
"(",
"(",
"Parameterized... | Get the generic arguments for a type.
@param type the type to get arguments
@return the generic arguments, empty if type is not parameterized | [
"Get",
"the",
"generic",
"arguments",
"for",
"a",
"type",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/implementation/util/TypeUtil.java#L37-L42 | train |
Azure/azure-sdk-for-java | common/azure-common/src/main/java/com/azure/common/implementation/util/TypeUtil.java | TypeUtil.getTypeArgument | public static Type getTypeArgument(Type type) {
if (!(type instanceof ParameterizedType)) {
return null;
}
return ((ParameterizedType) type).getActualTypeArguments()[0];
} | java | public static Type getTypeArgument(Type type) {
if (!(type instanceof ParameterizedType)) {
return null;
}
return ((ParameterizedType) type).getActualTypeArguments()[0];
} | [
"public",
"static",
"Type",
"getTypeArgument",
"(",
"Type",
"type",
")",
"{",
"if",
"(",
"!",
"(",
"type",
"instanceof",
"ParameterizedType",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"(",
"(",
"ParameterizedType",
")",
"type",
")",
".",
"getA... | Get the generic argument, or the first if the type has more than one.
@param type the type to get arguments
@return the generic argument, null if type is not parameterized | [
"Get",
"the",
"generic",
"argument",
"or",
"the",
"first",
"if",
"the",
"type",
"has",
"more",
"than",
"one",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/implementation/util/TypeUtil.java#L50-L55 | train |
Azure/azure-sdk-for-java | common/azure-common/src/main/java/com/azure/common/implementation/util/TypeUtil.java | TypeUtil.getSuperType | public static Type getSuperType(Type type) {
if (type instanceof ParameterizedType) {
ParameterizedType parameterizedType = (ParameterizedType) type;
Type genericSuperClass = ((Class<?>) parameterizedType.getRawType()).getGenericSuperclass();
if (genericSuperClass instanceof ... | java | public static Type getSuperType(Type type) {
if (type instanceof ParameterizedType) {
ParameterizedType parameterizedType = (ParameterizedType) type;
Type genericSuperClass = ((Class<?>) parameterizedType.getRawType()).getGenericSuperclass();
if (genericSuperClass instanceof ... | [
"public",
"static",
"Type",
"getSuperType",
"(",
"Type",
"type",
")",
"{",
"if",
"(",
"type",
"instanceof",
"ParameterizedType",
")",
"{",
"ParameterizedType",
"parameterizedType",
"=",
"(",
"ParameterizedType",
")",
"type",
";",
"Type",
"genericSuperClass",
"=",
... | Get the super type for a given type.
@param type the input type
@return the direct super type | [
"Get",
"the",
"super",
"type",
"for",
"a",
"given",
"type",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/implementation/util/TypeUtil.java#L77-L116 | train |
Azure/azure-sdk-for-java | common/azure-common/src/main/java/com/azure/common/implementation/util/TypeUtil.java | TypeUtil.getSuperType | public static Type getSuperType(Type subType, Class<?> rawSuperType) {
while (subType != null && getRawClass(subType) != rawSuperType) {
subType = getSuperType(subType);
}
return subType;
} | java | public static Type getSuperType(Type subType, Class<?> rawSuperType) {
while (subType != null && getRawClass(subType) != rawSuperType) {
subType = getSuperType(subType);
}
return subType;
} | [
"public",
"static",
"Type",
"getSuperType",
"(",
"Type",
"subType",
",",
"Class",
"<",
"?",
">",
"rawSuperType",
")",
"{",
"while",
"(",
"subType",
"!=",
"null",
"&&",
"getRawClass",
"(",
"subType",
")",
"!=",
"rawSuperType",
")",
"{",
"subType",
"=",
"g... | Get the super type for a type in its super type chain, which has
a raw class that matches the specified class.
@param subType the sub type to find super type for
@param rawSuperType the raw class for the super type
@return the super type that matches the requirement | [
"Get",
"the",
"super",
"type",
"for",
"a",
"type",
"in",
"its",
"super",
"type",
"chain",
"which",
"has",
"a",
"raw",
"class",
"that",
"matches",
"the",
"specified",
"class",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/implementation/util/TypeUtil.java#L126-L131 | train |
Azure/azure-sdk-for-java | common/azure-common/src/main/java/com/azure/common/implementation/util/TypeUtil.java | TypeUtil.isTypeOrSubTypeOf | public static boolean isTypeOrSubTypeOf(Type subType, Type superType) {
Class<?> sub = getRawClass(subType);
Class<?> sup = getRawClass(superType);
return sup.isAssignableFrom(sub);
} | java | public static boolean isTypeOrSubTypeOf(Type subType, Type superType) {
Class<?> sub = getRawClass(subType);
Class<?> sup = getRawClass(superType);
return sup.isAssignableFrom(sub);
} | [
"public",
"static",
"boolean",
"isTypeOrSubTypeOf",
"(",
"Type",
"subType",
",",
"Type",
"superType",
")",
"{",
"Class",
"<",
"?",
">",
"sub",
"=",
"getRawClass",
"(",
"subType",
")",
";",
"Class",
"<",
"?",
">",
"sup",
"=",
"getRawClass",
"(",
"superTyp... | Determines if a type is the same or a subtype for another type.
@param subType the supposed sub type
@param superType the supposed super type
@return true if the first type is the same or a subtype for the second type | [
"Determines",
"if",
"a",
"type",
"is",
"the",
"same",
"or",
"a",
"subtype",
"for",
"another",
"type",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/implementation/util/TypeUtil.java#L140-L145 | train |
Azure/azure-sdk-for-java | common/azure-common/src/main/java/com/azure/common/implementation/util/TypeUtil.java | TypeUtil.createParameterizedType | public static ParameterizedType createParameterizedType(Class<?> rawClass, Type... genericTypes) {
return new ParameterizedType() {
@Override
public Type[] getActualTypeArguments() {
return genericTypes;
}
@Override
public Type getRawT... | java | public static ParameterizedType createParameterizedType(Class<?> rawClass, Type... genericTypes) {
return new ParameterizedType() {
@Override
public Type[] getActualTypeArguments() {
return genericTypes;
}
@Override
public Type getRawT... | [
"public",
"static",
"ParameterizedType",
"createParameterizedType",
"(",
"Class",
"<",
"?",
">",
"rawClass",
",",
"Type",
"...",
"genericTypes",
")",
"{",
"return",
"new",
"ParameterizedType",
"(",
")",
"{",
"@",
"Override",
"public",
"Type",
"[",
"]",
"getAct... | Create a parameterized type from a raw class and its type arguments.
@param rawClass the raw class to construct the parameterized type
@param genericTypes the generic arguments
@return the parameterized type | [
"Create",
"a",
"parameterized",
"type",
"from",
"a",
"raw",
"class",
"and",
"its",
"type",
"arguments",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/implementation/util/TypeUtil.java#L154-L171 | train |
Azure/azure-sdk-for-java | common/azure-common/src/main/java/com/azure/common/implementation/util/TypeUtil.java | TypeUtil.getRestResponseBodyType | public static Type getRestResponseBodyType(Type restResponseReturnType) {
// if this type has type arguments, then we look at the last one to determine if it expects a body
final Type[] restResponseTypeArguments = TypeUtil.getTypeArguments(restResponseReturnType);
if (restResponseTypeArguments !... | java | public static Type getRestResponseBodyType(Type restResponseReturnType) {
// if this type has type arguments, then we look at the last one to determine if it expects a body
final Type[] restResponseTypeArguments = TypeUtil.getTypeArguments(restResponseReturnType);
if (restResponseTypeArguments !... | [
"public",
"static",
"Type",
"getRestResponseBodyType",
"(",
"Type",
"restResponseReturnType",
")",
"{",
"// if this type has type arguments, then we look at the last one to determine if it expects a body",
"final",
"Type",
"[",
"]",
"restResponseTypeArguments",
"=",
"TypeUtil",
"."... | Returns the body type expected in the rest response.
@param restResponseReturnType The RestResponse subtype containing the type arguments we are inspecting.
@return The type of the body. | [
"Returns",
"the",
"body",
"type",
"expected",
"in",
"the",
"rest",
"response",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/implementation/util/TypeUtil.java#L190-L199 | train |
wstrange/GoogleAuth | src/main/java/com/warrenstrange/googleauth/GoogleAuthenticator.java | GoogleAuthenticator.calculateCode | int calculateCode(byte[] key, long tm)
{
// Allocating an array of bytes to represent the specified instant
// of time.
byte[] data = new byte[8];
long value = tm;
// Converting the instant of time from the long representation to a
// big-endian array of bytes (RFC42... | java | int calculateCode(byte[] key, long tm)
{
// Allocating an array of bytes to represent the specified instant
// of time.
byte[] data = new byte[8];
long value = tm;
// Converting the instant of time from the long representation to a
// big-endian array of bytes (RFC42... | [
"int",
"calculateCode",
"(",
"byte",
"[",
"]",
"key",
",",
"long",
"tm",
")",
"{",
"// Allocating an array of bytes to represent the specified instant",
"// of time.",
"byte",
"[",
"]",
"data",
"=",
"new",
"byte",
"[",
"8",
"]",
";",
"long",
"value",
"=",
"tm"... | Calculates the verification code of the provided key at the specified
instant of time using the algorithm specified in RFC 6238.
@param key the secret key in binary format.
@param tm the instant of time.
@return the validation code for the provided key at the specified instant
of time. | [
"Calculates",
"the",
"verification",
"code",
"of",
"the",
"provided",
"key",
"at",
"the",
"specified",
"instant",
"of",
"time",
"using",
"the",
"algorithm",
"specified",
"in",
"RFC",
"6238",
"."
] | 03f37333f8b3e411e10e63a7c85c4d2155929321 | https://github.com/wstrange/GoogleAuth/blob/03f37333f8b3e411e10e63a7c85c4d2155929321/src/main/java/com/warrenstrange/googleauth/GoogleAuthenticator.java#L209-L270 | train |
wstrange/GoogleAuth | src/main/java/com/warrenstrange/googleauth/GoogleAuthenticator.java | GoogleAuthenticator.checkCode | private boolean checkCode(
String secret,
long code,
long timestamp,
int window)
{
byte[] decodedKey = decodeSecret(secret);
// convert unix time into a 30 second "window" as specified by the
// TOTP specification. Using Google's default inter... | java | private boolean checkCode(
String secret,
long code,
long timestamp,
int window)
{
byte[] decodedKey = decodeSecret(secret);
// convert unix time into a 30 second "window" as specified by the
// TOTP specification. Using Google's default inter... | [
"private",
"boolean",
"checkCode",
"(",
"String",
"secret",
",",
"long",
"code",
",",
"long",
"timestamp",
",",
"int",
"window",
")",
"{",
"byte",
"[",
"]",
"decodedKey",
"=",
"decodeSecret",
"(",
"secret",
")",
";",
"// convert unix time into a 30 second \"wind... | This method implements the algorithm specified in RFC 6238 to check if a
validation code is valid in a given instant of time for the given secret
key.
@param secret the Base32 encoded secret key.
@param code the code to validate.
@param timestamp the instant of time to use during the validation process.
@param... | [
"This",
"method",
"implements",
"the",
"algorithm",
"specified",
"in",
"RFC",
"6238",
"to",
"check",
"if",
"a",
"validation",
"code",
"is",
"valid",
"in",
"a",
"given",
"instant",
"of",
"time",
"for",
"the",
"given",
"secret",
"key",
"."
] | 03f37333f8b3e411e10e63a7c85c4d2155929321 | https://github.com/wstrange/GoogleAuth/blob/03f37333f8b3e411e10e63a7c85c4d2155929321/src/main/java/com/warrenstrange/googleauth/GoogleAuthenticator.java#L289-L319 | train |
wstrange/GoogleAuth | src/main/java/com/warrenstrange/googleauth/GoogleAuthenticator.java | GoogleAuthenticator.generateScratchCode | private int generateScratchCode()
{
while (true)
{
byte[] scratchCodeBuffer = new byte[BYTES_PER_SCRATCH_CODE];
secureRandom.nextBytes(scratchCodeBuffer);
int scratchCode = calculateScratchCode(scratchCodeBuffer);
if (scratchCode != SCRATCH_CODE_INVA... | java | private int generateScratchCode()
{
while (true)
{
byte[] scratchCodeBuffer = new byte[BYTES_PER_SCRATCH_CODE];
secureRandom.nextBytes(scratchCodeBuffer);
int scratchCode = calculateScratchCode(scratchCodeBuffer);
if (scratchCode != SCRATCH_CODE_INVA... | [
"private",
"int",
"generateScratchCode",
"(",
")",
"{",
"while",
"(",
"true",
")",
"{",
"byte",
"[",
"]",
"scratchCodeBuffer",
"=",
"new",
"byte",
"[",
"BYTES_PER_SCRATCH_CODE",
"]",
";",
"secureRandom",
".",
"nextBytes",
"(",
"scratchCodeBuffer",
")",
";",
... | This method creates a new random byte buffer from which a new scratch
code is generated. This function is invoked if a scratch code generated
from the main buffer is invalid because it does not satisfy the scratch
code restrictions.
@return A valid scratch code. | [
"This",
"method",
"creates",
"a",
"new",
"random",
"byte",
"buffer",
"from",
"which",
"a",
"new",
"scratch",
"code",
"is",
"generated",
".",
"This",
"function",
"is",
"invoked",
"if",
"a",
"scratch",
"code",
"generated",
"from",
"the",
"main",
"buffer",
"i... | 03f37333f8b3e411e10e63a7c85c4d2155929321 | https://github.com/wstrange/GoogleAuth/blob/03f37333f8b3e411e10e63a7c85c4d2155929321/src/main/java/com/warrenstrange/googleauth/GoogleAuthenticator.java#L452-L466 | train |
wstrange/GoogleAuth | src/main/java/com/warrenstrange/googleauth/GoogleAuthenticator.java | GoogleAuthenticator.calculateSecretKey | private String calculateSecretKey(byte[] secretKey)
{
switch (config.getKeyRepresentation())
{
case BASE32:
return new Base32().encodeToString(secretKey);
case BASE64:
return new Base64().encodeToString(secretKey);
default:
... | java | private String calculateSecretKey(byte[] secretKey)
{
switch (config.getKeyRepresentation())
{
case BASE32:
return new Base32().encodeToString(secretKey);
case BASE64:
return new Base64().encodeToString(secretKey);
default:
... | [
"private",
"String",
"calculateSecretKey",
"(",
"byte",
"[",
"]",
"secretKey",
")",
"{",
"switch",
"(",
"config",
".",
"getKeyRepresentation",
"(",
")",
")",
"{",
"case",
"BASE32",
":",
"return",
"new",
"Base32",
"(",
")",
".",
"encodeToString",
"(",
"secr... | This method calculates the secret key given a random byte buffer.
@param secretKey a random byte buffer.
@return the secret key. | [
"This",
"method",
"calculates",
"the",
"secret",
"key",
"given",
"a",
"random",
"byte",
"buffer",
"."
] | 03f37333f8b3e411e10e63a7c85c4d2155929321 | https://github.com/wstrange/GoogleAuth/blob/03f37333f8b3e411e10e63a7c85c4d2155929321/src/main/java/com/warrenstrange/googleauth/GoogleAuthenticator.java#L510-L521 | train |
wstrange/GoogleAuth | src/main/java/com/warrenstrange/googleauth/GoogleAuthenticator.java | GoogleAuthenticator.getValidCredentialRepository | private ICredentialRepository getValidCredentialRepository()
{
ICredentialRepository repository = getCredentialRepository();
if (repository == null)
{
throw new UnsupportedOperationException(
String.format("An instance of the %s service must be " +
... | java | private ICredentialRepository getValidCredentialRepository()
{
ICredentialRepository repository = getCredentialRepository();
if (repository == null)
{
throw new UnsupportedOperationException(
String.format("An instance of the %s service must be " +
... | [
"private",
"ICredentialRepository",
"getValidCredentialRepository",
"(",
")",
"{",
"ICredentialRepository",
"repository",
"=",
"getCredentialRepository",
"(",
")",
";",
"if",
"(",
"repository",
"==",
"null",
")",
"{",
"throw",
"new",
"UnsupportedOperationException",
"("... | This method loads the first available and valid ICredentialRepository
registered using the Java service loader API.
@return the first registered ICredentialRepository.
@throws java.lang.UnsupportedOperationException if no valid service is
found. | [
"This",
"method",
"loads",
"the",
"first",
"available",
"and",
"valid",
"ICredentialRepository",
"registered",
"using",
"the",
"Java",
"service",
"loader",
"API",
"."
] | 03f37333f8b3e411e10e63a7c85c4d2155929321 | https://github.com/wstrange/GoogleAuth/blob/03f37333f8b3e411e10e63a7c85c4d2155929321/src/main/java/com/warrenstrange/googleauth/GoogleAuthenticator.java#L577-L592 | train |
wstrange/GoogleAuth | src/main/java/com/warrenstrange/googleauth/GoogleAuthenticator.java | GoogleAuthenticator.getCredentialRepository | public ICredentialRepository getCredentialRepository()
{
if (this.credentialRepositorySearched) return this.credentialRepository;
this.credentialRepositorySearched = true;
ServiceLoader<ICredentialRepository> loader =
ServiceLoader.load(ICredentialRepository.class);
... | java | public ICredentialRepository getCredentialRepository()
{
if (this.credentialRepositorySearched) return this.credentialRepository;
this.credentialRepositorySearched = true;
ServiceLoader<ICredentialRepository> loader =
ServiceLoader.load(ICredentialRepository.class);
... | [
"public",
"ICredentialRepository",
"getCredentialRepository",
"(",
")",
"{",
"if",
"(",
"this",
".",
"credentialRepositorySearched",
")",
"return",
"this",
".",
"credentialRepository",
";",
"this",
".",
"credentialRepositorySearched",
"=",
"true",
";",
"ServiceLoader",
... | This method loads the first available ICredentialRepository
registered using the Java service loader API.
@return the first registered ICredentialRepository or <code>null</code>
if none is found. | [
"This",
"method",
"loads",
"the",
"first",
"available",
"ICredentialRepository",
"registered",
"using",
"the",
"Java",
"service",
"loader",
"API",
"."
] | 03f37333f8b3e411e10e63a7c85c4d2155929321 | https://github.com/wstrange/GoogleAuth/blob/03f37333f8b3e411e10e63a7c85c4d2155929321/src/main/java/com/warrenstrange/googleauth/GoogleAuthenticator.java#L601-L618 | train |
bbossgroups/bboss-elasticsearch | bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/BuildTool.java | BuildTool.buildMeta | public static void buildMeta(Writer writer ,String indexType,String indexName, Object params,String action,ClientOptions clientOption,boolean upper7) throws IOException {
if(params instanceof Map){
buildMapMeta( writer , indexType, indexName, (Map) params, action, clientOption, upper7);
return;
}
Obje... | java | public static void buildMeta(Writer writer ,String indexType,String indexName, Object params,String action,ClientOptions clientOption,boolean upper7) throws IOException {
if(params instanceof Map){
buildMapMeta( writer , indexType, indexName, (Map) params, action, clientOption, upper7);
return;
}
Obje... | [
"public",
"static",
"void",
"buildMeta",
"(",
"Writer",
"writer",
",",
"String",
"indexType",
",",
"String",
"indexName",
",",
"Object",
"params",
",",
"String",
"action",
",",
"ClientOptions",
"clientOption",
",",
"boolean",
"upper7",
")",
"throws",
"IOExceptio... | String docIdKey,String parentIdKey,String routingKey
@param writer
@param indexType
@param indexName
@param params
@param action
@throws IOException | [
"String",
"docIdKey",
"String",
"parentIdKey",
"String",
"routingKey"
] | 31717c8aa2c4c880987be53aeeb8a0cf5183c3a7 | https://github.com/bbossgroups/bboss-elasticsearch/blob/31717c8aa2c4c880987be53aeeb8a0cf5183c3a7/bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/BuildTool.java#L347-L369 | train |
bbossgroups/bboss-elasticsearch | bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/template/ESTemplate.java | ESTemplate.process | public boolean process()
throws ResourceNotFoundException, ParseErrorException
{
if(processed)
return true;
synchronized(this)
{
if(processed)
return true;
data = null;
errorCondition = null;
Reader is = null;
/*
... | java | public boolean process()
throws ResourceNotFoundException, ParseErrorException
{
if(processed)
return true;
synchronized(this)
{
if(processed)
return true;
data = null;
errorCondition = null;
Reader is = null;
/*
... | [
"public",
"boolean",
"process",
"(",
")",
"throws",
"ResourceNotFoundException",
",",
"ParseErrorException",
"{",
"if",
"(",
"processed",
")",
"return",
"true",
";",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"processed",
")",
"return",
"true",
";",
"... | gets the named resource as a stream, parses and inits
@return true if successful
@throws ResourceNotFoundException if template not found
from any available source.
@throws ParseErrorException if template cannot be parsed due
to syntax (or other) error.
@throws IOException problem reading input stream | [
"gets",
"the",
"named",
"resource",
"as",
"a",
"stream",
"parses",
"and",
"inits"
] | 31717c8aa2c4c880987be53aeeb8a0cf5183c3a7 | https://github.com/bbossgroups/bboss-elasticsearch/blob/31717c8aa2c4c880987be53aeeb8a0cf5183c3a7/bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/template/ESTemplate.java#L116-L231 | train |
bbossgroups/bboss-elasticsearch | bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/ConfigRestClientUtil.java | ConfigRestClientUtil.addDateDocumentsNew | public String addDateDocumentsNew(String indexName, String addTemplate, List<?> beans, String refreshOption) throws ElasticSearchException{
return addDateDocuments( indexName, _doc, addTemplate, beans, refreshOption);
} | java | public String addDateDocumentsNew(String indexName, String addTemplate, List<?> beans, String refreshOption) throws ElasticSearchException{
return addDateDocuments( indexName, _doc, addTemplate, beans, refreshOption);
} | [
"public",
"String",
"addDateDocumentsNew",
"(",
"String",
"indexName",
",",
"String",
"addTemplate",
",",
"List",
"<",
"?",
">",
"beans",
",",
"String",
"refreshOption",
")",
"throws",
"ElasticSearchException",
"{",
"return",
"addDateDocuments",
"(",
"indexName",
... | For Elasticsearch 7 and 7+
@param indexName
@param addTemplate
@param beans
@param refreshOption
refresh=wait_for
refresh=false
refresh=true
refresh
Empty string or true
Refresh the relevant primary and replica shards (not the whole index) immediately after the operation occurs, so that the updated document appears in... | [
"For",
"Elasticsearch",
"7",
"and",
"7",
"+"
] | 31717c8aa2c4c880987be53aeeb8a0cf5183c3a7 | https://github.com/bbossgroups/bboss-elasticsearch/blob/31717c8aa2c4c880987be53aeeb8a0cf5183c3a7/bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/ConfigRestClientUtil.java#L1452-L1454 | train |
bbossgroups/bboss-elasticsearch | bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/BucketPath.java | BucketPath.getEscapeMapping | @Deprecated
public static Map<String, String> getEscapeMapping(String in,
Map<String, String> headers) {
return getEscapeMapping(in, headers, false, 0, 0);
} | java | @Deprecated
public static Map<String, String> getEscapeMapping(String in,
Map<String, String> headers) {
return getEscapeMapping(in, headers, false, 0, 0);
} | [
"@",
"Deprecated",
"public",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"getEscapeMapping",
"(",
"String",
"in",
",",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
")",
"{",
"return",
"getEscapeMapping",
"(",
"in",
",",
"headers",
",",
"f... | Instead of replacing escape sequences in a string, this method returns a
mapping of an attribute name to the value based on the escape sequence
found in the argument string. | [
"Instead",
"of",
"replacing",
"escape",
"sequences",
"in",
"a",
"string",
"this",
"method",
"returns",
"a",
"mapping",
"of",
"an",
"attribute",
"name",
"to",
"the",
"value",
"based",
"on",
"the",
"escape",
"sequence",
"found",
"in",
"the",
"argument",
"strin... | 31717c8aa2c4c880987be53aeeb8a0cf5183c3a7 | https://github.com/bbossgroups/bboss-elasticsearch/blob/31717c8aa2c4c880987be53aeeb8a0cf5183c3a7/bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/BucketPath.java#L487-L491 | train |
bbossgroups/bboss-elasticsearch | bboss-elasticsearch/src/main/java/org/frameworkset/elasticsearch/client/ElasticSearchTransportClient.java | ElasticSearchTransportClient.openClient | private void openClient(String clusterName) {
logger.info("Using ElasticSearch hostnames: {} ", Arrays.toString(serverAddresses));
Settings settings = null;
Settings.Builder builder = Settings.builder();
if (this.elasticUser != null && !this.elasticUser.equals("")) {
builder.put("cluster.name", clusterName)
... | java | private void openClient(String clusterName) {
logger.info("Using ElasticSearch hostnames: {} ", Arrays.toString(serverAddresses));
Settings settings = null;
Settings.Builder builder = Settings.builder();
if (this.elasticUser != null && !this.elasticUser.equals("")) {
builder.put("cluster.name", clusterName)
... | [
"private",
"void",
"openClient",
"(",
"String",
"clusterName",
")",
"{",
"logger",
".",
"info",
"(",
"\"Using ElasticSearch hostnames: {} \"",
",",
"Arrays",
".",
"toString",
"(",
"serverAddresses",
")",
")",
";",
"Settings",
"settings",
"=",
"null",
";",
"Setti... | Open client to elaticsearch cluster
@param clusterName | [
"Open",
"client",
"to",
"elaticsearch",
"cluster"
] | 31717c8aa2c4c880987be53aeeb8a0cf5183c3a7 | https://github.com/bbossgroups/bboss-elasticsearch/blob/31717c8aa2c4c880987be53aeeb8a0cf5183c3a7/bboss-elasticsearch/src/main/java/org/frameworkset/elasticsearch/client/ElasticSearchTransportClient.java#L226-L269 | train |
bbossgroups/bboss-elasticsearch | bboss-elasticsearch-spring-boot-starter/src/main/java/org/frameworkset/elasticsearch/boot/BBossESStarter.java | BBossESStarter.getRestClient | public ClientInterface getRestClient(){
if(restClient == null) {
synchronized (this) {
if(restClient == null) {
restClient = ElasticSearchHelper.getRestClientUtil();
}
}
}
return restClient;
} | java | public ClientInterface getRestClient(){
if(restClient == null) {
synchronized (this) {
if(restClient == null) {
restClient = ElasticSearchHelper.getRestClientUtil();
}
}
}
return restClient;
} | [
"public",
"ClientInterface",
"getRestClient",
"(",
")",
"{",
"if",
"(",
"restClient",
"==",
"null",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"restClient",
"==",
"null",
")",
"{",
"restClient",
"=",
"ElasticSearchHelper",
".",
"getRestClien... | Get default elasticsearch server ClientInterface
@return | [
"Get",
"default",
"elasticsearch",
"server",
"ClientInterface"
] | 31717c8aa2c4c880987be53aeeb8a0cf5183c3a7 | https://github.com/bbossgroups/bboss-elasticsearch/blob/31717c8aa2c4c880987be53aeeb8a0cf5183c3a7/bboss-elasticsearch-spring-boot-starter/src/main/java/org/frameworkset/elasticsearch/boot/BBossESStarter.java#L60-L69 | train |
bbossgroups/bboss-elasticsearch | bboss-elasticsearch-spring-boot-starter/src/main/java/org/frameworkset/elasticsearch/boot/BBossESStarter.java | BBossESStarter.getConfigRestClient | public ClientInterface getConfigRestClient(String elasticsearchName,String configFile){
return ElasticSearchHelper.getConfigRestClientUtil(elasticsearchName,configFile);
} | java | public ClientInterface getConfigRestClient(String elasticsearchName,String configFile){
return ElasticSearchHelper.getConfigRestClientUtil(elasticsearchName,configFile);
} | [
"public",
"ClientInterface",
"getConfigRestClient",
"(",
"String",
"elasticsearchName",
",",
"String",
"configFile",
")",
"{",
"return",
"ElasticSearchHelper",
".",
"getConfigRestClientUtil",
"(",
"elasticsearchName",
",",
"configFile",
")",
";",
"}"
] | Get Special elasticsearch server ConfigFile ClientInterface
@param elasticsearchName elasticsearch server name which defined in bboss spring boot application configfile
@param configFile
@return | [
"Get",
"Special",
"elasticsearch",
"server",
"ConfigFile",
"ClientInterface"
] | 31717c8aa2c4c880987be53aeeb8a0cf5183c3a7 | https://github.com/bbossgroups/bboss-elasticsearch/blob/31717c8aa2c4c880987be53aeeb8a0cf5183c3a7/bboss-elasticsearch-spring-boot-starter/src/main/java/org/frameworkset/elasticsearch/boot/BBossESStarter.java#L77-L81 | train |
FXMisc/RichTextFX | richtextfx/src/main/java/org/fxmisc/richtext/StyleClassedTextArea.java | StyleClassedTextArea.setStyleClass | public void setStyleClass(int from, int to, String styleClass) {
setStyle(from, to, Collections.singletonList(styleClass));
} | java | public void setStyleClass(int from, int to, String styleClass) {
setStyle(from, to, Collections.singletonList(styleClass));
} | [
"public",
"void",
"setStyleClass",
"(",
"int",
"from",
",",
"int",
"to",
",",
"String",
"styleClass",
")",
"{",
"setStyle",
"(",
"from",
",",
"to",
",",
"Collections",
".",
"singletonList",
"(",
"styleClass",
")",
")",
";",
"}"
] | Convenient method to assign a single style class. | [
"Convenient",
"method",
"to",
"assign",
"a",
"single",
"style",
"class",
"."
] | bc7cab6a637855e0f37d9b9c12a9172c31545f0b | https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/StyleClassedTextArea.java#L47-L49 | train |
FXMisc/RichTextFX | richtextfx/src/main/java/org/fxmisc/richtext/GenericStyledArea.java | GenericStyledArea.currentLine | TwoDimensional.Position currentLine() {
int parIdx = getCurrentParagraph();
Cell<Paragraph<PS, SEG, S>, ParagraphBox<PS, SEG, S>> cell = virtualFlow.getCell(parIdx);
int lineIdx = cell.getNode().getCurrentLineIndex(caretSelectionBind.getUnderlyingCaret());
return paragraphLineNavigator.p... | java | TwoDimensional.Position currentLine() {
int parIdx = getCurrentParagraph();
Cell<Paragraph<PS, SEG, S>, ParagraphBox<PS, SEG, S>> cell = virtualFlow.getCell(parIdx);
int lineIdx = cell.getNode().getCurrentLineIndex(caretSelectionBind.getUnderlyingCaret());
return paragraphLineNavigator.p... | [
"TwoDimensional",
".",
"Position",
"currentLine",
"(",
")",
"{",
"int",
"parIdx",
"=",
"getCurrentParagraph",
"(",
")",
";",
"Cell",
"<",
"Paragraph",
"<",
"PS",
",",
"SEG",
",",
"S",
">",
",",
"ParagraphBox",
"<",
"PS",
",",
"SEG",
",",
"S",
">",
">... | Returns the current line as a two-level index.
The major number is the paragraph index, the minor
number is the line number within the paragraph.
<p>This method has a side-effect of bringing the current
paragraph to the viewport if it is not already visible. | [
"Returns",
"the",
"current",
"line",
"as",
"a",
"two",
"-",
"level",
"index",
".",
"The",
"major",
"number",
"is",
"the",
"paragraph",
"index",
"the",
"minor",
"number",
"is",
"the",
"line",
"number",
"within",
"the",
"paragraph",
"."
] | bc7cab6a637855e0f37d9b9c12a9172c31545f0b | https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/GenericStyledArea.java#L1271-L1276 | train |
FXMisc/RichTextFX | richtextfx/src/main/java/org/fxmisc/richtext/GenericStyledArea.java | GenericStyledArea.getCaretOffsetX | final ParagraphBox.CaretOffsetX getCaretOffsetX(CaretNode caret) {
return getCell(caret.getParagraphIndex()).getCaretOffsetX(caret);
} | java | final ParagraphBox.CaretOffsetX getCaretOffsetX(CaretNode caret) {
return getCell(caret.getParagraphIndex()).getCaretOffsetX(caret);
} | [
"final",
"ParagraphBox",
".",
"CaretOffsetX",
"getCaretOffsetX",
"(",
"CaretNode",
"caret",
")",
"{",
"return",
"getCell",
"(",
"caret",
".",
"getParagraphIndex",
"(",
")",
")",
".",
"getCaretOffsetX",
"(",
"caret",
")",
";",
"}"
] | Returns x coordinate of the caret in the current paragraph. | [
"Returns",
"x",
"coordinate",
"of",
"the",
"caret",
"in",
"the",
"current",
"paragraph",
"."
] | bc7cab6a637855e0f37d9b9c12a9172c31545f0b | https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/GenericStyledArea.java#L1297-L1299 | train |
FXMisc/RichTextFX | richtextfx/src/main/java/org/fxmisc/richtext/model/Paragraph.java | Paragraph.restyle | public Paragraph<PS, SEG, S> restyle(S style) {
return new Paragraph<>(paragraphStyle, segmentOps, segments, StyleSpans.singleton(style, length()));
} | java | public Paragraph<PS, SEG, S> restyle(S style) {
return new Paragraph<>(paragraphStyle, segmentOps, segments, StyleSpans.singleton(style, length()));
} | [
"public",
"Paragraph",
"<",
"PS",
",",
"SEG",
",",
"S",
">",
"restyle",
"(",
"S",
"style",
")",
"{",
"return",
"new",
"Paragraph",
"<>",
"(",
"paragraphStyle",
",",
"segmentOps",
",",
"segments",
",",
"StyleSpans",
".",
"singleton",
"(",
"style",
",",
... | Restyles every segment in the paragraph to have the given style.
Note: because Paragraph is immutable, this method returns a new Paragraph.
The current Paragraph is unchanged.
@param style The new style for each segment in the paragraph.
@return The new paragraph with the restyled segments. | [
"Restyles",
"every",
"segment",
"in",
"the",
"paragraph",
"to",
"have",
"the",
"given",
"style",
"."
] | bc7cab6a637855e0f37d9b9c12a9172c31545f0b | https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/model/Paragraph.java#L304-L306 | train |
FXMisc/RichTextFX | richtextfx/src/main/java/org/fxmisc/richtext/model/Paragraph.java | Paragraph.setParagraphStyle | public Paragraph<PS, SEG, S> setParagraphStyle(PS paragraphStyle) {
return new Paragraph<>(paragraphStyle, segmentOps, segments, styles);
} | java | public Paragraph<PS, SEG, S> setParagraphStyle(PS paragraphStyle) {
return new Paragraph<>(paragraphStyle, segmentOps, segments, styles);
} | [
"public",
"Paragraph",
"<",
"PS",
",",
"SEG",
",",
"S",
">",
"setParagraphStyle",
"(",
"PS",
"paragraphStyle",
")",
"{",
"return",
"new",
"Paragraph",
"<>",
"(",
"paragraphStyle",
",",
"segmentOps",
",",
"segments",
",",
"styles",
")",
";",
"}"
] | Creates a new Paragraph which has the same contents as the current Paragraph,
but the given paragraph style.
Note that because Paragraph is immutable, a new Paragraph is returned.
Despite the setX name, the current object is unchanged.
@param paragraphStyle The new paragraph style
@return A new paragraph with the sam... | [
"Creates",
"a",
"new",
"Paragraph",
"which",
"has",
"the",
"same",
"contents",
"as",
"the",
"current",
"Paragraph",
"but",
"the",
"given",
"paragraph",
"style",
"."
] | bc7cab6a637855e0f37d9b9c12a9172c31545f0b | https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/model/Paragraph.java#L347-L349 | train |
FXMisc/RichTextFX | richtextfx/src/main/java/org/fxmisc/richtext/model/Paragraph.java | Paragraph.getText | public String getText() {
if(text == null) {
StringBuilder sb = new StringBuilder(length());
for(SEG seg: segments)
sb.append(segmentOps.getText(seg));
text = sb.toString();
}
return text;
} | java | public String getText() {
if(text == null) {
StringBuilder sb = new StringBuilder(length());
for(SEG seg: segments)
sb.append(segmentOps.getText(seg));
text = sb.toString();
}
return text;
} | [
"public",
"String",
"getText",
"(",
")",
"{",
"if",
"(",
"text",
"==",
"null",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"length",
"(",
")",
")",
";",
"for",
"(",
"SEG",
"seg",
":",
"segments",
")",
"sb",
".",
"append",
"("... | Returns the plain text content of this paragraph,
not including the line terminator. | [
"Returns",
"the",
"plain",
"text",
"content",
"of",
"this",
"paragraph",
"not",
"including",
"the",
"line",
"terminator",
"."
] | bc7cab6a637855e0f37d9b9c12a9172c31545f0b | https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/model/Paragraph.java#L412-L420 | train |
FXMisc/RichTextFX | richtextfx/src/main/java/org/fxmisc/richtext/model/ReadOnlyStyledDocument.java | ReadOnlyStyledDocument.split | public Tuple2<ReadOnlyStyledDocument<PS, SEG, S>, ReadOnlyStyledDocument<PS, SEG, S>> split(int position) {
return tree.locate(NAVIGATE, position).map(this::split);
} | java | public Tuple2<ReadOnlyStyledDocument<PS, SEG, S>, ReadOnlyStyledDocument<PS, SEG, S>> split(int position) {
return tree.locate(NAVIGATE, position).map(this::split);
} | [
"public",
"Tuple2",
"<",
"ReadOnlyStyledDocument",
"<",
"PS",
",",
"SEG",
",",
"S",
">",
",",
"ReadOnlyStyledDocument",
"<",
"PS",
",",
"SEG",
",",
"S",
">",
">",
"split",
"(",
"int",
"position",
")",
"{",
"return",
"tree",
".",
"locate",
"(",
"NAVIGAT... | Splits this document into two at the given position and returns both halves. | [
"Splits",
"this",
"document",
"into",
"two",
"at",
"the",
"given",
"position",
"and",
"returns",
"both",
"halves",
"."
] | bc7cab6a637855e0f37d9b9c12a9172c31545f0b | https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/model/ReadOnlyStyledDocument.java#L274-L276 | train |
FXMisc/RichTextFX | richtextfx/src/main/java/org/fxmisc/richtext/model/ReadOnlyStyledDocument.java | ReadOnlyStyledDocument.split | public Tuple2<ReadOnlyStyledDocument<PS, SEG, S>, ReadOnlyStyledDocument<PS, SEG, S>> split(
int paragraphIndex, int columnPosition) {
return tree.splitAt(paragraphIndex).map((l, p, r) -> {
Paragraph<PS, SEG, S> p1 = p.trim(columnPosition);
Paragraph<PS, SEG, S> p2 = p.subSeq... | java | public Tuple2<ReadOnlyStyledDocument<PS, SEG, S>, ReadOnlyStyledDocument<PS, SEG, S>> split(
int paragraphIndex, int columnPosition) {
return tree.splitAt(paragraphIndex).map((l, p, r) -> {
Paragraph<PS, SEG, S> p1 = p.trim(columnPosition);
Paragraph<PS, SEG, S> p2 = p.subSeq... | [
"public",
"Tuple2",
"<",
"ReadOnlyStyledDocument",
"<",
"PS",
",",
"SEG",
",",
"S",
">",
",",
"ReadOnlyStyledDocument",
"<",
"PS",
",",
"SEG",
",",
"S",
">",
">",
"split",
"(",
"int",
"paragraphIndex",
",",
"int",
"columnPosition",
")",
"{",
"return",
"t... | Splits this document into two at the given paragraph's column position and returns both halves. | [
"Splits",
"this",
"document",
"into",
"two",
"at",
"the",
"given",
"paragraph",
"s",
"column",
"position",
"and",
"returns",
"both",
"halves",
"."
] | bc7cab6a637855e0f37d9b9c12a9172c31545f0b | https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/model/ReadOnlyStyledDocument.java#L281-L290 | train |
FXMisc/RichTextFX | richtextfx/src/main/java/org/fxmisc/richtext/model/ReadOnlyStyledDocumentBuilder.java | ReadOnlyStyledDocumentBuilder.constructDocument | public static <PS, SEG, S> ReadOnlyStyledDocument<PS, SEG, S> constructDocument(
SegmentOps<SEG, S> segmentOps, PS defaultParagraphStyle,
Consumer<ReadOnlyStyledDocumentBuilder<PS, SEG, S>> configuration) {
ReadOnlyStyledDocumentBuilder<PS, SEG, S> builder = new ReadOnlyStyledDocumentBui... | java | public static <PS, SEG, S> ReadOnlyStyledDocument<PS, SEG, S> constructDocument(
SegmentOps<SEG, S> segmentOps, PS defaultParagraphStyle,
Consumer<ReadOnlyStyledDocumentBuilder<PS, SEG, S>> configuration) {
ReadOnlyStyledDocumentBuilder<PS, SEG, S> builder = new ReadOnlyStyledDocumentBui... | [
"public",
"static",
"<",
"PS",
",",
"SEG",
",",
"S",
">",
"ReadOnlyStyledDocument",
"<",
"PS",
",",
"SEG",
",",
"S",
">",
"constructDocument",
"(",
"SegmentOps",
"<",
"SEG",
",",
"S",
">",
"segmentOps",
",",
"PS",
"defaultParagraphStyle",
",",
"Consumer",
... | Constructs a list of paragraphs
@param segmentOps the {@link SegmentOps} object to use for one of the {@link Paragraph}'s constructors
@param defaultParagraphStyle the paragraph style object to use when it is not specified in the
"addParagraph" methods
@param configuration call the builder's {@link #addParagraph(Objec... | [
"Constructs",
"a",
"list",
"of",
"paragraphs"
] | bc7cab6a637855e0f37d9b9c12a9172c31545f0b | https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/model/ReadOnlyStyledDocumentBuilder.java#L29-L35 | train |
FXMisc/RichTextFX | richtextfx/src/main/java/org/fxmisc/richtext/model/ReadOnlyStyledDocumentBuilder.java | ReadOnlyStyledDocumentBuilder.addParagraph | public ReadOnlyStyledDocumentBuilder<PS, SEG, S> addParagraph(List<SEG> segments, StyleSpans<S> styles) {
return addParagraph(segments, styles, null);
} | java | public ReadOnlyStyledDocumentBuilder<PS, SEG, S> addParagraph(List<SEG> segments, StyleSpans<S> styles) {
return addParagraph(segments, styles, null);
} | [
"public",
"ReadOnlyStyledDocumentBuilder",
"<",
"PS",
",",
"SEG",
",",
"S",
">",
"addParagraph",
"(",
"List",
"<",
"SEG",
">",
"segments",
",",
"StyleSpans",
"<",
"S",
">",
"styles",
")",
"{",
"return",
"addParagraph",
"(",
"segments",
",",
"styles",
",",
... | Adds to the list a paragraph that has multiple segments with multiple styles throughout those segments | [
"Adds",
"to",
"the",
"list",
"a",
"paragraph",
"that",
"has",
"multiple",
"segments",
"with",
"multiple",
"styles",
"throughout",
"those",
"segments"
] | bc7cab6a637855e0f37d9b9c12a9172c31545f0b | https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/model/ReadOnlyStyledDocumentBuilder.java#L134-L136 | train |
FXMisc/RichTextFX | richtextfx/src/main/java/org/fxmisc/richtext/model/ReadOnlyStyledDocumentBuilder.java | ReadOnlyStyledDocumentBuilder.addParagraphs0 | public ReadOnlyStyledDocumentBuilder<PS, SEG, S> addParagraphs0(List<Tuple2<PS, List<SEG>>> paragraphArgList,
StyleSpans<S> entireDocumentStyleSpans) {
return addParagraphList(paragraphArgList, entireDocumentStyleSpans, Tuple2::get1, Tuple2::get2);
} | java | public ReadOnlyStyledDocumentBuilder<PS, SEG, S> addParagraphs0(List<Tuple2<PS, List<SEG>>> paragraphArgList,
StyleSpans<S> entireDocumentStyleSpans) {
return addParagraphList(paragraphArgList, entireDocumentStyleSpans, Tuple2::get1, Tuple2::get2);
} | [
"public",
"ReadOnlyStyledDocumentBuilder",
"<",
"PS",
",",
"SEG",
",",
"S",
">",
"addParagraphs0",
"(",
"List",
"<",
"Tuple2",
"<",
"PS",
",",
"List",
"<",
"SEG",
">",
">",
">",
"paragraphArgList",
",",
"StyleSpans",
"<",
"S",
">",
"entireDocumentStyleSpans"... | Adds multiple paragraphs to the list, allowing one to specify each paragraph's paragraph style.
@param paragraphArgList each item is a Tuple2 that represents the paragraph style and segment list
for a single paragraph. If the paragraph style is {@code null},
the {@link #defaultParagraphStyle} will be used instead.
@pa... | [
"Adds",
"multiple",
"paragraphs",
"to",
"the",
"list",
"allowing",
"one",
"to",
"specify",
"each",
"paragraph",
"s",
"paragraph",
"style",
"."
] | bc7cab6a637855e0f37d9b9c12a9172c31545f0b | https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/model/ReadOnlyStyledDocumentBuilder.java#L167-L170 | train |
FXMisc/RichTextFX | richtextfx/src/main/java/org/fxmisc/richtext/CaretNode.java | CaretNode.moveContentBreaks | private void moveContentBreaks(int numOfBreaks, BreakIterator breakIterator, boolean followingNotPreceding) {
if (area.getLength() == 0) {
return;
}
breakIterator.setText(area.getText());
if (followingNotPreceding) {
breakIterator.following(getPosition());
... | java | private void moveContentBreaks(int numOfBreaks, BreakIterator breakIterator, boolean followingNotPreceding) {
if (area.getLength() == 0) {
return;
}
breakIterator.setText(area.getText());
if (followingNotPreceding) {
breakIterator.following(getPosition());
... | [
"private",
"void",
"moveContentBreaks",
"(",
"int",
"numOfBreaks",
",",
"BreakIterator",
"breakIterator",
",",
"boolean",
"followingNotPreceding",
")",
"{",
"if",
"(",
"area",
".",
"getLength",
"(",
")",
"==",
"0",
")",
"{",
"return",
";",
"}",
"breakIterator"... | Helper method for reducing duplicate code
@param numOfBreaks the number of breaks
@param breakIterator the type of iterator to use
@param followingNotPreceding if true, use {@link BreakIterator#following(int)}.
Otherwise, use {@link BreakIterator#preceding(int)}. | [
"Helper",
"method",
"for",
"reducing",
"duplicate",
"code"
] | bc7cab6a637855e0f37d9b9c12a9172c31545f0b | https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/CaretNode.java#L372-L387 | train |
FXMisc/RichTextFX | richtextfx-demos/src/main/java/org/fxmisc/richtext/demo/richtext/RichTextDemo.java | RichTextDemo.insertImage | private void insertImage() {
String initialDir = System.getProperty("user.dir");
FileChooser fileChooser = new FileChooser();
fileChooser.setTitle("Insert image");
fileChooser.setInitialDirectory(new File(initialDir));
File selectedFile = fileChooser.showOpenDialog(mainStage);
... | java | private void insertImage() {
String initialDir = System.getProperty("user.dir");
FileChooser fileChooser = new FileChooser();
fileChooser.setTitle("Insert image");
fileChooser.setInitialDirectory(new File(initialDir));
File selectedFile = fileChooser.showOpenDialog(mainStage);
... | [
"private",
"void",
"insertImage",
"(",
")",
"{",
"String",
"initialDir",
"=",
"System",
".",
"getProperty",
"(",
"\"user.dir\"",
")",
";",
"FileChooser",
"fileChooser",
"=",
"new",
"FileChooser",
"(",
")",
";",
"fileChooser",
".",
"setTitle",
"(",
"\"Insert im... | Action listener which inserts a new image at the current caret position. | [
"Action",
"listener",
"which",
"inserts",
"a",
"new",
"image",
"at",
"the",
"current",
"caret",
"position",
"."
] | bc7cab6a637855e0f37d9b9c12a9172c31545f0b | https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx-demos/src/main/java/org/fxmisc/richtext/demo/richtext/RichTextDemo.java#L452-L466 | train |
FXMisc/RichTextFX | richtextfx/src/main/java/org/fxmisc/richtext/ParagraphBox.java | ParagraphBox.hitTextLine | CharacterHit hitTextLine(CaretOffsetX x, int line) {
return text.hitLine(x.value, line);
} | java | CharacterHit hitTextLine(CaretOffsetX x, int line) {
return text.hitLine(x.value, line);
} | [
"CharacterHit",
"hitTextLine",
"(",
"CaretOffsetX",
"x",
",",
"int",
"line",
")",
"{",
"return",
"text",
".",
"hitLine",
"(",
"x",
".",
"value",
",",
"line",
")",
";",
"}"
] | Hits the embedded TextFlow at the given line and x offset.
@param x x coordinate relative to the embedded TextFlow.
@param line index of the line in the embedded TextFlow.
@return hit info for the given line and x coordinate | [
"Hits",
"the",
"embedded",
"TextFlow",
"at",
"the",
"given",
"line",
"and",
"x",
"offset",
"."
] | bc7cab6a637855e0f37d9b9c12a9172c31545f0b | https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/ParagraphBox.java#L263-L265 | train |
FXMisc/RichTextFX | richtextfx/src/main/java/org/fxmisc/richtext/ParagraphBox.java | ParagraphBox.hitText | CharacterHit hitText(CaretOffsetX x, double y) {
return text.hit(x.value, y);
} | java | CharacterHit hitText(CaretOffsetX x, double y) {
return text.hit(x.value, y);
} | [
"CharacterHit",
"hitText",
"(",
"CaretOffsetX",
"x",
",",
"double",
"y",
")",
"{",
"return",
"text",
".",
"hit",
"(",
"x",
".",
"value",
",",
"y",
")",
";",
"}"
] | Hits the embedded TextFlow at the given x and y offset.
@return hit info for the given x and y coordinates | [
"Hits",
"the",
"embedded",
"TextFlow",
"at",
"the",
"given",
"x",
"and",
"y",
"offset",
"."
] | bc7cab6a637855e0f37d9b9c12a9172c31545f0b | https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/ParagraphBox.java#L272-L274 | train |
FXMisc/RichTextFX | richtextfx/src/main/java/org/fxmisc/richtext/CaretSelectionBindImpl.java | CaretSelectionBindImpl.selectRangeExpl | @Override
public void selectRangeExpl(int anchorParagraph, int anchorColumn, int caretParagraph, int caretColumn) {
selectRangeExpl(textPosition(anchorParagraph, anchorColumn), textPosition(caretParagraph, caretColumn));
} | java | @Override
public void selectRangeExpl(int anchorParagraph, int anchorColumn, int caretParagraph, int caretColumn) {
selectRangeExpl(textPosition(anchorParagraph, anchorColumn), textPosition(caretParagraph, caretColumn));
} | [
"@",
"Override",
"public",
"void",
"selectRangeExpl",
"(",
"int",
"anchorParagraph",
",",
"int",
"anchorColumn",
",",
"int",
"caretParagraph",
",",
"int",
"caretColumn",
")",
"{",
"selectRangeExpl",
"(",
"textPosition",
"(",
"anchorParagraph",
",",
"anchorColumn",
... | caret selection bind | [
"caret",
"selection",
"bind"
] | bc7cab6a637855e0f37d9b9c12a9172c31545f0b | https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/CaretSelectionBindImpl.java#L346-L349 | train |
dain/leveldb | leveldb/src/main/java/org/iq80/leveldb/impl/LogMonitors.java | LogMonitors.logMonitor | public static LogMonitor logMonitor()
{
return new LogMonitor()
{
@Override
public void corruption(long bytes, String reason)
{
System.out.println(String.format("corruption of %s bytes: %s", bytes, reason));
}
@Override
... | java | public static LogMonitor logMonitor()
{
return new LogMonitor()
{
@Override
public void corruption(long bytes, String reason)
{
System.out.println(String.format("corruption of %s bytes: %s", bytes, reason));
}
@Override
... | [
"public",
"static",
"LogMonitor",
"logMonitor",
"(",
")",
"{",
"return",
"new",
"LogMonitor",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"corruption",
"(",
"long",
"bytes",
",",
"String",
"reason",
")",
"{",
"System",
".",
"out",
".",
"println",
"... | todo implement real logging | [
"todo",
"implement",
"real",
"logging"
] | 7994065b48eada2ef29e7fefd172c2ad1e0110eb | https://github.com/dain/leveldb/blob/7994065b48eada2ef29e7fefd172c2ad1e0110eb/leveldb/src/main/java/org/iq80/leveldb/impl/LogMonitors.java#L41-L58 | train |
dain/leveldb | leveldb/src/main/java/org/iq80/leveldb/table/BlockIterator.java | BlockIterator.seek | @Override
public void seek(Slice targetKey)
{
if (restartCount == 0) {
return;
}
int left = 0;
int right = restartCount - 1;
// binary search restart positions to find the restart position immediately before the targetKey
while (left < right) {
... | java | @Override
public void seek(Slice targetKey)
{
if (restartCount == 0) {
return;
}
int left = 0;
int right = restartCount - 1;
// binary search restart positions to find the restart position immediately before the targetKey
while (left < right) {
... | [
"@",
"Override",
"public",
"void",
"seek",
"(",
"Slice",
"targetKey",
")",
"{",
"if",
"(",
"restartCount",
"==",
"0",
")",
"{",
"return",
";",
"}",
"int",
"left",
"=",
"0",
";",
"int",
"right",
"=",
"restartCount",
"-",
"1",
";",
"// binary search rest... | Repositions the iterator so the key of the next BlockElement returned greater than or equal to the specified targetKey. | [
"Repositions",
"the",
"iterator",
"so",
"the",
"key",
"of",
"the",
"next",
"BlockElement",
"returned",
"greater",
"than",
"or",
"equal",
"to",
"the",
"specified",
"targetKey",
"."
] | 7994065b48eada2ef29e7fefd172c2ad1e0110eb | https://github.com/dain/leveldb/blob/7994065b48eada2ef29e7fefd172c2ad1e0110eb/leveldb/src/main/java/org/iq80/leveldb/table/BlockIterator.java#L118-L153 | train |
dain/leveldb | leveldb/src/main/java/org/iq80/leveldb/table/BlockIterator.java | BlockIterator.readEntry | private static BlockEntry readEntry(SliceInput data, BlockEntry previousEntry)
{
requireNonNull(data, "data is null");
// read entry header
int sharedKeyLength = VariableLengthQuantity.readVariableLengthInt(data);
int nonSharedKeyLength = VariableLengthQuantity.readVariableLengthInt... | java | private static BlockEntry readEntry(SliceInput data, BlockEntry previousEntry)
{
requireNonNull(data, "data is null");
// read entry header
int sharedKeyLength = VariableLengthQuantity.readVariableLengthInt(data);
int nonSharedKeyLength = VariableLengthQuantity.readVariableLengthInt... | [
"private",
"static",
"BlockEntry",
"readEntry",
"(",
"SliceInput",
"data",
",",
"BlockEntry",
"previousEntry",
")",
"{",
"requireNonNull",
"(",
"data",
",",
"\"data is null\"",
")",
";",
"// read entry header",
"int",
"sharedKeyLength",
"=",
"VariableLengthQuantity",
... | Reads the entry at the current data readIndex.
After this method, data readIndex is positioned at the beginning of the next entry
or at the end of data if there was not a next entry.
@return true if an entry was read | [
"Reads",
"the",
"entry",
"at",
"the",
"current",
"data",
"readIndex",
".",
"After",
"this",
"method",
"data",
"readIndex",
"is",
"positioned",
"at",
"the",
"beginning",
"of",
"the",
"next",
"entry",
"or",
"at",
"the",
"end",
"of",
"data",
"if",
"there",
... | 7994065b48eada2ef29e7fefd172c2ad1e0110eb | https://github.com/dain/leveldb/blob/7994065b48eada2ef29e7fefd172c2ad1e0110eb/leveldb/src/main/java/org/iq80/leveldb/table/BlockIterator.java#L182-L204 | train |
dain/leveldb | leveldb/src/main/java/org/iq80/leveldb/impl/Filename.java | Filename.setCurrentFile | public static boolean setCurrentFile(File databaseDir, long descriptorNumber)
throws IOException
{
String manifest = descriptorFileName(descriptorNumber);
String temp = tempFileName(descriptorNumber);
File tempFile = new File(databaseDir, temp);
writeStringToFileSync(man... | java | public static boolean setCurrentFile(File databaseDir, long descriptorNumber)
throws IOException
{
String manifest = descriptorFileName(descriptorNumber);
String temp = tempFileName(descriptorNumber);
File tempFile = new File(databaseDir, temp);
writeStringToFileSync(man... | [
"public",
"static",
"boolean",
"setCurrentFile",
"(",
"File",
"databaseDir",
",",
"long",
"descriptorNumber",
")",
"throws",
"IOException",
"{",
"String",
"manifest",
"=",
"descriptorFileName",
"(",
"descriptorNumber",
")",
";",
"String",
"temp",
"=",
"tempFileName"... | Make the CURRENT file point to the descriptor file with the
specified number.
@return true if successful; false otherwise | [
"Make",
"the",
"CURRENT",
"file",
"point",
"to",
"the",
"descriptor",
"file",
"with",
"the",
"specified",
"number",
"."
] | 7994065b48eada2ef29e7fefd172c2ad1e0110eb | https://github.com/dain/leveldb/blob/7994065b48eada2ef29e7fefd172c2ad1e0110eb/leveldb/src/main/java/org/iq80/leveldb/impl/Filename.java#L165-L181 | train |
dain/leveldb | leveldb/src/main/java/org/iq80/leveldb/impl/Compaction.java | Compaction.isBaseLevelForKey | public boolean isBaseLevelForKey(Slice userKey)
{
// Maybe use binary search to find right entry instead of linear search?
UserComparator userComparator = inputVersion.getInternalKeyComparator().getUserComparator();
for (int level = this.level + 2; level < NUM_LEVELS; level++) {
... | java | public boolean isBaseLevelForKey(Slice userKey)
{
// Maybe use binary search to find right entry instead of linear search?
UserComparator userComparator = inputVersion.getInternalKeyComparator().getUserComparator();
for (int level = this.level + 2; level < NUM_LEVELS; level++) {
... | [
"public",
"boolean",
"isBaseLevelForKey",
"(",
"Slice",
"userKey",
")",
"{",
"// Maybe use binary search to find right entry instead of linear search?",
"UserComparator",
"userComparator",
"=",
"inputVersion",
".",
"getInternalKeyComparator",
"(",
")",
".",
"getUserComparator",
... | in levels greater than "level+1". | [
"in",
"levels",
"greater",
"than",
"level",
"+",
"1",
"."
] | 7994065b48eada2ef29e7fefd172c2ad1e0110eb | https://github.com/dain/leveldb/blob/7994065b48eada2ef29e7fefd172c2ad1e0110eb/leveldb/src/main/java/org/iq80/leveldb/impl/Compaction.java#L151-L171 | train |
dain/leveldb | leveldb/src/main/java/org/iq80/leveldb/impl/Compaction.java | Compaction.shouldStopBefore | public boolean shouldStopBefore(InternalKey internalKey)
{
// Scan to find earliest grandparent file that contains key.
InternalKeyComparator internalKeyComparator = inputVersion.getInternalKeyComparator();
while (grandparentIndex < grandparents.size() && internalKeyComparator.compare(intern... | java | public boolean shouldStopBefore(InternalKey internalKey)
{
// Scan to find earliest grandparent file that contains key.
InternalKeyComparator internalKeyComparator = inputVersion.getInternalKeyComparator();
while (grandparentIndex < grandparents.size() && internalKeyComparator.compare(intern... | [
"public",
"boolean",
"shouldStopBefore",
"(",
"InternalKey",
"internalKey",
")",
"{",
"// Scan to find earliest grandparent file that contains key.",
"InternalKeyComparator",
"internalKeyComparator",
"=",
"inputVersion",
".",
"getInternalKeyComparator",
"(",
")",
";",
"while",
... | before processing "internal_key". | [
"before",
"processing",
"internal_key",
"."
] | 7994065b48eada2ef29e7fefd172c2ad1e0110eb | https://github.com/dain/leveldb/blob/7994065b48eada2ef29e7fefd172c2ad1e0110eb/leveldb/src/main/java/org/iq80/leveldb/impl/Compaction.java#L175-L195 | train |
dain/leveldb | leveldb/src/main/java/org/iq80/leveldb/util/Slice.java | Slice.copySlice | public Slice copySlice(int index, int length)
{
checkPositionIndexes(index, index + length, this.length);
index += offset;
byte[] copiedArray = new byte[length];
System.arraycopy(data, index, copiedArray, 0, length);
return new Slice(copiedArray);
} | java | public Slice copySlice(int index, int length)
{
checkPositionIndexes(index, index + length, this.length);
index += offset;
byte[] copiedArray = new byte[length];
System.arraycopy(data, index, copiedArray, 0, length);
return new Slice(copiedArray);
} | [
"public",
"Slice",
"copySlice",
"(",
"int",
"index",
",",
"int",
"length",
")",
"{",
"checkPositionIndexes",
"(",
"index",
",",
"index",
"+",
"length",
",",
"this",
".",
"length",
")",
";",
"index",
"+=",
"offset",
";",
"byte",
"[",
"]",
"copiedArray",
... | Returns a copy of this buffer's sub-region. Modifying the content of
the returned buffer or this buffer does not affect each other at all. | [
"Returns",
"a",
"copy",
"of",
"this",
"buffer",
"s",
"sub",
"-",
"region",
".",
"Modifying",
"the",
"content",
"of",
"the",
"returned",
"buffer",
"or",
"this",
"buffer",
"does",
"not",
"affect",
"each",
"other",
"at",
"all",
"."
] | 7994065b48eada2ef29e7fefd172c2ad1e0110eb | https://github.com/dain/leveldb/blob/7994065b48eada2ef29e7fefd172c2ad1e0110eb/leveldb/src/main/java/org/iq80/leveldb/util/Slice.java#L527-L535 | train |
dain/leveldb | leveldb/src/main/java/org/iq80/leveldb/util/Slice.java | Slice.slice | public Slice slice(int index, int length)
{
if (index == 0 && length == this.length) {
return this;
}
checkPositionIndexes(index, index + length, this.length);
if (index >= 0 && length == 0) {
return Slices.EMPTY_SLICE;
}
return new Slice(data... | java | public Slice slice(int index, int length)
{
if (index == 0 && length == this.length) {
return this;
}
checkPositionIndexes(index, index + length, this.length);
if (index >= 0 && length == 0) {
return Slices.EMPTY_SLICE;
}
return new Slice(data... | [
"public",
"Slice",
"slice",
"(",
"int",
"index",
",",
"int",
"length",
")",
"{",
"if",
"(",
"index",
"==",
"0",
"&&",
"length",
"==",
"this",
".",
"length",
")",
"{",
"return",
"this",
";",
"}",
"checkPositionIndexes",
"(",
"index",
",",
"index",
"+"... | Returns a slice of this buffer's sub-region. Modifying the content of
the returned buffer or this buffer affects each other's content while
they maintain separate indexes and marks. | [
"Returns",
"a",
"slice",
"of",
"this",
"buffer",
"s",
"sub",
"-",
"region",
".",
"Modifying",
"the",
"content",
"of",
"the",
"returned",
"buffer",
"or",
"this",
"buffer",
"affects",
"each",
"other",
"s",
"content",
"while",
"they",
"maintain",
"separate",
... | 7994065b48eada2ef29e7fefd172c2ad1e0110eb | https://github.com/dain/leveldb/blob/7994065b48eada2ef29e7fefd172c2ad1e0110eb/leveldb/src/main/java/org/iq80/leveldb/util/Slice.java#L571-L582 | train |
dain/leveldb | leveldb/src/main/java/org/iq80/leveldb/util/Slice.java | Slice.toByteBuffer | public ByteBuffer toByteBuffer(int index, int length)
{
checkPositionIndexes(index, index + length, this.length);
index += offset;
return ByteBuffer.wrap(data, index, length).order(LITTLE_ENDIAN);
} | java | public ByteBuffer toByteBuffer(int index, int length)
{
checkPositionIndexes(index, index + length, this.length);
index += offset;
return ByteBuffer.wrap(data, index, length).order(LITTLE_ENDIAN);
} | [
"public",
"ByteBuffer",
"toByteBuffer",
"(",
"int",
"index",
",",
"int",
"length",
")",
"{",
"checkPositionIndexes",
"(",
"index",
",",
"index",
"+",
"length",
",",
"this",
".",
"length",
")",
";",
"index",
"+=",
"offset",
";",
"return",
"ByteBuffer",
".",... | Converts this buffer's sub-region into a NIO buffer. The returned
buffer shares the content with this buffer. | [
"Converts",
"this",
"buffer",
"s",
"sub",
"-",
"region",
"into",
"a",
"NIO",
"buffer",
".",
"The",
"returned",
"buffer",
"shares",
"the",
"content",
"with",
"this",
"buffer",
"."
] | 7994065b48eada2ef29e7fefd172c2ad1e0110eb | https://github.com/dain/leveldb/blob/7994065b48eada2ef29e7fefd172c2ad1e0110eb/leveldb/src/main/java/org/iq80/leveldb/util/Slice.java#L613-L618 | train |
dain/leveldb | leveldb/src/main/java/org/iq80/leveldb/impl/LogReader.java | LogReader.readNextChunk | private LogChunkType readNextChunk()
{
// clear the current chunk
currentChunk = Slices.EMPTY_SLICE;
// read the next block if necessary
if (currentBlock.available() < HEADER_SIZE) {
if (!readNextBlock()) {
if (eof) {
return EOF;
... | java | private LogChunkType readNextChunk()
{
// clear the current chunk
currentChunk = Slices.EMPTY_SLICE;
// read the next block if necessary
if (currentBlock.available() < HEADER_SIZE) {
if (!readNextBlock()) {
if (eof) {
return EOF;
... | [
"private",
"LogChunkType",
"readNextChunk",
"(",
")",
"{",
"// clear the current chunk",
"currentChunk",
"=",
"Slices",
".",
"EMPTY_SLICE",
";",
"// read the next block if necessary",
"if",
"(",
"currentBlock",
".",
"available",
"(",
")",
"<",
"HEADER_SIZE",
")",
"{",... | Return type, or one of the preceding special values | [
"Return",
"type",
"or",
"one",
"of",
"the",
"preceding",
"special",
"values"
] | 7994065b48eada2ef29e7fefd172c2ad1e0110eb | https://github.com/dain/leveldb/blob/7994065b48eada2ef29e7fefd172c2ad1e0110eb/leveldb/src/main/java/org/iq80/leveldb/impl/LogReader.java#L231-L299 | train |
dain/leveldb | leveldb/src/main/java/org/iq80/leveldb/impl/LogReader.java | LogReader.reportCorruption | private void reportCorruption(long bytes, String reason)
{
if (monitor != null) {
monitor.corruption(bytes, reason);
}
} | java | private void reportCorruption(long bytes, String reason)
{
if (monitor != null) {
monitor.corruption(bytes, reason);
}
} | [
"private",
"void",
"reportCorruption",
"(",
"long",
"bytes",
",",
"String",
"reason",
")",
"{",
"if",
"(",
"monitor",
"!=",
"null",
")",
"{",
"monitor",
".",
"corruption",
"(",
"bytes",
",",
"reason",
")",
";",
"}",
"}"
] | Reports corruption to the monitor.
The buffer must be updated to remove the dropped bytes prior to invocation. | [
"Reports",
"corruption",
"to",
"the",
"monitor",
".",
"The",
"buffer",
"must",
"be",
"updated",
"to",
"remove",
"the",
"dropped",
"bytes",
"prior",
"to",
"invocation",
"."
] | 7994065b48eada2ef29e7fefd172c2ad1e0110eb | https://github.com/dain/leveldb/blob/7994065b48eada2ef29e7fefd172c2ad1e0110eb/leveldb/src/main/java/org/iq80/leveldb/impl/LogReader.java#L337-L342 | train |
dain/leveldb | leveldb/src/main/java/org/iq80/leveldb/impl/LogReader.java | LogReader.reportDrop | private void reportDrop(long bytes, Throwable reason)
{
if (monitor != null) {
monitor.corruption(bytes, reason);
}
} | java | private void reportDrop(long bytes, Throwable reason)
{
if (monitor != null) {
monitor.corruption(bytes, reason);
}
} | [
"private",
"void",
"reportDrop",
"(",
"long",
"bytes",
",",
"Throwable",
"reason",
")",
"{",
"if",
"(",
"monitor",
"!=",
"null",
")",
"{",
"monitor",
".",
"corruption",
"(",
"bytes",
",",
"reason",
")",
";",
"}",
"}"
] | Reports dropped bytes to the monitor.
The buffer must be updated to remove the dropped bytes prior to invocation. | [
"Reports",
"dropped",
"bytes",
"to",
"the",
"monitor",
".",
"The",
"buffer",
"must",
"be",
"updated",
"to",
"remove",
"the",
"dropped",
"bytes",
"prior",
"to",
"invocation",
"."
] | 7994065b48eada2ef29e7fefd172c2ad1e0110eb | https://github.com/dain/leveldb/blob/7994065b48eada2ef29e7fefd172c2ad1e0110eb/leveldb/src/main/java/org/iq80/leveldb/impl/LogReader.java#L348-L353 | train |
spockframework/spock | spock-core/src/main/java/spock/util/concurrent/BlockingVariable.java | BlockingVariable.get | public T get() throws InterruptedException {
if (!valueReady.await((long) (timeout * 1000), TimeUnit.MILLISECONDS)) {
String msg = String.format("BlockingVariable.get() timed out after %1.2f seconds", timeout);
throw new SpockTimeoutError(timeout, msg);
}
return value;
} | java | public T get() throws InterruptedException {
if (!valueReady.await((long) (timeout * 1000), TimeUnit.MILLISECONDS)) {
String msg = String.format("BlockingVariable.get() timed out after %1.2f seconds", timeout);
throw new SpockTimeoutError(timeout, msg);
}
return value;
} | [
"public",
"T",
"get",
"(",
")",
"throws",
"InterruptedException",
"{",
"if",
"(",
"!",
"valueReady",
".",
"await",
"(",
"(",
"long",
")",
"(",
"timeout",
"*",
"1000",
")",
",",
"TimeUnit",
".",
"MILLISECONDS",
")",
")",
"{",
"String",
"msg",
"=",
"St... | Blocks until a value has been set for this variable, or a timeout expires.
@return the variable's value
@throws InterruptedException if the calling thread is interrupted | [
"Blocks",
"until",
"a",
"value",
"has",
"been",
"set",
"for",
"this",
"variable",
"or",
"a",
"timeout",
"expires",
"."
] | d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9 | https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/spock/util/concurrent/BlockingVariable.java#L110-L116 | train |
spockframework/spock | spock-core/src/main/java/org/spockframework/compiler/SpecRewriter.java | SpecRewriter.handleWhereBlock | private void handleWhereBlock(Method method) {
Block block = method.getLastBlock();
if (!(block instanceof WhereBlock)) return;
new DeepBlockRewriter(this).visit(block);
WhereBlockRewriter.rewrite((WhereBlock) block, this);
} | java | private void handleWhereBlock(Method method) {
Block block = method.getLastBlock();
if (!(block instanceof WhereBlock)) return;
new DeepBlockRewriter(this).visit(block);
WhereBlockRewriter.rewrite((WhereBlock) block, this);
} | [
"private",
"void",
"handleWhereBlock",
"(",
"Method",
"method",
")",
"{",
"Block",
"block",
"=",
"method",
".",
"getLastBlock",
"(",
")",
";",
"if",
"(",
"!",
"(",
"block",
"instanceof",
"WhereBlock",
")",
")",
"return",
";",
"new",
"DeepBlockRewriter",
"(... | will then be used by DeepBlockRewriter | [
"will",
"then",
"be",
"used",
"by",
"DeepBlockRewriter"
] | d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9 | https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/org/spockframework/compiler/SpecRewriter.java#L285-L291 | train |
spockframework/spock | spock-core/src/main/java/org/spockframework/runtime/extension/builtin/IncludeExcludeExtension.java | IncludeExcludeExtension.handleFeatureIncludes | private void handleFeatureIncludes(SpecInfo spec, IncludeExcludeCriteria criteria) {
if (criteria.isEmpty()) return;
for (FeatureInfo feature : spec.getAllFeatures())
if (hasAnyAnnotation(feature.getFeatureMethod(), criteria.annotations))
feature.setExcluded(false);
} | java | private void handleFeatureIncludes(SpecInfo spec, IncludeExcludeCriteria criteria) {
if (criteria.isEmpty()) return;
for (FeatureInfo feature : spec.getAllFeatures())
if (hasAnyAnnotation(feature.getFeatureMethod(), criteria.annotations))
feature.setExcluded(false);
} | [
"private",
"void",
"handleFeatureIncludes",
"(",
"SpecInfo",
"spec",
",",
"IncludeExcludeCriteria",
"criteria",
")",
"{",
"if",
"(",
"criteria",
".",
"isEmpty",
"(",
")",
")",
"return",
";",
"for",
"(",
"FeatureInfo",
"feature",
":",
"spec",
".",
"getAllFeatur... | in contrast to the three other handleXXX methods, this one includes nodes | [
"in",
"contrast",
"to",
"the",
"three",
"other",
"handleXXX",
"methods",
"this",
"one",
"includes",
"nodes"
] | d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9 | https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/org/spockframework/runtime/extension/builtin/IncludeExcludeExtension.java#L58-L64 | train |
spockframework/spock | spock-core/src/main/java/org/spockframework/compiler/SpecParser.java | SpecParser.visitField | @Override
public void visitField(FieldNode gField) {
PropertyNode owner = spec.getAst().getProperty(gField.getName());
if (gField.isStatic()) return;
Field field = new Field(spec, gField, fieldCount++);
field.setShared(AstUtil.hasAnnotation(gField, Shared.class));
field.setOwner(owner);
spec.... | java | @Override
public void visitField(FieldNode gField) {
PropertyNode owner = spec.getAst().getProperty(gField.getName());
if (gField.isStatic()) return;
Field field = new Field(spec, gField, fieldCount++);
field.setShared(AstUtil.hasAnnotation(gField, Shared.class));
field.setOwner(owner);
spec.... | [
"@",
"Override",
"public",
"void",
"visitField",
"(",
"FieldNode",
"gField",
")",
"{",
"PropertyNode",
"owner",
"=",
"spec",
".",
"getAst",
"(",
")",
".",
"getProperty",
"(",
"gField",
".",
"getName",
"(",
")",
")",
";",
"if",
"(",
"gField",
".",
"isSt... | although it IS related to a user-provided definition | [
"although",
"it",
"IS",
"related",
"to",
"a",
"user",
"-",
"provided",
"definition"
] | d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9 | https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/org/spockframework/compiler/SpecParser.java#L62-L71 | train |
spockframework/spock | spock-core/src/main/java/org/spockframework/compiler/SpecParser.java | SpecParser.constructorMayHaveBeenAddedByCompiler | private boolean constructorMayHaveBeenAddedByCompiler(ConstructorNode constructor) {
Parameter[] params = constructor.getParameters();
Statement firstStat = constructor.getFirstStatement();
return AstUtil.isJointCompiled(spec.getAst()) && constructor.isPublic()
&& params != null && params.length == 0 ... | java | private boolean constructorMayHaveBeenAddedByCompiler(ConstructorNode constructor) {
Parameter[] params = constructor.getParameters();
Statement firstStat = constructor.getFirstStatement();
return AstUtil.isJointCompiled(spec.getAst()) && constructor.isPublic()
&& params != null && params.length == 0 ... | [
"private",
"boolean",
"constructorMayHaveBeenAddedByCompiler",
"(",
"ConstructorNode",
"constructor",
")",
"{",
"Parameter",
"[",
"]",
"params",
"=",
"constructor",
".",
"getParameters",
"(",
")",
";",
"Statement",
"firstStat",
"=",
"constructor",
".",
"getFirstStatem... | to add special logic to detect this case. | [
"to",
"add",
"special",
"logic",
"to",
"detect",
"this",
"case",
"."
] | d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9 | https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/org/spockframework/compiler/SpecParser.java#L89-L94 | train |
spockframework/spock | spock-core/src/main/java/org/spockframework/compiler/InteractionRewriter.java | InteractionRewriter.rewrite | @Nullable
public ExpressionStatement rewrite(ExpressionStatement stat) {
try {
if (!isInteraction(stat)) return null;
createBuilder();
setCount();
setCall();
addResponses();
build();
return register();
} catch (InvalidSpecCompileException e) {
resources.getErro... | java | @Nullable
public ExpressionStatement rewrite(ExpressionStatement stat) {
try {
if (!isInteraction(stat)) return null;
createBuilder();
setCount();
setCall();
addResponses();
build();
return register();
} catch (InvalidSpecCompileException e) {
resources.getErro... | [
"@",
"Nullable",
"public",
"ExpressionStatement",
"rewrite",
"(",
"ExpressionStatement",
"stat",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"isInteraction",
"(",
"stat",
")",
")",
"return",
"null",
";",
"createBuilder",
"(",
")",
";",
"setCount",
"(",
")",
";",... | If the given statement is a valid interaction definition, returns the rewritten statement.
If the given statement is not an interaction definition, returns null.
If the given statement is an invalid interaction definition, records a compile error
and returns null. | [
"If",
"the",
"given",
"statement",
"is",
"a",
"valid",
"interaction",
"definition",
"returns",
"the",
"rewritten",
"statement",
".",
"If",
"the",
"given",
"statement",
"is",
"not",
"an",
"interaction",
"definition",
"returns",
"null",
".",
"If",
"the",
"given"... | d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9 | https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/org/spockframework/compiler/InteractionRewriter.java#L62-L77 | train |
spockframework/spock | spock-core/src/main/java/org/spockframework/mock/EmptyOrDummyResponse.java | EmptyOrDummyResponse.createEmptyWrapper | private Object createEmptyWrapper(Class<?> type) {
if (Number.class.isAssignableFrom(type)) {
Method method = ReflectionUtil.getDeclaredMethodBySignature(type, "valueOf", String.class);
if (method != null && method.getReturnType() == type) {
return ReflectionUtil.invokeMethod(type, method, "0");... | java | private Object createEmptyWrapper(Class<?> type) {
if (Number.class.isAssignableFrom(type)) {
Method method = ReflectionUtil.getDeclaredMethodBySignature(type, "valueOf", String.class);
if (method != null && method.getReturnType() == type) {
return ReflectionUtil.invokeMethod(type, method, "0");... | [
"private",
"Object",
"createEmptyWrapper",
"(",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"if",
"(",
"Number",
".",
"class",
".",
"isAssignableFrom",
"(",
"type",
")",
")",
"{",
"Method",
"method",
"=",
"ReflectionUtil",
".",
"getDeclaredMethodBySignature",
... | also handles some numeric types which aren't primitive wrapper types | [
"also",
"handles",
"some",
"numeric",
"types",
"which",
"aren",
"t",
"primitive",
"wrapper",
"types"
] | d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9 | https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/org/spockframework/mock/EmptyOrDummyResponse.java#L129-L142 | train |
spockframework/spock | spock-core/src/main/java/spock/util/concurrent/AsyncConditions.java | AsyncConditions.await | @Deprecated
public void await(int value, TimeUnit unit) throws Throwable {
await(TimeUtil.toSeconds(value, unit));
} | java | @Deprecated
public void await(int value, TimeUnit unit) throws Throwable {
await(TimeUtil.toSeconds(value, unit));
} | [
"@",
"Deprecated",
"public",
"void",
"await",
"(",
"int",
"value",
",",
"TimeUnit",
"unit",
")",
"throws",
"Throwable",
"{",
"await",
"(",
"TimeUtil",
".",
"toSeconds",
"(",
"value",
",",
"unit",
")",
")",
";",
"}"
] | Waits until all evaluate blocks have completed or the specified timeout
expires. If one of the evaluate blocks throws an exception, it is rethrown
from this method.
@throws InterruptedException if the calling thread is interrupted
@throws Throwable the first exception thrown by an evaluate block
@deprecated use {@li... | [
"Waits",
"until",
"all",
"evaluate",
"blocks",
"have",
"completed",
"or",
"the",
"specified",
"timeout",
"expires",
".",
"If",
"one",
"of",
"the",
"evaluate",
"blocks",
"throws",
"an",
"exception",
"it",
"is",
"rethrown",
"from",
"this",
"method",
"."
] | d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9 | https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/spock/util/concurrent/AsyncConditions.java#L158-L161 | train |
spockframework/spock | spock-core/src/main/java/org/spockframework/runtime/RunContext.java | RunContext.createBottomContext | private static RunContext createBottomContext() {
File spockUserHome = SpockUserHomeUtil.getSpockUserHome();
DelegatingScript script = new ConfigurationScriptLoader(spockUserHome).loadAutoDetectedScript();
List<Class<?>> classes = new ExtensionClassesLoader().loadClassesFromDefaultLocation();
return new... | java | private static RunContext createBottomContext() {
File spockUserHome = SpockUserHomeUtil.getSpockUserHome();
DelegatingScript script = new ConfigurationScriptLoader(spockUserHome).loadAutoDetectedScript();
List<Class<?>> classes = new ExtensionClassesLoader().loadClassesFromDefaultLocation();
return new... | [
"private",
"static",
"RunContext",
"createBottomContext",
"(",
")",
"{",
"File",
"spockUserHome",
"=",
"SpockUserHomeUtil",
".",
"getSpockUserHome",
"(",
")",
";",
"DelegatingScript",
"script",
"=",
"new",
"ConfigurationScriptLoader",
"(",
"spockUserHome",
")",
".",
... | this shouldn't be much of a problem in practice. | [
"this",
"shouldn",
"t",
"be",
"much",
"of",
"a",
"problem",
"in",
"practice",
"."
] | d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9 | https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/org/spockframework/runtime/RunContext.java#L182-L187 | train |
spockframework/spock | spock-core/src/main/java/org/spockframework/util/IoUtil.java | IoUtil.closeQuietly | public static void closeQuietly(@Nullable final Socket... sockets) {
if (sockets == null) return;
for (Socket socket : sockets) {
if (socket == null) return;
try {
socket.close();
} catch (IOException ignored) {}
}
} | java | public static void closeQuietly(@Nullable final Socket... sockets) {
if (sockets == null) return;
for (Socket socket : sockets) {
if (socket == null) return;
try {
socket.close();
} catch (IOException ignored) {}
}
} | [
"public",
"static",
"void",
"closeQuietly",
"(",
"@",
"Nullable",
"final",
"Socket",
"...",
"sockets",
")",
"{",
"if",
"(",
"sockets",
"==",
"null",
")",
"return",
";",
"for",
"(",
"Socket",
"socket",
":",
"sockets",
")",
"{",
"if",
"(",
"socket",
"=="... | In JDK 1.6, java.net.Socket doesn't implement Closeable, so we have this overload. | [
"In",
"JDK",
"1",
".",
"6",
"java",
".",
"net",
".",
"Socket",
"doesn",
"t",
"implement",
"Closeable",
"so",
"we",
"have",
"this",
"overload",
"."
] | d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9 | https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/org/spockframework/util/IoUtil.java#L35-L45 | train |
spockframework/spock | spock-core/src/main/java/org/spockframework/util/IoUtil.java | IoUtil.getText | public static String getText(Reader reader) throws IOException {
try {
StringBuilder source = new StringBuilder();
BufferedReader buffered = new BufferedReader(reader);
String line = buffered.readLine();
while (line != null) {
source.append(line);
source.append('\n');
... | java | public static String getText(Reader reader) throws IOException {
try {
StringBuilder source = new StringBuilder();
BufferedReader buffered = new BufferedReader(reader);
String line = buffered.readLine();
while (line != null) {
source.append(line);
source.append('\n');
... | [
"public",
"static",
"String",
"getText",
"(",
"Reader",
"reader",
")",
"throws",
"IOException",
"{",
"try",
"{",
"StringBuilder",
"source",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"BufferedReader",
"buffered",
"=",
"new",
"BufferedReader",
"(",
"reader",
"... | Returns the text read from the given reader as a String.
Closes the given reader upon return. | [
"Returns",
"the",
"text",
"read",
"from",
"the",
"given",
"reader",
"as",
"a",
"String",
".",
"Closes",
"the",
"given",
"reader",
"upon",
"return",
"."
] | d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9 | https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/org/spockframework/util/IoUtil.java#L63-L79 | train |
spockframework/spock | spock-core/src/main/java/spock/util/environment/OperatingSystem.java | OperatingSystem.getCurrent | public static OperatingSystem getCurrent() {
String name = System.getProperty("os.name");
String version = System.getProperty("os.version");
String lowerName = name.toLowerCase();
if (lowerName.contains("linux")) return new OperatingSystem(name, version, Family.LINUX);
if (lowerName.contains("mac os... | java | public static OperatingSystem getCurrent() {
String name = System.getProperty("os.name");
String version = System.getProperty("os.version");
String lowerName = name.toLowerCase();
if (lowerName.contains("linux")) return new OperatingSystem(name, version, Family.LINUX);
if (lowerName.contains("mac os... | [
"public",
"static",
"OperatingSystem",
"getCurrent",
"(",
")",
"{",
"String",
"name",
"=",
"System",
".",
"getProperty",
"(",
"\"os.name\"",
")",
";",
"String",
"version",
"=",
"System",
".",
"getProperty",
"(",
"\"os.version\"",
")",
";",
"String",
"lowerName... | Returns the current operating system.
@return the current operating system | [
"Returns",
"the",
"current",
"operating",
"system",
"."
] | d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9 | https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/spock/util/environment/OperatingSystem.java#L140-L149 | train |
spockframework/spock | spock-core/src/main/java/org/spockframework/compiler/DeepBlockRewriter.java | DeepBlockRewriter.forbidUseOfSuperInFixtureMethod | private boolean forbidUseOfSuperInFixtureMethod(MethodCallExpression expr) {
Method currMethod = resources.getCurrentMethod();
Expression target = expr.getObjectExpression();
if (currMethod instanceof FixtureMethod
&& target instanceof VariableExpression
&& ((VariableExpression)target).isSu... | java | private boolean forbidUseOfSuperInFixtureMethod(MethodCallExpression expr) {
Method currMethod = resources.getCurrentMethod();
Expression target = expr.getObjectExpression();
if (currMethod instanceof FixtureMethod
&& target instanceof VariableExpression
&& ((VariableExpression)target).isSu... | [
"private",
"boolean",
"forbidUseOfSuperInFixtureMethod",
"(",
"MethodCallExpression",
"expr",
")",
"{",
"Method",
"currMethod",
"=",
"resources",
".",
"getCurrentMethod",
"(",
")",
";",
"Expression",
"target",
"=",
"expr",
".",
"getObjectExpression",
"(",
")",
";",
... | the base method and doesn't know that it will be run automatically) | [
"the",
"base",
"method",
"and",
"doesn",
"t",
"know",
"that",
"it",
"will",
"be",
"run",
"automatically",
")"
] | d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9 | https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/org/spockframework/compiler/DeepBlockRewriter.java#L300-L315 | train |
spockframework/spock | spock-core/src/main/groovy/spock/util/Exceptions.java | Exceptions.getRootCause | public static Throwable getRootCause(Throwable exception) {
Assert.notNull(exception);
return exception.getCause() == null ? exception : getRootCause(exception.getCause());
} | java | public static Throwable getRootCause(Throwable exception) {
Assert.notNull(exception);
return exception.getCause() == null ? exception : getRootCause(exception.getCause());
} | [
"public",
"static",
"Throwable",
"getRootCause",
"(",
"Throwable",
"exception",
")",
"{",
"Assert",
".",
"notNull",
"(",
"exception",
")",
";",
"return",
"exception",
".",
"getCause",
"(",
")",
"==",
"null",
"?",
"exception",
":",
"getRootCause",
"(",
"excep... | Returns the innermost cause of the specified exception. If the specified exception
has no cause, the exception itself is returned.
@param exception an exception
@return the root cause of the exception | [
"Returns",
"the",
"innermost",
"cause",
"of",
"the",
"specified",
"exception",
".",
"If",
"the",
"specified",
"exception",
"has",
"no",
"cause",
"the",
"exception",
"itself",
"is",
"returned",
"."
] | d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9 | https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/groovy/spock/util/Exceptions.java#L29-L32 | train |
spockframework/spock | spock-core/src/main/groovy/spock/util/Exceptions.java | Exceptions.getCauseChain | public static List<Throwable> getCauseChain(Throwable exception) {
Assert.notNull(exception);
List<Throwable> result = new ArrayList<>();
collectCauseChain(exception, result);
return result;
} | java | public static List<Throwable> getCauseChain(Throwable exception) {
Assert.notNull(exception);
List<Throwable> result = new ArrayList<>();
collectCauseChain(exception, result);
return result;
} | [
"public",
"static",
"List",
"<",
"Throwable",
">",
"getCauseChain",
"(",
"Throwable",
"exception",
")",
"{",
"Assert",
".",
"notNull",
"(",
"exception",
")",
";",
"List",
"<",
"Throwable",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"col... | Returns a list of all causes of the specified exception. The first element of the
returned list is the specified exception itself; the last element is its root cause.
@param exception an exception
@return the exception's cause chain | [
"Returns",
"a",
"list",
"of",
"all",
"causes",
"of",
"the",
"specified",
"exception",
".",
"The",
"first",
"element",
"of",
"the",
"returned",
"list",
"is",
"the",
"specified",
"exception",
"itself",
";",
"the",
"last",
"element",
"is",
"its",
"root",
"cau... | d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9 | https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/groovy/spock/util/Exceptions.java#L42-L47 | train |
spockframework/spock | spock-core/src/main/java/org/spockframework/gentyref/GenericTypeReflector.java | GenericTypeReflector.getArrayComponentType | public static Type getArrayComponentType(Type type) {
if (type instanceof Class) {
Class<?> clazz = (Class<?>)type;
return clazz.getComponentType();
} else if (type instanceof GenericArrayType) {
GenericArrayType aType = (GenericArrayType) type;
return aType.getGenericComponentType();
} else {
retu... | java | public static Type getArrayComponentType(Type type) {
if (type instanceof Class) {
Class<?> clazz = (Class<?>)type;
return clazz.getComponentType();
} else if (type instanceof GenericArrayType) {
GenericArrayType aType = (GenericArrayType) type;
return aType.getGenericComponentType();
} else {
retu... | [
"public",
"static",
"Type",
"getArrayComponentType",
"(",
"Type",
"type",
")",
"{",
"if",
"(",
"type",
"instanceof",
"Class",
")",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"(",
"Class",
"<",
"?",
">",
")",
"type",
";",
"return",
"clazz",
".",
"getC... | If type is an array type, returns the type of the component of the array.
Otherwise, returns null. | [
"If",
"type",
"is",
"an",
"array",
"type",
"returns",
"the",
"type",
"of",
"the",
"component",
"of",
"the",
"array",
".",
"Otherwise",
"returns",
"null",
"."
] | d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9 | https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/org/spockframework/gentyref/GenericTypeReflector.java#L221-L231 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.