id int32 0 165k | 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
130,100 | micronaut-projects/micronaut-core | discovery-client/src/main/java/io/micronaut/discovery/aws/route53/registration/Route53AutoNamingRegistrationClient.java | Route53AutoNamingRegistrationClient.deleteService | public void deleteService(String serviceId) {
DeleteServiceRequest deleteServiceRequest = new DeleteServiceRequest().withId(serviceId);
getDiscoveryClient().deleteService(deleteServiceRequest);
} | java | public void deleteService(String serviceId) {
DeleteServiceRequest deleteServiceRequest = new DeleteServiceRequest().withId(serviceId);
getDiscoveryClient().deleteService(deleteServiceRequest);
} | [
"public",
"void",
"deleteService",
"(",
"String",
"serviceId",
")",
"{",
"DeleteServiceRequest",
"deleteServiceRequest",
"=",
"new",
"DeleteServiceRequest",
"(",
")",
".",
"withId",
"(",
"serviceId",
")",
";",
"getDiscoveryClient",
"(",
")",
".",
"deleteService",
... | These are convenience methods to help cleanup things like integration test data.
@param serviceId service id from AWS to delete | [
"These",
"are",
"convenience",
"methods",
"to",
"help",
"cleanup",
"things",
"like",
"integration",
"test",
"data",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/discovery-client/src/main/java/io/micronaut/discovery/aws/route53/registration/Route53AutoNamingRegistrationClient.java#L311-L316 |
130,101 | micronaut-projects/micronaut-core | discovery-client/src/main/java/io/micronaut/discovery/aws/route53/registration/Route53AutoNamingRegistrationClient.java | Route53AutoNamingRegistrationClient.deleteNamespace | public void deleteNamespace(String namespaceId) {
DeleteNamespaceRequest deleteNamespaceRequest = new DeleteNamespaceRequest().withId(namespaceId);
getDiscoveryClient().deleteNamespace(deleteNamespaceRequest);
} | java | public void deleteNamespace(String namespaceId) {
DeleteNamespaceRequest deleteNamespaceRequest = new DeleteNamespaceRequest().withId(namespaceId);
getDiscoveryClient().deleteNamespace(deleteNamespaceRequest);
} | [
"public",
"void",
"deleteNamespace",
"(",
"String",
"namespaceId",
")",
"{",
"DeleteNamespaceRequest",
"deleteNamespaceRequest",
"=",
"new",
"DeleteNamespaceRequest",
"(",
")",
".",
"withId",
"(",
"namespaceId",
")",
";",
"getDiscoveryClient",
"(",
")",
".",
"delete... | these are convenience methods to help cleanup things like integration test data.
@param namespaceId namespace ID from AWS to delete | [
"these",
"are",
"convenience",
"methods",
"to",
"help",
"cleanup",
"things",
"like",
"integration",
"test",
"data",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/discovery-client/src/main/java/io/micronaut/discovery/aws/route53/registration/Route53AutoNamingRegistrationClient.java#L323-L328 |
130,102 | micronaut-projects/micronaut-core | discovery-client/src/main/java/io/micronaut/discovery/aws/route53/registration/Route53AutoNamingRegistrationClient.java | Route53AutoNamingRegistrationClient.createService | public String createService(AWSServiceDiscovery serviceDiscovery, String name, String description, String namespaceId, Long ttl) {
if (serviceDiscovery == null) {
serviceDiscovery = AWSServiceDiscoveryClient.builder().withClientConfiguration(clientConfiguration.getClientConfiguration()).build();
... | java | public String createService(AWSServiceDiscovery serviceDiscovery, String name, String description, String namespaceId, Long ttl) {
if (serviceDiscovery == null) {
serviceDiscovery = AWSServiceDiscoveryClient.builder().withClientConfiguration(clientConfiguration.getClientConfiguration()).build();
... | [
"public",
"String",
"createService",
"(",
"AWSServiceDiscovery",
"serviceDiscovery",
",",
"String",
"name",
",",
"String",
"description",
",",
"String",
"namespaceId",
",",
"Long",
"ttl",
")",
"{",
"if",
"(",
"serviceDiscovery",
"==",
"null",
")",
"{",
"serviceD... | Create service, helper for integration tests.
@param serviceDiscovery service discovery instance
@param name name of the service
@param description description of the service
@param namespaceId namespaceId to attach it to (get via cli or api call)
@param ttl time to live for checking pulse
@return serviceId | [
"Create",
"service",
"helper",
"for",
"integration",
"tests",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/discovery-client/src/main/java/io/micronaut/discovery/aws/route53/registration/Route53AutoNamingRegistrationClient.java#L359-L371 |
130,103 | micronaut-projects/micronaut-core | discovery-client/src/main/java/io/micronaut/discovery/aws/route53/registration/Route53AutoNamingRegistrationClient.java | Route53AutoNamingRegistrationClient.checkOperation | private GetOperationResult checkOperation(String operationId) {
String result = "";
GetOperationResult opResult = null;
try {
while (!result.equals("SUCCESS") && !result.equals("FAIL")) {
opResult = getDiscoveryClient().getOperation(new GetOperationRequest().withOpera... | java | private GetOperationResult checkOperation(String operationId) {
String result = "";
GetOperationResult opResult = null;
try {
while (!result.equals("SUCCESS") && !result.equals("FAIL")) {
opResult = getDiscoveryClient().getOperation(new GetOperationRequest().withOpera... | [
"private",
"GetOperationResult",
"checkOperation",
"(",
"String",
"operationId",
")",
"{",
"String",
"result",
"=",
"\"\"",
";",
"GetOperationResult",
"opResult",
"=",
"null",
";",
"try",
"{",
"while",
"(",
"!",
"result",
".",
"equals",
"(",
"\"SUCCESS\"",
")"... | Loop for checking of the call to aws is complete or not. This is the non-async version used for testing
@param operationId operation ID we are polling for
@return result of the operation, can be success or failure or ongoing | [
"Loop",
"for",
"checking",
"of",
"the",
"call",
"to",
"aws",
"is",
"complete",
"or",
"not",
".",
"This",
"is",
"the",
"non",
"-",
"async",
"version",
"used",
"for",
"testing"
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/discovery-client/src/main/java/io/micronaut/discovery/aws/route53/registration/Route53AutoNamingRegistrationClient.java#L378-L401 |
130,104 | micronaut-projects/micronaut-core | runtime/src/main/java/io/micronaut/jackson/JacksonConfiguration.java | JacksonConfiguration.setSerialization | public void setSerialization(Map<SerializationFeature, Boolean> serialization) {
if (CollectionUtils.isNotEmpty(serialization)) {
this.serialization = serialization;
}
} | java | public void setSerialization(Map<SerializationFeature, Boolean> serialization) {
if (CollectionUtils.isNotEmpty(serialization)) {
this.serialization = serialization;
}
} | [
"public",
"void",
"setSerialization",
"(",
"Map",
"<",
"SerializationFeature",
",",
"Boolean",
">",
"serialization",
")",
"{",
"if",
"(",
"CollectionUtils",
".",
"isNotEmpty",
"(",
"serialization",
")",
")",
"{",
"this",
".",
"serialization",
"=",
"serialization... | Sets the serialization features to use.
@param serialization The serialization features. | [
"Sets",
"the",
"serialization",
"features",
"to",
"use",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/jackson/JacksonConfiguration.java#L235-L239 |
130,105 | micronaut-projects/micronaut-core | runtime/src/main/java/io/micronaut/jackson/JacksonConfiguration.java | JacksonConfiguration.setDeserialization | public void setDeserialization(Map<DeserializationFeature, Boolean> deserialization) {
if (CollectionUtils.isNotEmpty(deserialization)) {
this.deserialization = deserialization;
}
} | java | public void setDeserialization(Map<DeserializationFeature, Boolean> deserialization) {
if (CollectionUtils.isNotEmpty(deserialization)) {
this.deserialization = deserialization;
}
} | [
"public",
"void",
"setDeserialization",
"(",
"Map",
"<",
"DeserializationFeature",
",",
"Boolean",
">",
"deserialization",
")",
"{",
"if",
"(",
"CollectionUtils",
".",
"isNotEmpty",
"(",
"deserialization",
")",
")",
"{",
"this",
".",
"deserialization",
"=",
"des... | Sets the deserialization features to use.
@param deserialization The deserialiation features. | [
"Sets",
"the",
"deserialization",
"features",
"to",
"use",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/jackson/JacksonConfiguration.java#L245-L249 |
130,106 | micronaut-projects/micronaut-core | runtime/src/main/java/io/micronaut/jackson/JacksonConfiguration.java | JacksonConfiguration.setMapper | public void setMapper(Map<MapperFeature, Boolean> mapper) {
if (CollectionUtils.isNotEmpty(mapper)) {
this.mapper = mapper;
}
} | java | public void setMapper(Map<MapperFeature, Boolean> mapper) {
if (CollectionUtils.isNotEmpty(mapper)) {
this.mapper = mapper;
}
} | [
"public",
"void",
"setMapper",
"(",
"Map",
"<",
"MapperFeature",
",",
"Boolean",
">",
"mapper",
")",
"{",
"if",
"(",
"CollectionUtils",
".",
"isNotEmpty",
"(",
"mapper",
")",
")",
"{",
"this",
".",
"mapper",
"=",
"mapper",
";",
"}",
"}"
] | Sets the object mapper features to use.
@param mapper The object mapper features | [
"Sets",
"the",
"object",
"mapper",
"features",
"to",
"use",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/jackson/JacksonConfiguration.java#L255-L259 |
130,107 | micronaut-projects/micronaut-core | runtime/src/main/java/io/micronaut/jackson/JacksonConfiguration.java | JacksonConfiguration.setParser | public void setParser(Map<JsonParser.Feature, Boolean> parser) {
if (CollectionUtils.isNotEmpty(parser)) {
this.parser = parser;
}
} | java | public void setParser(Map<JsonParser.Feature, Boolean> parser) {
if (CollectionUtils.isNotEmpty(parser)) {
this.parser = parser;
}
} | [
"public",
"void",
"setParser",
"(",
"Map",
"<",
"JsonParser",
".",
"Feature",
",",
"Boolean",
">",
"parser",
")",
"{",
"if",
"(",
"CollectionUtils",
".",
"isNotEmpty",
"(",
"parser",
")",
")",
"{",
"this",
".",
"parser",
"=",
"parser",
";",
"}",
"}"
] | Sets the parser features to use.
@param parser The parser features | [
"Sets",
"the",
"parser",
"features",
"to",
"use",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/jackson/JacksonConfiguration.java#L265-L269 |
130,108 | micronaut-projects/micronaut-core | runtime/src/main/java/io/micronaut/jackson/JacksonConfiguration.java | JacksonConfiguration.setGenerator | public void setGenerator(Map<JsonGenerator.Feature, Boolean> generator) {
if (CollectionUtils.isNotEmpty(generator)) {
this.generator = generator;
}
} | java | public void setGenerator(Map<JsonGenerator.Feature, Boolean> generator) {
if (CollectionUtils.isNotEmpty(generator)) {
this.generator = generator;
}
} | [
"public",
"void",
"setGenerator",
"(",
"Map",
"<",
"JsonGenerator",
".",
"Feature",
",",
"Boolean",
">",
"generator",
")",
"{",
"if",
"(",
"CollectionUtils",
".",
"isNotEmpty",
"(",
"generator",
")",
")",
"{",
"this",
".",
"generator",
"=",
"generator",
";... | Sets the generator features to use.
@param generator The generator features | [
"Sets",
"the",
"generator",
"features",
"to",
"use",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/jackson/JacksonConfiguration.java#L275-L279 |
130,109 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java | AbstractBeanDefinition.warnMissingProperty | @SuppressWarnings("unused")
@Internal
protected final void warnMissingProperty(Class type, String method, String property) {
if (LOG.isWarnEnabled()) {
LOG.warn("Configuration property [{}] could not be set as the underlying method [{}] does not exist on builder [{}]. This usually indicates ... | java | @SuppressWarnings("unused")
@Internal
protected final void warnMissingProperty(Class type, String method, String property) {
if (LOG.isWarnEnabled()) {
LOG.warn("Configuration property [{}] could not be set as the underlying method [{}] does not exist on builder [{}]. This usually indicates ... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"@",
"Internal",
"protected",
"final",
"void",
"warnMissingProperty",
"(",
"Class",
"type",
",",
"String",
"method",
",",
"String",
"property",
")",
"{",
"if",
"(",
"LOG",
".",
"isWarnEnabled",
"(",
")",
")",
... | Allows printing warning messages produced by the compiler.
@param type The type
@param method The method
@param property The property | [
"Allows",
"printing",
"warning",
"messages",
"produced",
"by",
"the",
"compiler",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java#L417-L423 |
130,110 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java | AbstractBeanDefinition.getProxiedBean | @SuppressWarnings({"unchecked", "unused"})
@Internal
protected final Object getProxiedBean(BeanContext beanContext) {
DefaultBeanContext defaultBeanContext = (DefaultBeanContext) beanContext;
Optional<String> qualifier = getAnnotationMetadata().getAnnotationNameByStereotype(javax.inject.Qualifie... | java | @SuppressWarnings({"unchecked", "unused"})
@Internal
protected final Object getProxiedBean(BeanContext beanContext) {
DefaultBeanContext defaultBeanContext = (DefaultBeanContext) beanContext;
Optional<String> qualifier = getAnnotationMetadata().getAnnotationNameByStereotype(javax.inject.Qualifie... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"unused\"",
"}",
")",
"@",
"Internal",
"protected",
"final",
"Object",
"getProxiedBean",
"(",
"BeanContext",
"beanContext",
")",
"{",
"DefaultBeanContext",
"defaultBeanContext",
"=",
"(",
"DefaultBeanContext",... | Resolves the proxied bean instance for this bean.
@param beanContext The {@link BeanContext}
@return The proxied bean | [
"Resolves",
"the",
"proxied",
"bean",
"instance",
"for",
"this",
"bean",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java#L431-L437 |
130,111 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java | AbstractBeanDefinition.addPreDestroy | @SuppressWarnings("unused")
@Internal
@UsedByGeneratedCode
protected final AbstractBeanDefinition addPreDestroy(Class declaringType,
String method,
Argument[] arguments,
... | java | @SuppressWarnings("unused")
@Internal
@UsedByGeneratedCode
protected final AbstractBeanDefinition addPreDestroy(Class declaringType,
String method,
Argument[] arguments,
... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"@",
"Internal",
"@",
"UsedByGeneratedCode",
"protected",
"final",
"AbstractBeanDefinition",
"addPreDestroy",
"(",
"Class",
"declaringType",
",",
"String",
"method",
",",
"Argument",
"[",
"]",
"arguments",
",",
"Annot... | Adds a pre destroy method definition.
@param declaringType The declaring type
@param method The method
@param arguments The arguments
@param annotationMetadata The annotation metadata
@param requiresReflection Whether the method requires reflection
@return This bean definition | [
"Adds",
"a",
"pre",
"destroy",
"method",
"definition",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java#L563-L572 |
130,112 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java | AbstractBeanDefinition.injectBean | @Internal
@SuppressWarnings({"WeakerAccess", "unused"})
@UsedByGeneratedCode
protected Object injectBean(BeanResolutionContext resolutionContext, BeanContext context, Object bean) {
return bean;
} | java | @Internal
@SuppressWarnings({"WeakerAccess", "unused"})
@UsedByGeneratedCode
protected Object injectBean(BeanResolutionContext resolutionContext, BeanContext context, Object bean) {
return bean;
} | [
"@",
"Internal",
"@",
"SuppressWarnings",
"(",
"{",
"\"WeakerAccess\"",
",",
"\"unused\"",
"}",
")",
"@",
"UsedByGeneratedCode",
"protected",
"Object",
"injectBean",
"(",
"BeanResolutionContext",
"resolutionContext",
",",
"BeanContext",
"context",
",",
"Object",
"bean... | The default implementation which provides no injection. To be overridden by compile time tooling.
@param resolutionContext The resolution context
@param context The bean context
@param bean The bean
@return The injected bean | [
"The",
"default",
"implementation",
"which",
"provides",
"no",
"injection",
".",
"To",
"be",
"overridden",
"by",
"compile",
"time",
"tooling",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java#L582-L587 |
130,113 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java | AbstractBeanDefinition.injectAnother | @Internal
@SuppressWarnings({"WeakerAccess", "unused"})
@UsedByGeneratedCode
protected Object injectAnother(BeanResolutionContext resolutionContext, BeanContext context, Object bean) {
DefaultBeanContext defaultContext = (DefaultBeanContext) context;
if (bean == null) {
throw new... | java | @Internal
@SuppressWarnings({"WeakerAccess", "unused"})
@UsedByGeneratedCode
protected Object injectAnother(BeanResolutionContext resolutionContext, BeanContext context, Object bean) {
DefaultBeanContext defaultContext = (DefaultBeanContext) context;
if (bean == null) {
throw new... | [
"@",
"Internal",
"@",
"SuppressWarnings",
"(",
"{",
"\"WeakerAccess\"",
",",
"\"unused\"",
"}",
")",
"@",
"UsedByGeneratedCode",
"protected",
"Object",
"injectAnother",
"(",
"BeanResolutionContext",
"resolutionContext",
",",
"BeanContext",
"context",
",",
"Object",
"b... | Inject another bean, for example one created via factory.
@param resolutionContext The reslution context
@param context The context
@param bean The bean
@return The bean | [
"Inject",
"another",
"bean",
"for",
"example",
"one",
"created",
"via",
"factory",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java#L597-L606 |
130,114 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java | AbstractBeanDefinition.postConstruct | @SuppressWarnings({"WeakerAccess", "unused", "unchecked"})
@Internal
@UsedByGeneratedCode
protected Object postConstruct(BeanResolutionContext resolutionContext, BeanContext context, Object bean) {
DefaultBeanContext defaultContext = (DefaultBeanContext) context;
Collection<BeanRegistration<... | java | @SuppressWarnings({"WeakerAccess", "unused", "unchecked"})
@Internal
@UsedByGeneratedCode
protected Object postConstruct(BeanResolutionContext resolutionContext, BeanContext context, Object bean) {
DefaultBeanContext defaultContext = (DefaultBeanContext) context;
Collection<BeanRegistration<... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"WeakerAccess\"",
",",
"\"unused\"",
",",
"\"unchecked\"",
"}",
")",
"@",
"Internal",
"@",
"UsedByGeneratedCode",
"protected",
"Object",
"postConstruct",
"(",
"BeanResolutionContext",
"resolutionContext",
",",
"BeanContext",
"context... | Default postConstruct hook that only invokes methods that require reflection. Generated subclasses should
override to call methods that don't require reflection.
@param resolutionContext The resolution hook
@param context The context
@param bean The bean
@return The bean | [
"Default",
"postConstruct",
"hook",
"that",
"only",
"invokes",
"methods",
"that",
"require",
"reflection",
".",
"Generated",
"subclasses",
"should",
"override",
"to",
"call",
"methods",
"that",
"don",
"t",
"require",
"reflection",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java#L617-L647 |
130,115 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java | AbstractBeanDefinition.preDestroy | @UsedByGeneratedCode
protected Object preDestroy(BeanResolutionContext resolutionContext, BeanContext context, Object bean) {
DefaultBeanContext defaultContext = (DefaultBeanContext) context;
for (int i = 0; i < methodInjectionPoints.size(); i++) {
MethodInjectionPoint methodInjectionPoi... | java | @UsedByGeneratedCode
protected Object preDestroy(BeanResolutionContext resolutionContext, BeanContext context, Object bean) {
DefaultBeanContext defaultContext = (DefaultBeanContext) context;
for (int i = 0; i < methodInjectionPoints.size(); i++) {
MethodInjectionPoint methodInjectionPoi... | [
"@",
"UsedByGeneratedCode",
"protected",
"Object",
"preDestroy",
"(",
"BeanResolutionContext",
"resolutionContext",
",",
"BeanContext",
"context",
",",
"Object",
"bean",
")",
"{",
"DefaultBeanContext",
"defaultContext",
"=",
"(",
"DefaultBeanContext",
")",
"context",
";... | Default preDestroy hook that only invokes methods that require reflection. Generated subclasses should override
to call methods that don't require reflection.
@param resolutionContext The resolution hook
@param context The context
@param bean The bean
@return The bean | [
"Default",
"preDestroy",
"hook",
"that",
"only",
"invokes",
"methods",
"that",
"require",
"reflection",
".",
"Generated",
"subclasses",
"should",
"override",
"to",
"call",
"methods",
"that",
"don",
"t",
"require",
"reflection",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java#L658-L672 |
130,116 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java | AbstractBeanDefinition.injectBeanMethod | @Internal
@SuppressWarnings("WeakerAccess")
protected void injectBeanMethod(BeanResolutionContext resolutionContext, DefaultBeanContext context, int methodIndex, Object bean) {
MethodInjectionPoint methodInjectionPoint = methodInjectionPoints.get(methodIndex);
Argument[] methodArgumentTypes = me... | java | @Internal
@SuppressWarnings("WeakerAccess")
protected void injectBeanMethod(BeanResolutionContext resolutionContext, DefaultBeanContext context, int methodIndex, Object bean) {
MethodInjectionPoint methodInjectionPoint = methodInjectionPoints.get(methodIndex);
Argument[] methodArgumentTypes = me... | [
"@",
"Internal",
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"protected",
"void",
"injectBeanMethod",
"(",
"BeanResolutionContext",
"resolutionContext",
",",
"DefaultBeanContext",
"context",
",",
"int",
"methodIndex",
",",
"Object",
"bean",
")",
"{",
"Metho... | Inject a bean method that requires reflection.
@param resolutionContext The resolution context
@param context The bean context
@param methodIndex The method index
@param bean The bean | [
"Inject",
"a",
"bean",
"method",
"that",
"requires",
"reflection",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java#L682-L696 |
130,117 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java | AbstractBeanDefinition.injectBeanField | @SuppressWarnings("unused")
@Internal
protected final void injectBeanField(BeanResolutionContext resolutionContext, DefaultBeanContext context, int index, Object bean) {
FieldInjectionPoint fieldInjectionPoint = fieldInjectionPoints.get(index);
boolean isInject = fieldInjectionPoint.getAnnotatio... | java | @SuppressWarnings("unused")
@Internal
protected final void injectBeanField(BeanResolutionContext resolutionContext, DefaultBeanContext context, int index, Object bean) {
FieldInjectionPoint fieldInjectionPoint = fieldInjectionPoints.get(index);
boolean isInject = fieldInjectionPoint.getAnnotatio... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"@",
"Internal",
"protected",
"final",
"void",
"injectBeanField",
"(",
"BeanResolutionContext",
"resolutionContext",
",",
"DefaultBeanContext",
"context",
",",
"int",
"index",
",",
"Object",
"bean",
")",
"{",
"FieldIn... | Injects the value of a field of a bean that requires reflection.
@param resolutionContext The resolution context
@param context The bean context
@param index The index of the field
@param bean The bean being injected | [
"Injects",
"the",
"value",
"of",
"a",
"field",
"of",
"a",
"bean",
"that",
"requires",
"reflection",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java#L706-L729 |
130,118 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java | AbstractBeanDefinition.getValueForPath | @SuppressWarnings("unused")
@Internal
@UsedByGeneratedCode
protected final <T1> Optional<T1> getValueForPath(
BeanResolutionContext resolutionContext,
BeanContext context,
Argument<T1> propertyType,
String... propertyPath) {
if (context instanceof Prop... | java | @SuppressWarnings("unused")
@Internal
@UsedByGeneratedCode
protected final <T1> Optional<T1> getValueForPath(
BeanResolutionContext resolutionContext,
BeanContext context,
Argument<T1> propertyType,
String... propertyPath) {
if (context instanceof Prop... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"@",
"Internal",
"@",
"UsedByGeneratedCode",
"protected",
"final",
"<",
"T1",
">",
"Optional",
"<",
"T1",
">",
"getValueForPath",
"(",
"BeanResolutionContext",
"resolutionContext",
",",
"BeanContext",
"context",
",",
... | Resolve a value for the given field of the given type and path.
@param resolutionContext The resolution context
@param context The bean context
@param propertyType The required property type
@param propertyPath The property path
@param <T1> The generic type
@return An optional value | [
"Resolve",
"a",
"value",
"for",
"the",
"given",
"field",
"of",
"the",
"given",
"type",
"and",
"path",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java#L1212-L1229 |
130,119 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java | AbstractBeanDefinition.containsValueForField | @Internal
@UsedByGeneratedCode
protected final boolean containsValueForField(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex) {
if (context instanceof ApplicationContext) {
FieldInjectionPoint injectionPoint = fieldInjectionPoints.get(fieldIndex);
fin... | java | @Internal
@UsedByGeneratedCode
protected final boolean containsValueForField(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex) {
if (context instanceof ApplicationContext) {
FieldInjectionPoint injectionPoint = fieldInjectionPoints.get(fieldIndex);
fin... | [
"@",
"Internal",
"@",
"UsedByGeneratedCode",
"protected",
"final",
"boolean",
"containsValueForField",
"(",
"BeanResolutionContext",
"resolutionContext",
",",
"BeanContext",
"context",
",",
"int",
"fieldIndex",
")",
"{",
"if",
"(",
"context",
"instanceof",
"ApplicationC... | Obtains a value for the given field argument.
@param resolutionContext The resolution context
@param context The bean context
@param fieldIndex The field index
@return True if it does | [
"Obtains",
"a",
"value",
"for",
"the",
"given",
"field",
"argument",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java#L1239-L1260 |
130,120 | micronaut-projects/micronaut-core | cli/src/main/groovy/io/micronaut/cli/io/support/PathMatchingResourcePatternResolver.java | PathMatchingResourcePatternResolver.findAllClassPathResources | @SuppressWarnings("MagicNumber")
protected Resource[] findAllClassPathResources(String location) throws IOException {
String path = location;
if (path.startsWith("/")) {
path = path.substring(1);
}
Enumeration<URL> resourceUrls = getClassLoader().getResources(path);
... | java | @SuppressWarnings("MagicNumber")
protected Resource[] findAllClassPathResources(String location) throws IOException {
String path = location;
if (path.startsWith("/")) {
path = path.substring(1);
}
Enumeration<URL> resourceUrls = getClassLoader().getResources(path);
... | [
"@",
"SuppressWarnings",
"(",
"\"MagicNumber\"",
")",
"protected",
"Resource",
"[",
"]",
"findAllClassPathResources",
"(",
"String",
"location",
")",
"throws",
"IOException",
"{",
"String",
"path",
"=",
"location",
";",
"if",
"(",
"path",
".",
"startsWith",
"(",... | Find all class location resources with the given location via the ClassLoader.
@param location the absolute path within the classpath
@return the result as Resource array
@throws IOException in case of I/O errors
@see java.lang.ClassLoader#getResources
@see #convertClassLoaderURL | [
"Find",
"all",
"class",
"location",
"resources",
"with",
"the",
"given",
"location",
"via",
"the",
"ClassLoader",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/io/support/PathMatchingResourcePatternResolver.java#L257-L270 |
130,121 | micronaut-projects/micronaut-core | cli/src/main/groovy/io/micronaut/cli/io/support/PathMatchingResourcePatternResolver.java | PathMatchingResourcePatternResolver.doFindPathMatchingJarResources | @SuppressWarnings("MagicNumber")
protected Set<Resource> doFindPathMatchingJarResources(Resource rootDirResource, String subPattern)
throws IOException {
URLConnection con = rootDirResource.getURL().openConnection();
JarFile jarFile;
String jarFileUrl;
String rootEntryPath;
... | java | @SuppressWarnings("MagicNumber")
protected Set<Resource> doFindPathMatchingJarResources(Resource rootDirResource, String subPattern)
throws IOException {
URLConnection con = rootDirResource.getURL().openConnection();
JarFile jarFile;
String jarFileUrl;
String rootEntryPath;
... | [
"@",
"SuppressWarnings",
"(",
"\"MagicNumber\"",
")",
"protected",
"Set",
"<",
"Resource",
">",
"doFindPathMatchingJarResources",
"(",
"Resource",
"rootDirResource",
",",
"String",
"subPattern",
")",
"throws",
"IOException",
"{",
"URLConnection",
"con",
"=",
"rootDirR... | Find all resources in jar files that match the given location pattern
via the Ant-style PathMatcher.
@param rootDirResource the root directory as Resource
@param subPattern the sub pattern to match (below the root directory)
@return the Set of matching Resource instances
@throws IOException in case of I/O errors
... | [
"Find",
"all",
"resources",
"in",
"jar",
"files",
"that",
"match",
"the",
"given",
"location",
"pattern",
"via",
"the",
"Ant",
"-",
"style",
"PathMatcher",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/io/support/PathMatchingResourcePatternResolver.java#L374-L436 |
130,122 | micronaut-projects/micronaut-core | cli/src/main/groovy/io/micronaut/cli/io/support/PathMatchingResourcePatternResolver.java | PathMatchingResourcePatternResolver.retrieveMatchingFiles | @SuppressWarnings("MagicNumber")
protected Set<File> retrieveMatchingFiles(File rootDir, String pattern) throws IOException {
if (!rootDir.exists()) {
// Silently skip non-existing directories.
return Collections.emptySet();
}
if (!rootDir.isDirectory()) {
... | java | @SuppressWarnings("MagicNumber")
protected Set<File> retrieveMatchingFiles(File rootDir, String pattern) throws IOException {
if (!rootDir.exists()) {
// Silently skip non-existing directories.
return Collections.emptySet();
}
if (!rootDir.isDirectory()) {
... | [
"@",
"SuppressWarnings",
"(",
"\"MagicNumber\"",
")",
"protected",
"Set",
"<",
"File",
">",
"retrieveMatchingFiles",
"(",
"File",
"rootDir",
",",
"String",
"pattern",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"rootDir",
".",
"exists",
"(",
")",
")",... | Retrieve files that match the given path pattern,
checking the given directory and its subdirectories.
@param rootDir the directory to start from
@param pattern the pattern to match against,
relative to the root directory
@return the Set of matching File instances
@throws IOException if directory contents could not be... | [
"Retrieve",
"files",
"that",
"match",
"the",
"given",
"path",
"pattern",
"checking",
"the",
"given",
"directory",
"and",
"its",
"subdirectories",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/io/support/PathMatchingResourcePatternResolver.java#L508-L529 |
130,123 | micronaut-projects/micronaut-core | cli/src/main/groovy/io/micronaut/cli/io/support/PathMatchingResourcePatternResolver.java | PathMatchingResourcePatternResolver.doRetrieveMatchingFiles | protected void doRetrieveMatchingFiles(String fullPattern, File dir, Set<File> result) throws IOException {
File[] dirContents = dir.listFiles();
if (dirContents == null) {
return;
}
for (File content : dirContents) {
String currPath = content.getAbsolutePath().re... | java | protected void doRetrieveMatchingFiles(String fullPattern, File dir, Set<File> result) throws IOException {
File[] dirContents = dir.listFiles();
if (dirContents == null) {
return;
}
for (File content : dirContents) {
String currPath = content.getAbsolutePath().re... | [
"protected",
"void",
"doRetrieveMatchingFiles",
"(",
"String",
"fullPattern",
",",
"File",
"dir",
",",
"Set",
"<",
"File",
">",
"result",
")",
"throws",
"IOException",
"{",
"File",
"[",
"]",
"dirContents",
"=",
"dir",
".",
"listFiles",
"(",
")",
";",
"if",... | Recursively retrieve files that match the given pattern,
adding them to the given result list.
@param fullPattern the pattern to match against,
with prepended root directory path
@param dir the current directory
@param result the Set of matching File instances to add to
@throws IOException if directory co... | [
"Recursively",
"retrieve",
"files",
"that",
"match",
"the",
"given",
"pattern",
"adding",
"them",
"to",
"the",
"given",
"result",
"list",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/io/support/PathMatchingResourcePatternResolver.java#L541-L557 |
130,124 | micronaut-projects/micronaut-core | http/src/main/java/io/micronaut/http/simple/cookies/SimpleCookies.java | SimpleCookies.put | public Cookie put(CharSequence name, Cookie cookie) {
return cookies.put(name, cookie);
} | java | public Cookie put(CharSequence name, Cookie cookie) {
return cookies.put(name, cookie);
} | [
"public",
"Cookie",
"put",
"(",
"CharSequence",
"name",
",",
"Cookie",
"cookie",
")",
"{",
"return",
"cookies",
".",
"put",
"(",
"name",
",",
"cookie",
")",
";",
"}"
] | Put a new cookie.
@param name the name of the cookie
@param cookie the cookie itself
@return previous value for given name | [
"Put",
"a",
"new",
"cookie",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http/src/main/java/io/micronaut/http/simple/cookies/SimpleCookies.java#L88-L90 |
130,125 | micronaut-projects/micronaut-core | runtime/src/main/java/io/micronaut/retry/intercept/SimpleRetry.java | SimpleRetry.canRetry | @Override
public boolean canRetry(Throwable exception) {
if (exception == null) {
return false;
}
Class<? extends Throwable> exceptionClass = exception.getClass();
if (hasIncludes && !includes.contains(exceptionClass)) {
return false;
} else if (hasEx... | java | @Override
public boolean canRetry(Throwable exception) {
if (exception == null) {
return false;
}
Class<? extends Throwable> exceptionClass = exception.getClass();
if (hasIncludes && !includes.contains(exceptionClass)) {
return false;
} else if (hasEx... | [
"@",
"Override",
"public",
"boolean",
"canRetry",
"(",
"Throwable",
"exception",
")",
"{",
"if",
"(",
"exception",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"Class",
"<",
"?",
"extends",
"Throwable",
">",
"exceptionClass",
"=",
"exception",
".",... | Should a retry attempt occur.
@return True if it should | [
"Should",
"a",
"retry",
"attempt",
"occur",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/retry/intercept/SimpleRetry.java#L98-L112 |
130,126 | NLPchina/elasticsearch-sql | src/main/java/org/nlpcn/es4sql/parse/FieldMaker.java | FieldMaker.makeBinaryMethodField | public static SQLMethodInvokeExpr makeBinaryMethodField(SQLBinaryOpExpr expr, String alias, boolean first) throws SqlParseException {
List<SQLExpr> params = new ArrayList<>();
String scriptFieldAlias;
if (first && (alias == null || alias.equals(""))) {
scriptFieldAlias = "field_" + ... | java | public static SQLMethodInvokeExpr makeBinaryMethodField(SQLBinaryOpExpr expr, String alias, boolean first) throws SqlParseException {
List<SQLExpr> params = new ArrayList<>();
String scriptFieldAlias;
if (first && (alias == null || alias.equals(""))) {
scriptFieldAlias = "field_" + ... | [
"public",
"static",
"SQLMethodInvokeExpr",
"makeBinaryMethodField",
"(",
"SQLBinaryOpExpr",
"expr",
",",
"String",
"alias",
",",
"boolean",
"first",
")",
"throws",
"SqlParseException",
"{",
"List",
"<",
"SQLExpr",
">",
"params",
"=",
"new",
"ArrayList",
"<>",
"(",... | binary method can nested | [
"binary",
"method",
"can",
"nested"
] | eaab70b4bf1729978911b83eb96e816ebcfe6e7f | https://github.com/NLPchina/elasticsearch-sql/blob/eaab70b4bf1729978911b83eb96e816ebcfe6e7f/src/main/java/org/nlpcn/es4sql/parse/FieldMaker.java#L152-L180 |
130,127 | NLPchina/elasticsearch-sql | src/main/java/org/nlpcn/es4sql/query/ESActionFactory.java | ESActionFactory.create | public static QueryAction create(Client client, String sql) throws SqlParseException, SQLFeatureNotSupportedException {
sql = sql.replaceAll("\n"," ");
String firstWord = sql.substring(0, sql.indexOf(' '));
switch (firstWord.toUpperCase()) {
case "SELECT":
//zhongshu-comment 将sql字符串解析成AST,即S... | java | public static QueryAction create(Client client, String sql) throws SqlParseException, SQLFeatureNotSupportedException {
sql = sql.replaceAll("\n"," ");
String firstWord = sql.substring(0, sql.indexOf(' '));
switch (firstWord.toUpperCase()) {
case "SELECT":
//zhongshu-comment 将sql字符串解析成AST,即S... | [
"public",
"static",
"QueryAction",
"create",
"(",
"Client",
"client",
",",
"String",
"sql",
")",
"throws",
"SqlParseException",
",",
"SQLFeatureNotSupportedException",
"{",
"sql",
"=",
"sql",
".",
"replaceAll",
"(",
"\"\\n\"",
",",
"\" \"",
")",
";",
"String",
... | Create the compatible Query object
based on the SQL query.
@param sql The SQL query.
@return Query object. | [
"Create",
"the",
"compatible",
"Query",
"object",
"based",
"on",
"the",
"SQL",
"query",
"."
] | eaab70b4bf1729978911b83eb96e816ebcfe6e7f | https://github.com/NLPchina/elasticsearch-sql/blob/eaab70b4bf1729978911b83eb96e816ebcfe6e7f/src/main/java/org/nlpcn/es4sql/query/ESActionFactory.java#L41-L77 |
130,128 | NLPchina/elasticsearch-sql | src/main/java/org/elasticsearch/plugin/nlpcn/ElasticUtils.java | ElasticUtils.hitsAsStringResult | public static String hitsAsStringResult(SearchHits results, MetaSearchResult metaResults) throws IOException {
if(results == null) return null;
Object[] searchHits;
searchHits = new Object[(int) results.getTotalHits()];
int i = 0;
for(SearchHit hit : results) {
HashMa... | java | public static String hitsAsStringResult(SearchHits results, MetaSearchResult metaResults) throws IOException {
if(results == null) return null;
Object[] searchHits;
searchHits = new Object[(int) results.getTotalHits()];
int i = 0;
for(SearchHit hit : results) {
HashMa... | [
"public",
"static",
"String",
"hitsAsStringResult",
"(",
"SearchHits",
"results",
",",
"MetaSearchResult",
"metaResults",
")",
"throws",
"IOException",
"{",
"if",
"(",
"results",
"==",
"null",
")",
"return",
"null",
";",
"Object",
"[",
"]",
"searchHits",
";",
... | use our deserializer instead of results toXcontent because the source field is differnet from sourceAsMap. | [
"use",
"our",
"deserializer",
"instead",
"of",
"results",
"toXcontent",
"because",
"the",
"source",
"field",
"is",
"differnet",
"from",
"sourceAsMap",
"."
] | eaab70b4bf1729978911b83eb96e816ebcfe6e7f | https://github.com/NLPchina/elasticsearch-sql/blob/eaab70b4bf1729978911b83eb96e816ebcfe6e7f/src/main/java/org/elasticsearch/plugin/nlpcn/ElasticUtils.java#L43-L71 |
130,129 | NLPchina/elasticsearch-sql | src/main/java/org/elasticsearch/plugin/nlpcn/ActionRequestRestExecuter.java | ActionRequestRestExecuter.execute | public void execute() throws Exception {
ActionRequest request = requestBuilder.request();
//todo: maby change to instanceof multi?
if(requestBuilder instanceof JoinRequestBuilder){
executeJoinRequestAndSendResponse();
}
else if (request instanceof SearchRequest) {
clie... | java | public void execute() throws Exception {
ActionRequest request = requestBuilder.request();
//todo: maby change to instanceof multi?
if(requestBuilder instanceof JoinRequestBuilder){
executeJoinRequestAndSendResponse();
}
else if (request instanceof SearchRequest) {
clie... | [
"public",
"void",
"execute",
"(",
")",
"throws",
"Exception",
"{",
"ActionRequest",
"request",
"=",
"requestBuilder",
".",
"request",
"(",
")",
";",
"//todo: maby change to instanceof multi?",
"if",
"(",
"requestBuilder",
"instanceof",
"JoinRequestBuilder",
")",
"{",
... | Execute the ActionRequest and returns the REST response using the channel. | [
"Execute",
"the",
"ActionRequest",
"and",
"returns",
"the",
"REST",
"response",
"using",
"the",
"channel",
"."
] | eaab70b4bf1729978911b83eb96e816ebcfe6e7f | https://github.com/NLPchina/elasticsearch-sql/blob/eaab70b4bf1729978911b83eb96e816ebcfe6e7f/src/main/java/org/elasticsearch/plugin/nlpcn/ActionRequestRestExecuter.java#L39-L59 |
130,130 | NLPchina/elasticsearch-sql | src/main/java/org/nlpcn/es4sql/domain/Query.java | Query.getIndexArr | public String[] getIndexArr() {
String[] indexArr = new String[this.from.size()];
for (int i = 0; i < indexArr.length; i++) {
indexArr[i] = this.from.get(i).getIndex();
}
return indexArr;
} | java | public String[] getIndexArr() {
String[] indexArr = new String[this.from.size()];
for (int i = 0; i < indexArr.length; i++) {
indexArr[i] = this.from.get(i).getIndex();
}
return indexArr;
} | [
"public",
"String",
"[",
"]",
"getIndexArr",
"(",
")",
"{",
"String",
"[",
"]",
"indexArr",
"=",
"new",
"String",
"[",
"this",
".",
"from",
".",
"size",
"(",
")",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"indexArr",
".",
"leng... | Get the indexes the query refer to.
@return list of strings, the indexes names | [
"Get",
"the",
"indexes",
"the",
"query",
"refer",
"to",
"."
] | eaab70b4bf1729978911b83eb96e816ebcfe6e7f | https://github.com/NLPchina/elasticsearch-sql/blob/eaab70b4bf1729978911b83eb96e816ebcfe6e7f/src/main/java/org/nlpcn/es4sql/domain/Query.java#L56-L62 |
130,131 | NLPchina/elasticsearch-sql | src/main/java/org/nlpcn/es4sql/domain/Query.java | Query.getTypeArr | public String[] getTypeArr() {
List<String> list = new ArrayList<>();
From index = null;
for (int i = 0; i < from.size(); i++) {
index = from.get(i);
if (index.getType() != null && index.getType().trim().length() > 0) {
list.add(index.getType());
}
}
if (list.size() == 0) {
return null;
}
... | java | public String[] getTypeArr() {
List<String> list = new ArrayList<>();
From index = null;
for (int i = 0; i < from.size(); i++) {
index = from.get(i);
if (index.getType() != null && index.getType().trim().length() > 0) {
list.add(index.getType());
}
}
if (list.size() == 0) {
return null;
}
... | [
"public",
"String",
"[",
"]",
"getTypeArr",
"(",
")",
"{",
"List",
"<",
"String",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"From",
"index",
"=",
"null",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"from",
".",
"size"... | Get the types the query refer to.
@return list of strings, the types names | [
"Get",
"the",
"types",
"the",
"query",
"refer",
"to",
"."
] | eaab70b4bf1729978911b83eb96e816ebcfe6e7f | https://github.com/NLPchina/elasticsearch-sql/blob/eaab70b4bf1729978911b83eb96e816ebcfe6e7f/src/main/java/org/nlpcn/es4sql/domain/Query.java#L68-L82 |
130,132 | NLPchina/elasticsearch-sql | src/main/java/com/alibaba/druid/pool/ElasticSearchDruidDataSource.java | ElasticSearchDruidDataSource.initFromSPIServiceLoader | private void initFromSPIServiceLoader() {
String property = System.getProperty("druid.load.spifilter.skip");
if (property != null) {
return;
}
ServiceLoader<Filter> druidAutoFilterLoader = ServiceLoader.load(Filter.class);
for (Filter autoFilter : druidAutoFilterLo... | java | private void initFromSPIServiceLoader() {
String property = System.getProperty("druid.load.spifilter.skip");
if (property != null) {
return;
}
ServiceLoader<Filter> druidAutoFilterLoader = ServiceLoader.load(Filter.class);
for (Filter autoFilter : druidAutoFilterLo... | [
"private",
"void",
"initFromSPIServiceLoader",
"(",
")",
"{",
"String",
"property",
"=",
"System",
".",
"getProperty",
"(",
"\"druid.load.spifilter.skip\"",
")",
";",
"if",
"(",
"property",
"!=",
"null",
")",
"{",
"return",
";",
"}",
"ServiceLoader",
"<",
"Fil... | load filters from SPI ServiceLoader
@see ServiceLoader | [
"load",
"filters",
"from",
"SPI",
"ServiceLoader"
] | eaab70b4bf1729978911b83eb96e816ebcfe6e7f | https://github.com/NLPchina/elasticsearch-sql/blob/eaab70b4bf1729978911b83eb96e816ebcfe6e7f/src/main/java/com/alibaba/druid/pool/ElasticSearchDruidDataSource.java#L744-L762 |
130,133 | NLPchina/elasticsearch-sql | src/main/java/org/nlpcn/es4sql/parse/WhereParser.java | WhereParser.explanSpecialCondWithBothSidesAreLiterals | private boolean explanSpecialCondWithBothSidesAreLiterals(SQLBinaryOpExpr bExpr, Where where) throws SqlParseException {
if ((bExpr.getLeft() instanceof SQLNumericLiteralExpr || bExpr.getLeft() instanceof SQLCharExpr) &&
(bExpr.getRight() instanceof SQLNumericLiteralExpr || bExpr.getRight() inst... | java | private boolean explanSpecialCondWithBothSidesAreLiterals(SQLBinaryOpExpr bExpr, Where where) throws SqlParseException {
if ((bExpr.getLeft() instanceof SQLNumericLiteralExpr || bExpr.getLeft() instanceof SQLCharExpr) &&
(bExpr.getRight() instanceof SQLNumericLiteralExpr || bExpr.getRight() inst... | [
"private",
"boolean",
"explanSpecialCondWithBothSidesAreLiterals",
"(",
"SQLBinaryOpExpr",
"bExpr",
",",
"Where",
"where",
")",
"throws",
"SqlParseException",
"{",
"if",
"(",
"(",
"bExpr",
".",
"getLeft",
"(",
")",
"instanceof",
"SQLNumericLiteralExpr",
"||",
"bExpr",... | some where conditions eg. 1=1 or 3>2 or 'a'='b' | [
"some",
"where",
"conditions",
"eg",
".",
"1",
"=",
"1",
"or",
"3",
">",
"2",
"or",
"a",
"=",
"b"
] | eaab70b4bf1729978911b83eb96e816ebcfe6e7f | https://github.com/NLPchina/elasticsearch-sql/blob/eaab70b4bf1729978911b83eb96e816ebcfe6e7f/src/main/java/org/nlpcn/es4sql/parse/WhereParser.java#L110-L129 |
130,134 | NLPchina/elasticsearch-sql | src/main/java/org/nlpcn/es4sql/parse/WhereParser.java | WhereParser.explanSpecialCondWithBothSidesAreProperty | private boolean explanSpecialCondWithBothSidesAreProperty(SQLBinaryOpExpr bExpr, Where where) throws SqlParseException {
//join is not support
if ((bExpr.getLeft() instanceof SQLPropertyExpr || bExpr.getLeft() instanceof SQLIdentifierExpr) &&
(bExpr.getRight() instanceof SQLPropertyExpr ... | java | private boolean explanSpecialCondWithBothSidesAreProperty(SQLBinaryOpExpr bExpr, Where where) throws SqlParseException {
//join is not support
if ((bExpr.getLeft() instanceof SQLPropertyExpr || bExpr.getLeft() instanceof SQLIdentifierExpr) &&
(bExpr.getRight() instanceof SQLPropertyExpr ... | [
"private",
"boolean",
"explanSpecialCondWithBothSidesAreProperty",
"(",
"SQLBinaryOpExpr",
"bExpr",
",",
"Where",
"where",
")",
"throws",
"SqlParseException",
"{",
"//join is not support",
"if",
"(",
"(",
"bExpr",
".",
"getLeft",
"(",
")",
"instanceof",
"SQLPropertyExpr... | some where conditions eg. field1=field2 or field1>field2 | [
"some",
"where",
"conditions",
"eg",
".",
"field1",
"=",
"field2",
"or",
"field1",
">",
"field2"
] | eaab70b4bf1729978911b83eb96e816ebcfe6e7f | https://github.com/NLPchina/elasticsearch-sql/blob/eaab70b4bf1729978911b83eb96e816ebcfe6e7f/src/main/java/org/nlpcn/es4sql/parse/WhereParser.java#L132-L167 |
130,135 | NLPchina/elasticsearch-sql | src/main/java/org/nlpcn/es4sql/query/AggregationQueryAction.java | AggregationQueryAction.setIndicesAndTypes | private void setIndicesAndTypes() {
request.setIndices(query.getIndexArr());
String[] typeArr = query.getTypeArr();
if (typeArr != null) {
request.setTypes(typeArr);
}
} | java | private void setIndicesAndTypes() {
request.setIndices(query.getIndexArr());
String[] typeArr = query.getTypeArr();
if (typeArr != null) {
request.setTypes(typeArr);
}
} | [
"private",
"void",
"setIndicesAndTypes",
"(",
")",
"{",
"request",
".",
"setIndices",
"(",
"query",
".",
"getIndexArr",
"(",
")",
")",
";",
"String",
"[",
"]",
"typeArr",
"=",
"query",
".",
"getTypeArr",
"(",
")",
";",
"if",
"(",
"typeArr",
"!=",
"null... | Set indices and types to the search request. | [
"Set",
"indices",
"and",
"types",
"to",
"the",
"search",
"request",
"."
] | eaab70b4bf1729978911b83eb96e816ebcfe6e7f | https://github.com/NLPchina/elasticsearch-sql/blob/eaab70b4bf1729978911b83eb96e816ebcfe6e7f/src/main/java/org/nlpcn/es4sql/query/AggregationQueryAction.java#L453-L460 |
130,136 | NLPchina/elasticsearch-sql | src/main/java/org/nlpcn/es4sql/query/DefaultQueryAction.java | DefaultQueryAction.setWhere | private void setWhere(Where where) throws SqlParseException {
if (where != null) {
BoolQueryBuilder boolQuery = QueryMaker.explan(where,this.select.isQuery);
request.setQuery(boolQuery);
}
} | java | private void setWhere(Where where) throws SqlParseException {
if (where != null) {
BoolQueryBuilder boolQuery = QueryMaker.explan(where,this.select.isQuery);
request.setQuery(boolQuery);
}
} | [
"private",
"void",
"setWhere",
"(",
"Where",
"where",
")",
"throws",
"SqlParseException",
"{",
"if",
"(",
"where",
"!=",
"null",
")",
"{",
"BoolQueryBuilder",
"boolQuery",
"=",
"QueryMaker",
".",
"explan",
"(",
"where",
",",
"this",
".",
"select",
".",
"is... | Create filters or queries based on the Where clause.
@param where
the 'WHERE' part of the SQL query.
@throws SqlParseException | [
"Create",
"filters",
"or",
"queries",
"based",
"on",
"the",
"Where",
"clause",
"."
] | eaab70b4bf1729978911b83eb96e816ebcfe6e7f | https://github.com/NLPchina/elasticsearch-sql/blob/eaab70b4bf1729978911b83eb96e816ebcfe6e7f/src/main/java/org/nlpcn/es4sql/query/DefaultQueryAction.java#L195-L200 |
130,137 | NLPchina/elasticsearch-sql | src/main/java/org/nlpcn/es4sql/query/DefaultQueryAction.java | DefaultQueryAction.setSorts | private void setSorts(List<Order> orderBys) {
for (Order order : orderBys) {
if (order.getNestedPath() != null) {
request.addSort(SortBuilders.fieldSort(order.getName()).order(SortOrder.valueOf(order.getType())).setNestedSort(new NestedSortBuilder(order.getNestedPath())));
} el... | java | private void setSorts(List<Order> orderBys) {
for (Order order : orderBys) {
if (order.getNestedPath() != null) {
request.addSort(SortBuilders.fieldSort(order.getName()).order(SortOrder.valueOf(order.getType())).setNestedSort(new NestedSortBuilder(order.getNestedPath())));
} el... | [
"private",
"void",
"setSorts",
"(",
"List",
"<",
"Order",
">",
"orderBys",
")",
"{",
"for",
"(",
"Order",
"order",
":",
"orderBys",
")",
"{",
"if",
"(",
"order",
".",
"getNestedPath",
"(",
")",
"!=",
"null",
")",
"{",
"request",
".",
"addSort",
"(",
... | Add sorts to the elasticsearch query based on the 'ORDER BY' clause.
@param orderBys
list of Order object | [
"Add",
"sorts",
"to",
"the",
"elasticsearch",
"query",
"based",
"on",
"the",
"ORDER",
"BY",
"clause",
"."
] | eaab70b4bf1729978911b83eb96e816ebcfe6e7f | https://github.com/NLPchina/elasticsearch-sql/blob/eaab70b4bf1729978911b83eb96e816ebcfe6e7f/src/main/java/org/nlpcn/es4sql/query/DefaultQueryAction.java#L208-L226 |
130,138 | NLPchina/elasticsearch-sql | src/main/java/org/nlpcn/es4sql/query/DefaultQueryAction.java | DefaultQueryAction.setLimit | private void setLimit(int from, int size) {
request.setFrom(from);
if (size > -1) {
request.setSize(size);
}
} | java | private void setLimit(int from, int size) {
request.setFrom(from);
if (size > -1) {
request.setSize(size);
}
} | [
"private",
"void",
"setLimit",
"(",
"int",
"from",
",",
"int",
"size",
")",
"{",
"request",
".",
"setFrom",
"(",
"from",
")",
";",
"if",
"(",
"size",
">",
"-",
"1",
")",
"{",
"request",
".",
"setSize",
"(",
"size",
")",
";",
"}",
"}"
] | Add from and size to the ES query based on the 'LIMIT' clause
@param from
starts from document at position from
@param size
number of documents to return. | [
"Add",
"from",
"and",
"size",
"to",
"the",
"ES",
"query",
"based",
"on",
"the",
"LIMIT",
"clause"
] | eaab70b4bf1729978911b83eb96e816ebcfe6e7f | https://github.com/NLPchina/elasticsearch-sql/blob/eaab70b4bf1729978911b83eb96e816ebcfe6e7f/src/main/java/org/nlpcn/es4sql/query/DefaultQueryAction.java#L236-L242 |
130,139 | NLPchina/elasticsearch-sql | src/main/java/org/nlpcn/es4sql/SearchDao.java | SearchDao.explain | public QueryAction explain(String sql) throws SqlParseException, SQLFeatureNotSupportedException {
return ESActionFactory.create(client, sql);
} | java | public QueryAction explain(String sql) throws SqlParseException, SQLFeatureNotSupportedException {
return ESActionFactory.create(client, sql);
} | [
"public",
"QueryAction",
"explain",
"(",
"String",
"sql",
")",
"throws",
"SqlParseException",
",",
"SQLFeatureNotSupportedException",
"{",
"return",
"ESActionFactory",
".",
"create",
"(",
"client",
",",
"sql",
")",
";",
"}"
] | Prepare action And transform sql
into ES ActionRequest
@param sql SQL query to execute.
@return ES request
@throws SqlParseException | [
"Prepare",
"action",
"And",
"transform",
"sql",
"into",
"ES",
"ActionRequest"
] | eaab70b4bf1729978911b83eb96e816ebcfe6e7f | https://github.com/NLPchina/elasticsearch-sql/blob/eaab70b4bf1729978911b83eb96e816ebcfe6e7f/src/main/java/org/nlpcn/es4sql/SearchDao.java#L45-L47 |
130,140 | NLPchina/elasticsearch-sql | src/main/java/org/nlpcn/es4sql/query/maker/AggMaker.java | AggMaker.makeCountAgg | private ValuesSourceAggregationBuilder makeCountAgg(MethodField field) {
// Cardinality is approximate DISTINCT.
if ("DISTINCT".equals(field.getOption())) {
if (field.getParams().size() == 1) {
return AggregationBuilders.cardinality(field.getAlias()).field(field.getParams()... | java | private ValuesSourceAggregationBuilder makeCountAgg(MethodField field) {
// Cardinality is approximate DISTINCT.
if ("DISTINCT".equals(field.getOption())) {
if (field.getParams().size() == 1) {
return AggregationBuilders.cardinality(field.getAlias()).field(field.getParams()... | [
"private",
"ValuesSourceAggregationBuilder",
"makeCountAgg",
"(",
"MethodField",
"field",
")",
"{",
"// Cardinality is approximate DISTINCT.",
"if",
"(",
"\"DISTINCT\"",
".",
"equals",
"(",
"field",
".",
"getOption",
"(",
")",
")",
")",
"{",
"if",
"(",
"field",
".... | Create count aggregation.
@param field The count function
@return AggregationBuilder use to count result | [
"Create",
"count",
"aggregation",
"."
] | eaab70b4bf1729978911b83eb96e816ebcfe6e7f | https://github.com/NLPchina/elasticsearch-sql/blob/eaab70b4bf1729978911b83eb96e816ebcfe6e7f/src/main/java/org/nlpcn/es4sql/query/maker/AggMaker.java#L686-L727 |
130,141 | NLPchina/elasticsearch-sql | src/main/java/org/nlpcn/es4sql/query/DeleteQueryAction.java | DeleteQueryAction.setIndicesAndTypes | private void setIndicesAndTypes() {
DeleteByQueryRequest innerRequest = request.request();
innerRequest.indices(query.getIndexArr());
String[] typeArr = query.getTypeArr();
if (typeArr!=null){
innerRequest.getSearchRequest().types(typeArr);
}
// String[] typeArr = q... | java | private void setIndicesAndTypes() {
DeleteByQueryRequest innerRequest = request.request();
innerRequest.indices(query.getIndexArr());
String[] typeArr = query.getTypeArr();
if (typeArr!=null){
innerRequest.getSearchRequest().types(typeArr);
}
// String[] typeArr = q... | [
"private",
"void",
"setIndicesAndTypes",
"(",
")",
"{",
"DeleteByQueryRequest",
"innerRequest",
"=",
"request",
".",
"request",
"(",
")",
";",
"innerRequest",
".",
"indices",
"(",
"query",
".",
"getIndexArr",
"(",
")",
")",
";",
"String",
"[",
"]",
"typeArr"... | Set indices and types to the delete by query request. | [
"Set",
"indices",
"and",
"types",
"to",
"the",
"delete",
"by",
"query",
"request",
"."
] | eaab70b4bf1729978911b83eb96e816ebcfe6e7f | https://github.com/NLPchina/elasticsearch-sql/blob/eaab70b4bf1729978911b83eb96e816ebcfe6e7f/src/main/java/org/nlpcn/es4sql/query/DeleteQueryAction.java#L52-L64 |
130,142 | NLPchina/elasticsearch-sql | src/main/java/org/elasticsearch/plugin/nlpcn/MinusExecutor.java | MinusExecutor.runWithScrollingAndAddFilter | private MinusOneFieldAndOptimizationResult runWithScrollingAndAddFilter(String firstFieldName ,String secondFieldName) throws SqlParseException {
SearchResponse scrollResp = ElasticUtils.scrollOneTimeWithHits(this.client, this.builder.getFirstSearchRequest(),
builder.getOriginalSelect(true), thi... | java | private MinusOneFieldAndOptimizationResult runWithScrollingAndAddFilter(String firstFieldName ,String secondFieldName) throws SqlParseException {
SearchResponse scrollResp = ElasticUtils.scrollOneTimeWithHits(this.client, this.builder.getFirstSearchRequest(),
builder.getOriginalSelect(true), thi... | [
"private",
"MinusOneFieldAndOptimizationResult",
"runWithScrollingAndAddFilter",
"(",
"String",
"firstFieldName",
",",
"String",
"secondFieldName",
")",
"throws",
"SqlParseException",
"{",
"SearchResponse",
"scrollResp",
"=",
"ElasticUtils",
".",
"scrollOneTimeWithHits",
"(",
... | 1.1.2 add all results left from miniset to bigset | [
"1",
".",
"1",
".",
"2",
"add",
"all",
"results",
"left",
"from",
"miniset",
"to",
"bigset"
] | eaab70b4bf1729978911b83eb96e816ebcfe6e7f | https://github.com/NLPchina/elasticsearch-sql/blob/eaab70b4bf1729978911b83eb96e816ebcfe6e7f/src/main/java/org/elasticsearch/plugin/nlpcn/MinusExecutor.java#L249-L301 |
130,143 | alibaba/otter | shared/common/src/main/java/com/alibaba/otter/shared/common/utils/extension/classpath/ClassNameUtils.java | ClassNameUtils.convertClassNameToUnderscoreName | public static String convertClassNameToUnderscoreName(String name) {
StringBuilder result = new StringBuilder();
if (name != null) {
int len = name.length();
if (len > 0) {
result.append(name.charAt(0));
for (int i = 1; i < len; i++) {
... | java | public static String convertClassNameToUnderscoreName(String name) {
StringBuilder result = new StringBuilder();
if (name != null) {
int len = name.length();
if (len > 0) {
result.append(name.charAt(0));
for (int i = 1; i < len; i++) {
... | [
"public",
"static",
"String",
"convertClassNameToUnderscoreName",
"(",
"String",
"name",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"name",
"!=",
"null",
")",
"{",
"int",
"len",
"=",
"name",
".",
"length",
"... | Convert a class name with underscores to the corresponding column name using "_". A name like "CustomerNumber"
class name would match a "CUSTOMER_NUMBER".
@param name the class name to be converted
@return the name using "_" | [
"Convert",
"a",
"class",
"name",
"with",
"underscores",
"to",
"the",
"corresponding",
"column",
"name",
"using",
"_",
".",
"A",
"name",
"like",
"CustomerNumber",
"class",
"name",
"would",
"match",
"a",
"CUSTOMER_NUMBER",
"."
] | c7b5f94a0dd162e01ddffaf3a63cade7d23fca55 | https://github.com/alibaba/otter/blob/c7b5f94a0dd162e01ddffaf3a63cade7d23fca55/shared/common/src/main/java/com/alibaba/otter/shared/common/utils/extension/classpath/ClassNameUtils.java#L34-L54 |
130,144 | alibaba/otter | shared/common/src/main/java/com/alibaba/otter/shared/common/utils/extension/classpath/ClassNameUtils.java | ClassNameUtils.convertUnderscoreNameToClassName | public static String convertUnderscoreNameToClassName(String name) {
StringBuffer result = new StringBuffer();
boolean nextIsUpper = false;
if (name != null) {
int len = name.length();
if (len > 0) {
String s = String.valueOf(name.charAt(0));
... | java | public static String convertUnderscoreNameToClassName(String name) {
StringBuffer result = new StringBuffer();
boolean nextIsUpper = false;
if (name != null) {
int len = name.length();
if (len > 0) {
String s = String.valueOf(name.charAt(0));
... | [
"public",
"static",
"String",
"convertUnderscoreNameToClassName",
"(",
"String",
"name",
")",
"{",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"boolean",
"nextIsUpper",
"=",
"false",
";",
"if",
"(",
"name",
"!=",
"null",
")",
"{",
"i... | Convert a column name with underscores to the corresponding class name using "camel case". A name like
"customer_number" would match a "CustomerNumber" class name.
@param name the column name to be converted
@return the name using "camel case" | [
"Convert",
"a",
"column",
"name",
"with",
"underscores",
"to",
"the",
"corresponding",
"class",
"name",
"using",
"camel",
"case",
".",
"A",
"name",
"like",
"customer_number",
"would",
"match",
"a",
"CustomerNumber",
"class",
"name",
"."
] | c7b5f94a0dd162e01ddffaf3a63cade7d23fca55 | https://github.com/alibaba/otter/blob/c7b5f94a0dd162e01ddffaf3a63cade7d23fca55/shared/common/src/main/java/com/alibaba/otter/shared/common/utils/extension/classpath/ClassNameUtils.java#L63-L93 |
130,145 | alibaba/otter | node/etl/src/main/java/com/alibaba/otter/node/etl/common/db/utils/SqlTimestampConverter.java | SqlTimestampConverter.convert | public Object convert(Class type, Object value) {
if (value == null) {
if (useDefault) {
return (defaultValue);
} else {
throw new ConversionException("No value specified");
}
}
if (value instanceof java.sql.Date && java.sql.Da... | java | public Object convert(Class type, Object value) {
if (value == null) {
if (useDefault) {
return (defaultValue);
} else {
throw new ConversionException("No value specified");
}
}
if (value instanceof java.sql.Date && java.sql.Da... | [
"public",
"Object",
"convert",
"(",
"Class",
"type",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"if",
"(",
"useDefault",
")",
"{",
"return",
"(",
"defaultValue",
")",
";",
"}",
"else",
"{",
"throw",
"new",
"Conversi... | Convert the specified input object into an output object of the specified type.
@param type Data type to which this value should be converted
@param value The input value to be converted
@exception ConversionException if conversion cannot be performed successfully | [
"Convert",
"the",
"specified",
"input",
"object",
"into",
"an",
"output",
"object",
"of",
"the",
"specified",
"type",
"."
] | c7b5f94a0dd162e01ddffaf3a63cade7d23fca55 | https://github.com/alibaba/otter/blob/c7b5f94a0dd162e01ddffaf3a63cade7d23fca55/node/etl/src/main/java/com/alibaba/otter/node/etl/common/db/utils/SqlTimestampConverter.java#L76-L107 |
130,146 | alibaba/otter | shared/common/src/main/java/com/alibaba/otter/shared/common/utils/meta/DdlUtils.java | DdlUtils.makeAllColumnsPrimaryKeysIfNoPrimaryKeysFound | private static void makeAllColumnsPrimaryKeysIfNoPrimaryKeysFound(Table table) {
if ((table != null) && (table.getPrimaryKeyColumns() != null) && (table.getPrimaryKeyColumns().length == 0)) {
Column[] allCoumns = table.getColumns();
for (Column column : allCoumns) {
colu... | java | private static void makeAllColumnsPrimaryKeysIfNoPrimaryKeysFound(Table table) {
if ((table != null) && (table.getPrimaryKeyColumns() != null) && (table.getPrimaryKeyColumns().length == 0)) {
Column[] allCoumns = table.getColumns();
for (Column column : allCoumns) {
colu... | [
"private",
"static",
"void",
"makeAllColumnsPrimaryKeysIfNoPrimaryKeysFound",
"(",
"Table",
"table",
")",
"{",
"if",
"(",
"(",
"table",
"!=",
"null",
")",
"&&",
"(",
"table",
".",
"getPrimaryKeyColumns",
"(",
")",
"!=",
"null",
")",
"&&",
"(",
"table",
".",
... | Treat tables with no primary keys as a table with all primary keys. | [
"Treat",
"tables",
"with",
"no",
"primary",
"keys",
"as",
"a",
"table",
"with",
"all",
"primary",
"keys",
"."
] | c7b5f94a0dd162e01ddffaf3a63cade7d23fca55 | https://github.com/alibaba/otter/blob/c7b5f94a0dd162e01ddffaf3a63cade7d23fca55/shared/common/src/main/java/com/alibaba/otter/shared/common/utils/meta/DdlUtils.java#L270-L278 |
130,147 | alibaba/otter | shared/common/src/main/java/com/alibaba/otter/shared/common/utils/sizeof/ObjectProfiler.java | ObjectProfiler.sizeof | public static long sizeof(final Object obj) {
if (null == obj || isSharedFlyweight(obj)) {
return 0;
}
final IdentityHashMap visited = new IdentityHashMap(80000);
try {
return computeSizeof(obj, visited, CLASS_METADATA_CACHE);
} catch (RuntimeException r... | java | public static long sizeof(final Object obj) {
if (null == obj || isSharedFlyweight(obj)) {
return 0;
}
final IdentityHashMap visited = new IdentityHashMap(80000);
try {
return computeSizeof(obj, visited, CLASS_METADATA_CACHE);
} catch (RuntimeException r... | [
"public",
"static",
"long",
"sizeof",
"(",
"final",
"Object",
"obj",
")",
"{",
"if",
"(",
"null",
"==",
"obj",
"||",
"isSharedFlyweight",
"(",
"obj",
")",
")",
"{",
"return",
"0",
";",
"}",
"final",
"IdentityHashMap",
"visited",
"=",
"new",
"IdentityHash... | Estimates the full size of the object graph rooted at 'obj'. Duplicate data instances are correctly accounted
for. The implementation is not recursive.
@param obj input object instance to be measured
@return 'obj' size [0 if 'obj' is null'] | [
"Estimates",
"the",
"full",
"size",
"of",
"the",
"object",
"graph",
"rooted",
"at",
"obj",
".",
"Duplicate",
"data",
"instances",
"are",
"correctly",
"accounted",
"for",
".",
"The",
"implementation",
"is",
"not",
"recursive",
"."
] | c7b5f94a0dd162e01ddffaf3a63cade7d23fca55 | https://github.com/alibaba/otter/blob/c7b5f94a0dd162e01ddffaf3a63cade7d23fca55/shared/common/src/main/java/com/alibaba/otter/shared/common/utils/sizeof/ObjectProfiler.java#L85-L105 |
130,148 | alibaba/otter | shared/common/src/main/java/com/alibaba/otter/shared/common/utils/sizeof/ObjectProfiler.java | ObjectProfiler.sizedelta | public static long sizedelta(final Object base, final Object obj) {
if (null == obj || isSharedFlyweight(obj)) {
return 0;
}
if (null == base) {
throw new IllegalArgumentException("null input: base");
}
final IdentityHashMap visited = new IdentityHashMap(... | java | public static long sizedelta(final Object base, final Object obj) {
if (null == obj || isSharedFlyweight(obj)) {
return 0;
}
if (null == base) {
throw new IllegalArgumentException("null input: base");
}
final IdentityHashMap visited = new IdentityHashMap(... | [
"public",
"static",
"long",
"sizedelta",
"(",
"final",
"Object",
"base",
",",
"final",
"Object",
"obj",
")",
"{",
"if",
"(",
"null",
"==",
"obj",
"||",
"isSharedFlyweight",
"(",
"obj",
")",
")",
"{",
"return",
"0",
";",
"}",
"if",
"(",
"null",
"==",
... | Estimates the full size of the object graph rooted at 'obj' by pre-populating the "visited" set with the object
graph rooted at 'base'. The net effect is to compute the size of 'obj' by summing over all instance data
contained in 'obj' but not in 'base'.
@param base graph boundary [may not be null]
@param obj input ob... | [
"Estimates",
"the",
"full",
"size",
"of",
"the",
"object",
"graph",
"rooted",
"at",
"obj",
"by",
"pre",
"-",
"populating",
"the",
"visited",
"set",
"with",
"the",
"object",
"graph",
"rooted",
"at",
"base",
".",
"The",
"net",
"effect",
"is",
"to",
"comput... | c7b5f94a0dd162e01ddffaf3a63cade7d23fca55 | https://github.com/alibaba/otter/blob/c7b5f94a0dd162e01ddffaf3a63cade7d23fca55/shared/common/src/main/java/com/alibaba/otter/shared/common/utils/sizeof/ObjectProfiler.java#L116-L140 |
130,149 | alibaba/otter | node/etl/src/main/java/com/alibaba/otter/node/etl/common/io/compress/impl/PackableObject.java | PackableObject.isPackableWith | protected boolean isPackableWith(Object value, int choose) {
if (value == null) {
return false;
}
if (choose == CHOOSE_EXTENSION) {
if (value.equals(getDefaultFileExtension())) {
return true;
}
} else if (choose == CHOOSE_NAME) {
... | java | protected boolean isPackableWith(Object value, int choose) {
if (value == null) {
return false;
}
if (choose == CHOOSE_EXTENSION) {
if (value.equals(getDefaultFileExtension())) {
return true;
}
} else if (choose == CHOOSE_NAME) {
... | [
"protected",
"boolean",
"isPackableWith",
"(",
"Object",
"value",
",",
"int",
"choose",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"choose",
"==",
"CHOOSE_EXTENSION",
")",
"{",
"if",
"(",
"value",
".",... | String Chooser. | [
"String",
"Chooser",
"."
] | c7b5f94a0dd162e01ddffaf3a63cade7d23fca55 | https://github.com/alibaba/otter/blob/c7b5f94a0dd162e01ddffaf3a63cade7d23fca55/node/etl/src/main/java/com/alibaba/otter/node/etl/common/io/compress/impl/PackableObject.java#L61-L77 |
130,150 | alibaba/otter | node/etl/src/main/java/com/alibaba/otter/node/etl/common/io/compress/impl/PackableObject.java | PackableObject.identifyByHeader | public static PackableObject identifyByHeader(File file, List packables) throws IOException {
FileInputStream fis = null;
try {
/* Archive result */
// PackableObject packable = null;
// identify archive by header
fis = new FileInputStream(file);
... | java | public static PackableObject identifyByHeader(File file, List packables) throws IOException {
FileInputStream fis = null;
try {
/* Archive result */
// PackableObject packable = null;
// identify archive by header
fis = new FileInputStream(file);
... | [
"public",
"static",
"PackableObject",
"identifyByHeader",
"(",
"File",
"file",
",",
"List",
"packables",
")",
"throws",
"IOException",
"{",
"FileInputStream",
"fis",
"=",
"null",
";",
"try",
"{",
"/* Archive result */",
"// PackableObject packable = null;",
"// identify... | Compares a file to a list of packables and identifies an object by
header. If no matching header is found, it identifies the file by file
extension. If identification was not successfull, null is returned
@param file the file to identify
@param packables a list of packables
@return a matching packable object, or null
... | [
"Compares",
"a",
"file",
"to",
"a",
"list",
"of",
"packables",
"and",
"identifies",
"an",
"object",
"by",
"header",
".",
"If",
"no",
"matching",
"header",
"is",
"found",
"it",
"identifies",
"the",
"file",
"by",
"file",
"extension",
".",
"If",
"identificati... | c7b5f94a0dd162e01ddffaf3a63cade7d23fca55 | https://github.com/alibaba/otter/blob/c7b5f94a0dd162e01ddffaf3a63cade7d23fca55/node/etl/src/main/java/com/alibaba/otter/node/etl/common/io/compress/impl/PackableObject.java#L89-L137 |
130,151 | alibaba/otter | node/etl/src/main/java/com/alibaba/otter/node/etl/common/db/utils/SqlUtils.java | SqlUtils.isNumeric | public static boolean isNumeric(int sqlType) {
return (Types.BIT == sqlType) || (Types.BIGINT == sqlType) || (Types.DECIMAL == sqlType)
|| (Types.DOUBLE == sqlType) || (Types.FLOAT == sqlType) || (Types.INTEGER == sqlType)
|| (Types.NUMERIC == sqlType) || (Types.REAL == sqlType) ||... | java | public static boolean isNumeric(int sqlType) {
return (Types.BIT == sqlType) || (Types.BIGINT == sqlType) || (Types.DECIMAL == sqlType)
|| (Types.DOUBLE == sqlType) || (Types.FLOAT == sqlType) || (Types.INTEGER == sqlType)
|| (Types.NUMERIC == sqlType) || (Types.REAL == sqlType) ||... | [
"public",
"static",
"boolean",
"isNumeric",
"(",
"int",
"sqlType",
")",
"{",
"return",
"(",
"Types",
".",
"BIT",
"==",
"sqlType",
")",
"||",
"(",
"Types",
".",
"BIGINT",
"==",
"sqlType",
")",
"||",
"(",
"Types",
".",
"DECIMAL",
"==",
"sqlType",
")",
... | Check whether the given SQL type is numeric. | [
"Check",
"whether",
"the",
"given",
"SQL",
"type",
"is",
"numeric",
"."
] | c7b5f94a0dd162e01ddffaf3a63cade7d23fca55 | https://github.com/alibaba/otter/blob/c7b5f94a0dd162e01ddffaf3a63cade7d23fca55/node/etl/src/main/java/com/alibaba/otter/node/etl/common/db/utils/SqlUtils.java#L322-L327 |
130,152 | alibaba/otter | node/canal/src/main/java/com/alibaba/otter/canal/extend/ha/MediaHAController.java | MediaHAController.customInfoIfNecessay | protected AuthenticationInfo customInfoIfNecessay(AuthenticationInfo authenticationInfo) {
if (StringUtils.isNotBlank(customUser)) {
authenticationInfo.setUsername(customUser);
}
if (StringUtils.isNotBlank(customPasswd)) {
authenticationInfo.setPassword(customPasswd);
... | java | protected AuthenticationInfo customInfoIfNecessay(AuthenticationInfo authenticationInfo) {
if (StringUtils.isNotBlank(customUser)) {
authenticationInfo.setUsername(customUser);
}
if (StringUtils.isNotBlank(customPasswd)) {
authenticationInfo.setPassword(customPasswd);
... | [
"protected",
"AuthenticationInfo",
"customInfoIfNecessay",
"(",
"AuthenticationInfo",
"authenticationInfo",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"customUser",
")",
")",
"{",
"authenticationInfo",
".",
"setUsername",
"(",
"customUser",
")",
";",
... | override custom field
@param authenticationInfo | [
"override",
"custom",
"field"
] | c7b5f94a0dd162e01ddffaf3a63cade7d23fca55 | https://github.com/alibaba/otter/blob/c7b5f94a0dd162e01ddffaf3a63cade7d23fca55/node/canal/src/main/java/com/alibaba/otter/canal/extend/ha/MediaHAController.java#L157-L169 |
130,153 | alibaba/otter | shared/common/src/main/java/com/alibaba/otter/shared/common/utils/zookeeper/ZkClientx.java | ZkClientx.createPersistent | public void createPersistent(String path, Object data, boolean createParents) throws ZkInterruptedException,
IllegalArgumentException, ZkException,
RuntimeExc... | java | public void createPersistent(String path, Object data, boolean createParents) throws ZkInterruptedException,
IllegalArgumentException, ZkException,
RuntimeExc... | [
"public",
"void",
"createPersistent",
"(",
"String",
"path",
",",
"Object",
"data",
",",
"boolean",
"createParents",
")",
"throws",
"ZkInterruptedException",
",",
"IllegalArgumentException",
",",
"ZkException",
",",
"RuntimeException",
"{",
"try",
"{",
"create",
"("... | Create a persistent Sequential node.
@param path
@param data
@param createParents if true all parent dirs are created as well and no {@link ZkNodeExistsException} is thrown
in case the path already exists
@throws ZkInterruptedException if operation was interrupted, or a required reconnection got interrupted
@throws Il... | [
"Create",
"a",
"persistent",
"Sequential",
"node",
"."
] | c7b5f94a0dd162e01ddffaf3a63cade7d23fca55 | https://github.com/alibaba/otter/blob/c7b5f94a0dd162e01ddffaf3a63cade7d23fca55/shared/common/src/main/java/com/alibaba/otter/shared/common/utils/zookeeper/ZkClientx.java#L181-L198 |
130,154 | alibaba/otter | shared/common/src/main/java/com/alibaba/otter/shared/common/utils/zookeeper/ZkClientx.java | ZkClientx.createPersistentSequential | public String createPersistentSequential(String path, Object data) throws ZkInterruptedException,
IllegalArgumentException, ZkException,
RuntimeException {
return create(pa... | java | public String createPersistentSequential(String path, Object data) throws ZkInterruptedException,
IllegalArgumentException, ZkException,
RuntimeException {
return create(pa... | [
"public",
"String",
"createPersistentSequential",
"(",
"String",
"path",
",",
"Object",
"data",
")",
"throws",
"ZkInterruptedException",
",",
"IllegalArgumentException",
",",
"ZkException",
",",
"RuntimeException",
"{",
"return",
"create",
"(",
"path",
",",
"data",
... | Create a persistent, sequental node.
@param path
@param data
@return create node's path
@throws ZkInterruptedException if operation was interrupted, or a required reconnection got interrupted
@throws IllegalArgumentException if called from anything except the ZooKeeper event thread
@throws ZkException if any ZooKeeper... | [
"Create",
"a",
"persistent",
"sequental",
"node",
"."
] | c7b5f94a0dd162e01ddffaf3a63cade7d23fca55 | https://github.com/alibaba/otter/blob/c7b5f94a0dd162e01ddffaf3a63cade7d23fca55/shared/common/src/main/java/com/alibaba/otter/shared/common/utils/zookeeper/ZkClientx.java#L364-L368 |
130,155 | alibaba/otter | shared/common/src/main/java/com/alibaba/otter/shared/common/utils/zookeeper/ZkClientx.java | ZkClientx.createEphemeral | public void createEphemeral(final String path) throws ZkInterruptedException, IllegalArgumentException,
ZkException, RuntimeException {
create(path, null, CreateMode.EPHEMERAL);
} | java | public void createEphemeral(final String path) throws ZkInterruptedException, IllegalArgumentException,
ZkException, RuntimeException {
create(path, null, CreateMode.EPHEMERAL);
} | [
"public",
"void",
"createEphemeral",
"(",
"final",
"String",
"path",
")",
"throws",
"ZkInterruptedException",
",",
"IllegalArgumentException",
",",
"ZkException",
",",
"RuntimeException",
"{",
"create",
"(",
"path",
",",
"null",
",",
"CreateMode",
".",
"EPHEMERAL",
... | Create an ephemeral node.
@param path
@throws ZkInterruptedException if operation was interrupted, or a required reconnection got interrupted
@throws IllegalArgumentException if called from anything except the ZooKeeper event thread
@throws ZkException if any ZooKeeper exception occurred
@throws RuntimeException if an... | [
"Create",
"an",
"ephemeral",
"node",
"."
] | c7b5f94a0dd162e01ddffaf3a63cade7d23fca55 | https://github.com/alibaba/otter/blob/c7b5f94a0dd162e01ddffaf3a63cade7d23fca55/shared/common/src/main/java/com/alibaba/otter/shared/common/utils/zookeeper/ZkClientx.java#L379-L382 |
130,156 | alibaba/otter | shared/common/src/main/java/com/alibaba/otter/shared/common/utils/zookeeper/ZkClientx.java | ZkClientx.createEphemeralSequential | public String createEphemeralSequential(final String path, final Object data) throws ZkInterruptedException,
IllegalArgumentException, ZkException,
RuntimeExc... | java | public String createEphemeralSequential(final String path, final Object data) throws ZkInterruptedException,
IllegalArgumentException, ZkException,
RuntimeExc... | [
"public",
"String",
"createEphemeralSequential",
"(",
"final",
"String",
"path",
",",
"final",
"Object",
"data",
")",
"throws",
"ZkInterruptedException",
",",
"IllegalArgumentException",
",",
"ZkException",
",",
"RuntimeException",
"{",
"return",
"create",
"(",
"path"... | Create an ephemeral, sequential node.
@param path
@param data
@return created path
@throws ZkInterruptedException if operation was interrupted, or a required reconnection got interrupted
@throws IllegalArgumentException if called from anything except the ZooKeeper event thread
@throws ZkException if any ZooKeeper exce... | [
"Create",
"an",
"ephemeral",
"sequential",
"node",
"."
] | c7b5f94a0dd162e01ddffaf3a63cade7d23fca55 | https://github.com/alibaba/otter/blob/c7b5f94a0dd162e01ddffaf3a63cade7d23fca55/shared/common/src/main/java/com/alibaba/otter/shared/common/utils/zookeeper/ZkClientx.java#L440-L444 |
130,157 | alibaba/otter | shared/common/src/main/java/com/alibaba/otter/shared/common/utils/zookeeper/ZkClientx.java | ZkClientx.watchForChilds | public List<String> watchForChilds(final String path) {
if (_zookeeperEventThread != null && Thread.currentThread() == _zookeeperEventThread) {
throw new IllegalArgumentException("Must not be done in the zookeeper event thread.");
}
return retryUntilConnected(new Callable<List<String... | java | public List<String> watchForChilds(final String path) {
if (_zookeeperEventThread != null && Thread.currentThread() == _zookeeperEventThread) {
throw new IllegalArgumentException("Must not be done in the zookeeper event thread.");
}
return retryUntilConnected(new Callable<List<String... | [
"public",
"List",
"<",
"String",
">",
"watchForChilds",
"(",
"final",
"String",
"path",
")",
"{",
"if",
"(",
"_zookeeperEventThread",
"!=",
"null",
"&&",
"Thread",
".",
"currentThread",
"(",
")",
"==",
"_zookeeperEventThread",
")",
"{",
"throw",
"new",
"Ille... | Installs a child watch for the given path.
@param path
@return the current children of the path or null if the zk node with the given path doesn't exist. | [
"Installs",
"a",
"child",
"watch",
"for",
"the",
"given",
"path",
"."
] | c7b5f94a0dd162e01ddffaf3a63cade7d23fca55 | https://github.com/alibaba/otter/blob/c7b5f94a0dd162e01ddffaf3a63cade7d23fca55/shared/common/src/main/java/com/alibaba/otter/shared/common/utils/zookeeper/ZkClientx.java#L934-L951 |
130,158 | alibaba/otter | shared/common/src/main/java/com/alibaba/otter/shared/common/utils/zookeeper/ZkClientx.java | ZkClientx.close | public void close() throws ZkInterruptedException {
if (_connection == null) {
return;
}
LOG.debug("Closing ZkClient...");
getEventLock().lock();
try {
setShutdownTrigger(true);
_eventThread.interrupt();
_eventThread.join(2000);
... | java | public void close() throws ZkInterruptedException {
if (_connection == null) {
return;
}
LOG.debug("Closing ZkClient...");
getEventLock().lock();
try {
setShutdownTrigger(true);
_eventThread.interrupt();
_eventThread.join(2000);
... | [
"public",
"void",
"close",
"(",
")",
"throws",
"ZkInterruptedException",
"{",
"if",
"(",
"_connection",
"==",
"null",
")",
"{",
"return",
";",
"}",
"LOG",
".",
"debug",
"(",
"\"Closing ZkClient...\"",
")",
";",
"getEventLock",
"(",
")",
".",
"lock",
"(",
... | Close the client.
@throws ZkInterruptedException | [
"Close",
"the",
"client",
"."
] | c7b5f94a0dd162e01ddffaf3a63cade7d23fca55 | https://github.com/alibaba/otter/blob/c7b5f94a0dd162e01ddffaf3a63cade7d23fca55/shared/common/src/main/java/com/alibaba/otter/shared/common/utils/zookeeper/ZkClientx.java#L1010-L1028 |
130,159 | alibaba/otter | shared/arbitrate/src/main/java/com/alibaba/otter/shared/arbitrate/impl/zookeeper/ZooKeeperx.java | ZooKeeperx.createNoRetry | public String createNoRetry(final String path, final byte[] data, final CreateMode mode) throws KeeperException,
InterruptedException {
return zookeeper.create(path, data, acl, mode);
} | java | public String createNoRetry(final String path, final byte[] data, final CreateMode mode) throws KeeperException,
InterruptedException {
return zookeeper.create(path, data, acl, mode);
} | [
"public",
"String",
"createNoRetry",
"(",
"final",
"String",
"path",
",",
"final",
"byte",
"[",
"]",
"data",
",",
"final",
"CreateMode",
"mode",
")",
"throws",
"KeeperException",
",",
"InterruptedException",
"{",
"return",
"zookeeper",
".",
"create",
"(",
"pat... | add by ljh at 2012-09-13
<pre>
1. 使用zookeeper过程,针对出现ConnectionLoss异常,比如进行create/setData/delete,操作可能已经在zookeeper server上进行应用
2. 针对SelectStageListener进行processId创建时,会以最后一次创建的processId做为调度id. 如果进行retry,之前成功的processId就会被遗漏了
</pre>
@see org.apache.zookeeper.ZooKeeper#create(String path, byte[] path, List acl, CreateMode m... | [
"add",
"by",
"ljh",
"at",
"2012",
"-",
"09",
"-",
"13"
] | c7b5f94a0dd162e01ddffaf3a63cade7d23fca55 | https://github.com/alibaba/otter/blob/c7b5f94a0dd162e01ddffaf3a63cade7d23fca55/shared/arbitrate/src/main/java/com/alibaba/otter/shared/arbitrate/impl/zookeeper/ZooKeeperx.java#L75-L78 |
130,160 | alibaba/otter | shared/push/src/main/java/com/alibaba/otter/common/push/datasource/media/MediaPushDataSource.java | MediaPushDataSource.getParentLogger | public java.util.logging.Logger getParentLogger() throws SQLFeatureNotSupportedException {
try {
Method getParentLoggerMethod = CommonDataSource.class.getDeclaredMethod("getParentLogger", new Class<?>[0]);
return (java.util.logging.Logger) getParentLoggerMethod.invoke(delegate, new Objec... | java | public java.util.logging.Logger getParentLogger() throws SQLFeatureNotSupportedException {
try {
Method getParentLoggerMethod = CommonDataSource.class.getDeclaredMethod("getParentLogger", new Class<?>[0]);
return (java.util.logging.Logger) getParentLoggerMethod.invoke(delegate, new Objec... | [
"public",
"java",
".",
"util",
".",
"logging",
".",
"Logger",
"getParentLogger",
"(",
")",
"throws",
"SQLFeatureNotSupportedException",
"{",
"try",
"{",
"Method",
"getParentLoggerMethod",
"=",
"CommonDataSource",
".",
"class",
".",
"getDeclaredMethod",
"(",
"\"getPa... | implemented from JDK7 @see http://docs.oracle.com/javase/7/docs/api/javax/sql/CommonDataSource.html#getParentLogger() | [
"implemented",
"from",
"JDK7"
] | c7b5f94a0dd162e01ddffaf3a63cade7d23fca55 | https://github.com/alibaba/otter/blob/c7b5f94a0dd162e01ddffaf3a63cade7d23fca55/shared/push/src/main/java/com/alibaba/otter/common/push/datasource/media/MediaPushDataSource.java#L236-L249 |
130,161 | OpenFeign/feign | example-wikipedia/src/main/java/feign/example/wikipedia/WikipediaExample.java | WikipediaExample.lazySearch | static Iterator<Page> lazySearch(final Wikipedia wikipedia, final String query) {
final Response<Page> first = wikipedia.search(query);
if (first.nextOffset == null) {
return first.iterator();
}
return new Iterator<Page>() {
Iterator<Page> current = first.iterator();
Long nextOffset = ... | java | static Iterator<Page> lazySearch(final Wikipedia wikipedia, final String query) {
final Response<Page> first = wikipedia.search(query);
if (first.nextOffset == null) {
return first.iterator();
}
return new Iterator<Page>() {
Iterator<Page> current = first.iterator();
Long nextOffset = ... | [
"static",
"Iterator",
"<",
"Page",
">",
"lazySearch",
"(",
"final",
"Wikipedia",
"wikipedia",
",",
"final",
"String",
"query",
")",
"{",
"final",
"Response",
"<",
"Page",
">",
"first",
"=",
"wikipedia",
".",
"search",
"(",
"query",
")",
";",
"if",
"(",
... | this will lazily continue searches, making new http calls as necessary.
@param wikipedia used to search
@param query see {@link Wikipedia#search(String)}. | [
"this",
"will",
"lazily",
"continue",
"searches",
"making",
"new",
"http",
"calls",
"as",
"necessary",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/example-wikipedia/src/main/java/feign/example/wikipedia/WikipediaExample.java#L79-L109 |
130,162 | OpenFeign/feign | example-wikipedia/src/main/java/feign/example/wikipedia/ResponseAdapter.java | ResponseAdapter.read | @Override
public WikipediaExample.Response<X> read(JsonReader reader) throws IOException {
WikipediaExample.Response<X> pages = new WikipediaExample.Response<X>();
reader.beginObject();
while (reader.hasNext()) {
String nextName = reader.nextName();
if ("query".equals(nextName)) {
read... | java | @Override
public WikipediaExample.Response<X> read(JsonReader reader) throws IOException {
WikipediaExample.Response<X> pages = new WikipediaExample.Response<X>();
reader.beginObject();
while (reader.hasNext()) {
String nextName = reader.nextName();
if ("query".equals(nextName)) {
read... | [
"@",
"Override",
"public",
"WikipediaExample",
".",
"Response",
"<",
"X",
">",
"read",
"(",
"JsonReader",
"reader",
")",
"throws",
"IOException",
"{",
"WikipediaExample",
".",
"Response",
"<",
"X",
">",
"pages",
"=",
"new",
"WikipediaExample",
".",
"Response",... | the wikipedia api doesn't use json arrays, rather a series of nested objects. | [
"the",
"wikipedia",
"api",
"doesn",
"t",
"use",
"json",
"arrays",
"rather",
"a",
"series",
"of",
"nested",
"objects",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/example-wikipedia/src/main/java/feign/example/wikipedia/ResponseAdapter.java#L50-L91 |
130,163 | OpenFeign/feign | core/src/main/java/feign/template/HeaderTemplate.java | HeaderTemplate.append | public static HeaderTemplate append(HeaderTemplate headerTemplate, Iterable<String> values) {
Set<String> headerValues = new LinkedHashSet<>(headerTemplate.getValues());
headerValues.addAll(StreamSupport.stream(values.spliterator(), false)
.filter(Util::isNotBlank)
.collect(Collectors.toSet()));... | java | public static HeaderTemplate append(HeaderTemplate headerTemplate, Iterable<String> values) {
Set<String> headerValues = new LinkedHashSet<>(headerTemplate.getValues());
headerValues.addAll(StreamSupport.stream(values.spliterator(), false)
.filter(Util::isNotBlank)
.collect(Collectors.toSet()));... | [
"public",
"static",
"HeaderTemplate",
"append",
"(",
"HeaderTemplate",
"headerTemplate",
",",
"Iterable",
"<",
"String",
">",
"values",
")",
"{",
"Set",
"<",
"String",
">",
"headerValues",
"=",
"new",
"LinkedHashSet",
"<>",
"(",
"headerTemplate",
".",
"getValues... | Append values to a Header Template.
@param headerTemplate to append to.
@param values to append.
@return a new Header Template with the values added. | [
"Append",
"values",
"to",
"a",
"Header",
"Template",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/template/HeaderTemplate.java#L68-L74 |
130,164 | OpenFeign/feign | core/src/main/java/feign/template/Template.java | Template.expand | public String expand(Map<String, ?> variables) {
if (variables == null) {
throw new IllegalArgumentException("variable map is required.");
}
/* resolve all expressions within the template */
StringBuilder resolved = new StringBuilder();
for (TemplateChunk chunk : this.templateChunks) {
... | java | public String expand(Map<String, ?> variables) {
if (variables == null) {
throw new IllegalArgumentException("variable map is required.");
}
/* resolve all expressions within the template */
StringBuilder resolved = new StringBuilder();
for (TemplateChunk chunk : this.templateChunks) {
... | [
"public",
"String",
"expand",
"(",
"Map",
"<",
"String",
",",
"?",
">",
"variables",
")",
"{",
"if",
"(",
"variables",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"variable map is required.\"",
")",
";",
"}",
"/* resolve all expr... | Expand the template.
@param variables containing the values for expansion.
@return a fully qualified URI with the variables expanded. | [
"Expand",
"the",
"template",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/template/Template.java#L79-L98 |
130,165 | OpenFeign/feign | core/src/main/java/feign/template/Template.java | Template.getVariables | public List<String> getVariables() {
return this.templateChunks.stream()
.filter(templateChunk -> Expression.class.isAssignableFrom(templateChunk.getClass()))
.map(templateChunk -> ((Expression) templateChunk).getName())
.filter(Objects::nonNull)
.collect(Collectors.toList());
} | java | public List<String> getVariables() {
return this.templateChunks.stream()
.filter(templateChunk -> Expression.class.isAssignableFrom(templateChunk.getClass()))
.map(templateChunk -> ((Expression) templateChunk).getName())
.filter(Objects::nonNull)
.collect(Collectors.toList());
} | [
"public",
"List",
"<",
"String",
">",
"getVariables",
"(",
")",
"{",
"return",
"this",
".",
"templateChunks",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"templateChunk",
"->",
"Expression",
".",
"class",
".",
"isAssignableFrom",
"(",
"templateChunk",
".",
... | Variable names contained in the template.
@return a List of Variable Names. | [
"Variable",
"names",
"contained",
"in",
"the",
"template",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/template/Template.java#L152-L158 |
130,166 | OpenFeign/feign | core/src/main/java/feign/template/Template.java | Template.getLiterals | public List<String> getLiterals() {
return this.templateChunks.stream()
.filter(templateChunk -> Literal.class.isAssignableFrom(templateChunk.getClass()))
.map(TemplateChunk::toString)
.filter(Objects::nonNull)
.collect(Collectors.toList());
} | java | public List<String> getLiterals() {
return this.templateChunks.stream()
.filter(templateChunk -> Literal.class.isAssignableFrom(templateChunk.getClass()))
.map(TemplateChunk::toString)
.filter(Objects::nonNull)
.collect(Collectors.toList());
} | [
"public",
"List",
"<",
"String",
">",
"getLiterals",
"(",
")",
"{",
"return",
"this",
".",
"templateChunks",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"templateChunk",
"->",
"Literal",
".",
"class",
".",
"isAssignableFrom",
"(",
"templateChunk",
".",
"g... | List of all Literals in the Template.
@return list of Literal values. | [
"List",
"of",
"all",
"Literals",
"in",
"the",
"Template",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/template/Template.java#L165-L171 |
130,167 | OpenFeign/feign | core/src/main/java/feign/template/Template.java | Template.parseFragment | private void parseFragment(String fragment, boolean query) {
ChunkTokenizer tokenizer = new ChunkTokenizer(fragment);
while (tokenizer.hasNext()) {
/* check to see if we have an expression or a literal */
String chunk = tokenizer.next();
if (chunk.startsWith("{")) {
/* it's an expres... | java | private void parseFragment(String fragment, boolean query) {
ChunkTokenizer tokenizer = new ChunkTokenizer(fragment);
while (tokenizer.hasNext()) {
/* check to see if we have an expression or a literal */
String chunk = tokenizer.next();
if (chunk.startsWith("{")) {
/* it's an expres... | [
"private",
"void",
"parseFragment",
"(",
"String",
"fragment",
",",
"boolean",
"query",
")",
"{",
"ChunkTokenizer",
"tokenizer",
"=",
"new",
"ChunkTokenizer",
"(",
"fragment",
")",
";",
"while",
"(",
"tokenizer",
".",
"hasNext",
"(",
")",
")",
"{",
"/* check... | Parse a template fragment.
@param fragment to parse
@param query if the fragment is part of a query string. | [
"Parse",
"a",
"template",
"fragment",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/template/Template.java#L213-L235 |
130,168 | OpenFeign/feign | reactive/src/main/java/feign/reactive/ReactiveInvocationHandler.java | ReactiveInvocationHandler.invokeMethod | Callable<?> invokeMethod(MethodHandler methodHandler, Object[] arguments) {
return () -> {
try {
return methodHandler.invoke(arguments);
} catch (Throwable th) {
if (th instanceof FeignException) {
throw (FeignException) th;
}
throw new RuntimeException(th);
... | java | Callable<?> invokeMethod(MethodHandler methodHandler, Object[] arguments) {
return () -> {
try {
return methodHandler.invoke(arguments);
} catch (Throwable th) {
if (th instanceof FeignException) {
throw (FeignException) th;
}
throw new RuntimeException(th);
... | [
"Callable",
"<",
"?",
">",
"invokeMethod",
"(",
"MethodHandler",
"methodHandler",
",",
"Object",
"[",
"]",
"arguments",
")",
"{",
"return",
"(",
")",
"->",
"{",
"try",
"{",
"return",
"methodHandler",
".",
"invoke",
"(",
"arguments",
")",
";",
"}",
"catch... | Invoke the Method Handler as a Callable.
@param methodHandler to invoke
@param arguments for the method
@return a Callable wrapper for the invocation. | [
"Invoke",
"the",
"Method",
"Handler",
"as",
"a",
"Callable",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/reactive/src/main/java/feign/reactive/ReactiveInvocationHandler.java#L99-L110 |
130,169 | OpenFeign/feign | core/src/main/java/feign/template/Expression.java | Expression.matches | boolean matches(String value) {
if (pattern == null) {
return true;
}
return pattern.matcher(value).matches();
} | java | boolean matches(String value) {
if (pattern == null) {
return true;
}
return pattern.matcher(value).matches();
} | [
"boolean",
"matches",
"(",
"String",
"value",
")",
"{",
"if",
"(",
"pattern",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"return",
"pattern",
".",
"matcher",
"(",
"value",
")",
".",
"matches",
"(",
")",
";",
"}"
] | Checks if the provided value matches the variable pattern, if one is defined. Always true if no
pattern is defined.
@param value to check.
@return true if it matches. | [
"Checks",
"if",
"the",
"provided",
"value",
"matches",
"the",
"variable",
"pattern",
"if",
"one",
"is",
"defined",
".",
"Always",
"true",
"if",
"no",
"pattern",
"is",
"defined",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/template/Expression.java#L56-L61 |
130,170 | OpenFeign/feign | core/src/main/java/feign/template/UriTemplate.java | UriTemplate.append | public static UriTemplate append(UriTemplate uriTemplate, String fragment) {
return new UriTemplate(uriTemplate.toString() + fragment, uriTemplate.encodeSlash(),
uriTemplate.getCharset());
} | java | public static UriTemplate append(UriTemplate uriTemplate, String fragment) {
return new UriTemplate(uriTemplate.toString() + fragment, uriTemplate.encodeSlash(),
uriTemplate.getCharset());
} | [
"public",
"static",
"UriTemplate",
"append",
"(",
"UriTemplate",
"uriTemplate",
",",
"String",
"fragment",
")",
"{",
"return",
"new",
"UriTemplate",
"(",
"uriTemplate",
".",
"toString",
"(",
")",
"+",
"fragment",
",",
"uriTemplate",
".",
"encodeSlash",
"(",
")... | Append a uri fragment to the template.
@param uriTemplate to append to.
@param fragment to append.
@return a new UriTemplate with the fragment appended. | [
"Append",
"a",
"uri",
"fragment",
"to",
"the",
"template",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/template/UriTemplate.java#L60-L63 |
130,171 | OpenFeign/feign | reactive/src/main/java/feign/reactive/ReactiveDelegatingContract.java | ReactiveDelegatingContract.isReactive | private boolean isReactive(Type type) {
if (!ParameterizedType.class.isAssignableFrom(type.getClass())) {
return false;
}
ParameterizedType parameterizedType = (ParameterizedType) type;
Type raw = parameterizedType.getRawType();
return Arrays.asList(((Class) raw).getInterfaces())
.cont... | java | private boolean isReactive(Type type) {
if (!ParameterizedType.class.isAssignableFrom(type.getClass())) {
return false;
}
ParameterizedType parameterizedType = (ParameterizedType) type;
Type raw = parameterizedType.getRawType();
return Arrays.asList(((Class) raw).getInterfaces())
.cont... | [
"private",
"boolean",
"isReactive",
"(",
"Type",
"type",
")",
"{",
"if",
"(",
"!",
"ParameterizedType",
".",
"class",
".",
"isAssignableFrom",
"(",
"type",
".",
"getClass",
"(",
")",
")",
")",
"{",
"return",
"false",
";",
"}",
"ParameterizedType",
"paramet... | Ensure that the type provided implements a Reactive Streams Publisher.
@param type to inspect.
@return true if the type implements the Reactive Streams Publisher specification. | [
"Ensure",
"that",
"the",
"type",
"provided",
"implements",
"a",
"Reactive",
"Streams",
"Publisher",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/reactive/src/main/java/feign/reactive/ReactiveDelegatingContract.java#L72-L80 |
130,172 | OpenFeign/feign | core/src/main/java/feign/template/UriUtils.java | UriUtils.encode | public static String encode(String value) {
return encodeReserved(value, FragmentType.URI, Util.UTF_8);
} | java | public static String encode(String value) {
return encodeReserved(value, FragmentType.URI, Util.UTF_8);
} | [
"public",
"static",
"String",
"encode",
"(",
"String",
"value",
")",
"{",
"return",
"encodeReserved",
"(",
"value",
",",
"FragmentType",
".",
"URI",
",",
"Util",
".",
"UTF_8",
")",
";",
"}"
] | Uri Encode the value, using the default Charset. Already encoded values are skipped.
@param value to encode.
@return the encoded value. | [
"Uri",
"Encode",
"the",
"value",
"using",
"the",
"default",
"Charset",
".",
"Already",
"encoded",
"values",
"are",
"skipped",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/template/UriUtils.java#L47-L49 |
130,173 | OpenFeign/feign | core/src/main/java/feign/template/UriUtils.java | UriUtils.encode | public static String encode(String value, Charset charset) {
return encodeReserved(value, FragmentType.URI, charset);
} | java | public static String encode(String value, Charset charset) {
return encodeReserved(value, FragmentType.URI, charset);
} | [
"public",
"static",
"String",
"encode",
"(",
"String",
"value",
",",
"Charset",
"charset",
")",
"{",
"return",
"encodeReserved",
"(",
"value",
",",
"FragmentType",
".",
"URI",
",",
"charset",
")",
";",
"}"
] | Uri Encode the value. Already encoded values are skipped.
@param value to encode.
@param charset to use.
@return the encoded value. | [
"Uri",
"Encode",
"the",
"value",
".",
"Already",
"encoded",
"values",
"are",
"skipped",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/template/UriUtils.java#L58-L60 |
130,174 | OpenFeign/feign | core/src/main/java/feign/template/UriUtils.java | UriUtils.decode | public static String decode(String value, Charset charset) {
try {
/* there is nothing special between uri and url decoding */
return URLDecoder.decode(value, charset.name());
} catch (UnsupportedEncodingException uee) {
/* since the encoding is not supported, return the original value */
... | java | public static String decode(String value, Charset charset) {
try {
/* there is nothing special between uri and url decoding */
return URLDecoder.decode(value, charset.name());
} catch (UnsupportedEncodingException uee) {
/* since the encoding is not supported, return the original value */
... | [
"public",
"static",
"String",
"decode",
"(",
"String",
"value",
",",
"Charset",
"charset",
")",
"{",
"try",
"{",
"/* there is nothing special between uri and url decoding */",
"return",
"URLDecoder",
".",
"decode",
"(",
"value",
",",
"charset",
".",
"name",
"(",
"... | Uri Decode the value.
@param value to decode
@param charset to use.
@return the decoded value. | [
"Uri",
"Decode",
"the",
"value",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/template/UriUtils.java#L69-L77 |
130,175 | OpenFeign/feign | core/src/main/java/feign/template/UriUtils.java | UriUtils.pathEncode | public static String pathEncode(String path, Charset charset) {
return encodeReserved(path, FragmentType.PATH_SEGMENT, charset);
/*
* path encoding is not equivalent to query encoding, there are few differences, namely dealing
* with spaces, !, ', (, ), and ~ characters. we will need to manually proc... | java | public static String pathEncode(String path, Charset charset) {
return encodeReserved(path, FragmentType.PATH_SEGMENT, charset);
/*
* path encoding is not equivalent to query encoding, there are few differences, namely dealing
* with spaces, !, ', (, ), and ~ characters. we will need to manually proc... | [
"public",
"static",
"String",
"pathEncode",
"(",
"String",
"path",
",",
"Charset",
"charset",
")",
"{",
"return",
"encodeReserved",
"(",
"path",
",",
"FragmentType",
".",
"PATH_SEGMENT",
",",
"charset",
")",
";",
"/*\n * path encoding is not equivalent to query en... | Uri Encode a Path Fragment.
@param path containing the path fragment.
@param charset to use.
@return the encoded path fragment. | [
"Uri",
"Encode",
"a",
"Path",
"Fragment",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/template/UriUtils.java#L86-L94 |
130,176 | OpenFeign/feign | core/src/main/java/feign/template/UriUtils.java | UriUtils.queryEncode | public static String queryEncode(String query, Charset charset) {
return encodeReserved(query, FragmentType.QUERY, charset);
/* spaces will be encoded as 'plus' symbols here, we want them pct-encoded */
// return encoded.replaceAll("\\+", "%20");
} | java | public static String queryEncode(String query, Charset charset) {
return encodeReserved(query, FragmentType.QUERY, charset);
/* spaces will be encoded as 'plus' symbols here, we want them pct-encoded */
// return encoded.replaceAll("\\+", "%20");
} | [
"public",
"static",
"String",
"queryEncode",
"(",
"String",
"query",
",",
"Charset",
"charset",
")",
"{",
"return",
"encodeReserved",
"(",
"query",
",",
"FragmentType",
".",
"QUERY",
",",
"charset",
")",
";",
"/* spaces will be encoded as 'plus' symbols here, we want ... | Uri Encode a Query Fragment.
@param query containing the query fragment
@param charset to use.
@return the encoded query fragment. | [
"Uri",
"Encode",
"a",
"Query",
"Fragment",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/template/UriUtils.java#L103-L108 |
130,177 | OpenFeign/feign | core/src/main/java/feign/template/UriUtils.java | UriUtils.queryParamEncode | public static String queryParamEncode(String queryParam, Charset charset) {
return encodeReserved(queryParam, FragmentType.QUERY_PARAM, charset);
} | java | public static String queryParamEncode(String queryParam, Charset charset) {
return encodeReserved(queryParam, FragmentType.QUERY_PARAM, charset);
} | [
"public",
"static",
"String",
"queryParamEncode",
"(",
"String",
"queryParam",
",",
"Charset",
"charset",
")",
"{",
"return",
"encodeReserved",
"(",
"queryParam",
",",
"FragmentType",
".",
"QUERY_PARAM",
",",
"charset",
")",
";",
"}"
] | Uri Encode a Query Parameter name or value.
@param queryParam containing the query parameter.
@param charset to use.
@return the encoded query fragment. | [
"Uri",
"Encode",
"a",
"Query",
"Parameter",
"name",
"or",
"value",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/template/UriUtils.java#L117-L119 |
130,178 | OpenFeign/feign | core/src/main/java/feign/template/UriUtils.java | UriUtils.encodeReserved | public static String encodeReserved(String value, FragmentType type, Charset charset) {
/* value is encoded, we need to split it up and skip the parts that are already encoded */
Matcher matcher = PCT_ENCODED_PATTERN.matcher(value);
if (!matcher.find()) {
return encodeChunk(value, type, charset);
... | java | public static String encodeReserved(String value, FragmentType type, Charset charset) {
/* value is encoded, we need to split it up and skip the parts that are already encoded */
Matcher matcher = PCT_ENCODED_PATTERN.matcher(value);
if (!matcher.find()) {
return encodeChunk(value, type, charset);
... | [
"public",
"static",
"String",
"encodeReserved",
"(",
"String",
"value",
",",
"FragmentType",
"type",
",",
"Charset",
"charset",
")",
"{",
"/* value is encoded, we need to split it up and skip the parts that are already encoded */",
"Matcher",
"matcher",
"=",
"PCT_ENCODED_PATTER... | Encodes the value, preserving all reserved characters.. Values that are already pct-encoded are
ignored.
@param value inspect.
@param type identifying which uri fragment rules to apply.
@param charset to use.
@return a new String with the reserved characters preserved. | [
"Encodes",
"the",
"value",
"preserving",
"all",
"reserved",
"characters",
"..",
"Values",
"that",
"are",
"already",
"pct",
"-",
"encoded",
"are",
"ignored",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/template/UriUtils.java#L141-L170 |
130,179 | OpenFeign/feign | core/src/main/java/feign/template/UriUtils.java | UriUtils.encodeChunk | private static String encodeChunk(String value, FragmentType type, Charset charset) {
byte[] data = value.getBytes(charset);
ByteArrayOutputStream encoded = new ByteArrayOutputStream();
for (byte b : data) {
if (type.isAllowed(b)) {
encoded.write(b);
} else {
/* percent encode t... | java | private static String encodeChunk(String value, FragmentType type, Charset charset) {
byte[] data = value.getBytes(charset);
ByteArrayOutputStream encoded = new ByteArrayOutputStream();
for (byte b : data) {
if (type.isAllowed(b)) {
encoded.write(b);
} else {
/* percent encode t... | [
"private",
"static",
"String",
"encodeChunk",
"(",
"String",
"value",
",",
"FragmentType",
"type",
",",
"Charset",
"charset",
")",
"{",
"byte",
"[",
"]",
"data",
"=",
"value",
".",
"getBytes",
"(",
"charset",
")",
";",
"ByteArrayOutputStream",
"encoded",
"="... | Encode a Uri Chunk, ensuring that all reserved characters are also encoded.
@param value to encode.
@param type identifying which uri fragment rules to apply.
@param charset to use.
@return an encoded uri chunk. | [
"Encode",
"a",
"Uri",
"Chunk",
"ensuring",
"that",
"all",
"reserved",
"characters",
"are",
"also",
"encoded",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/template/UriUtils.java#L180-L193 |
130,180 | OpenFeign/feign | core/src/main/java/feign/template/UriUtils.java | UriUtils.pctEncode | private static void pctEncode(byte data, ByteArrayOutputStream bos) {
bos.write('%');
char hex1 = Character.toUpperCase(Character.forDigit((data >> 4) & 0xF, 16));
char hex2 = Character.toUpperCase(Character.forDigit(data & 0xF, 16));
bos.write(hex1);
bos.write(hex2);
} | java | private static void pctEncode(byte data, ByteArrayOutputStream bos) {
bos.write('%');
char hex1 = Character.toUpperCase(Character.forDigit((data >> 4) & 0xF, 16));
char hex2 = Character.toUpperCase(Character.forDigit(data & 0xF, 16));
bos.write(hex1);
bos.write(hex2);
} | [
"private",
"static",
"void",
"pctEncode",
"(",
"byte",
"data",
",",
"ByteArrayOutputStream",
"bos",
")",
"{",
"bos",
".",
"write",
"(",
"'",
"'",
")",
";",
"char",
"hex1",
"=",
"Character",
".",
"toUpperCase",
"(",
"Character",
".",
"forDigit",
"(",
"(",... | Percent Encode the provided byte.
@param data to encode
@param bos with the output stream to use. | [
"Percent",
"Encode",
"the",
"provided",
"byte",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/template/UriUtils.java#L201-L207 |
130,181 | OpenFeign/feign | core/src/main/java/feign/RequestTemplate.java | RequestTemplate.from | public static RequestTemplate from(RequestTemplate requestTemplate) {
RequestTemplate template =
new RequestTemplate(requestTemplate.target, requestTemplate.fragment,
requestTemplate.uriTemplate,
requestTemplate.method, requestTemplate.charset,
requestTemplate.body, reque... | java | public static RequestTemplate from(RequestTemplate requestTemplate) {
RequestTemplate template =
new RequestTemplate(requestTemplate.target, requestTemplate.fragment,
requestTemplate.uriTemplate,
requestTemplate.method, requestTemplate.charset,
requestTemplate.body, reque... | [
"public",
"static",
"RequestTemplate",
"from",
"(",
"RequestTemplate",
"requestTemplate",
")",
"{",
"RequestTemplate",
"template",
"=",
"new",
"RequestTemplate",
"(",
"requestTemplate",
".",
"target",
",",
"requestTemplate",
".",
"fragment",
",",
"requestTemplate",
".... | Create a Request Template from an existing Request Template.
@param requestTemplate to copy from.
@return a new Request Template. | [
"Create",
"a",
"Request",
"Template",
"from",
"an",
"existing",
"Request",
"Template",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/RequestTemplate.java#L98-L113 |
130,182 | OpenFeign/feign | core/src/main/java/feign/RequestTemplate.java | RequestTemplate.resolve | public RequestTemplate resolve(Map<String, ?> variables) {
StringBuilder uri = new StringBuilder();
/* create a new template form this one, but explicitly */
RequestTemplate resolved = RequestTemplate.from(this);
if (this.uriTemplate == null) {
/* create a new uri template using the default roo... | java | public RequestTemplate resolve(Map<String, ?> variables) {
StringBuilder uri = new StringBuilder();
/* create a new template form this one, but explicitly */
RequestTemplate resolved = RequestTemplate.from(this);
if (this.uriTemplate == null) {
/* create a new uri template using the default roo... | [
"public",
"RequestTemplate",
"resolve",
"(",
"Map",
"<",
"String",
",",
"?",
">",
"variables",
")",
"{",
"StringBuilder",
"uri",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"/* create a new template form this one, but explicitly */",
"RequestTemplate",
"resolved",
"="... | Resolve all expressions using the variable value substitutions provided. Variable values will
be pct-encoded, if they are not already.
@param variables containing the variable values to use when resolving expressions.
@return a new Request Template with all of the variables resolved. | [
"Resolve",
"all",
"expressions",
"using",
"the",
"variable",
"value",
"substitutions",
"provided",
".",
"Variable",
"values",
"will",
"be",
"pct",
"-",
"encoded",
"if",
"they",
"are",
"not",
"already",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/RequestTemplate.java#L145-L223 |
130,183 | OpenFeign/feign | core/src/main/java/feign/RequestTemplate.java | RequestTemplate.method | @Deprecated
public RequestTemplate method(String method) {
checkNotNull(method, "method");
try {
this.method = HttpMethod.valueOf(method);
} catch (IllegalArgumentException iae) {
throw new IllegalArgumentException("Invalid HTTP Method: " + method);
}
return this;
} | java | @Deprecated
public RequestTemplate method(String method) {
checkNotNull(method, "method");
try {
this.method = HttpMethod.valueOf(method);
} catch (IllegalArgumentException iae) {
throw new IllegalArgumentException("Invalid HTTP Method: " + method);
}
return this;
} | [
"@",
"Deprecated",
"public",
"RequestTemplate",
"method",
"(",
"String",
"method",
")",
"{",
"checkNotNull",
"(",
"method",
",",
"\"method\"",
")",
";",
"try",
"{",
"this",
".",
"method",
"=",
"HttpMethod",
".",
"valueOf",
"(",
"method",
")",
";",
"}",
"... | Set the Http Method.
@param method to use.
@return a RequestTemplate for chaining.
@deprecated see {@link RequestTemplate#method(HttpMethod)} | [
"Set",
"the",
"Http",
"Method",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/RequestTemplate.java#L262-L271 |
130,184 | OpenFeign/feign | core/src/main/java/feign/RequestTemplate.java | RequestTemplate.uri | public RequestTemplate uri(String uri, boolean append) {
/* validate and ensure that the url is always a relative one */
if (UriUtils.isAbsolute(uri)) {
throw new IllegalArgumentException("url values must be not be absolute.");
}
if (uri == null) {
uri = "/";
} else if ((!uri.isEmpty() ... | java | public RequestTemplate uri(String uri, boolean append) {
/* validate and ensure that the url is always a relative one */
if (UriUtils.isAbsolute(uri)) {
throw new IllegalArgumentException("url values must be not be absolute.");
}
if (uri == null) {
uri = "/";
} else if ((!uri.isEmpty() ... | [
"public",
"RequestTemplate",
"uri",
"(",
"String",
"uri",
",",
"boolean",
"append",
")",
"{",
"/* validate and ensure that the url is always a relative one */",
"if",
"(",
"UriUtils",
".",
"isAbsolute",
"(",
"uri",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentExcept... | Set the uri for the request.
@param uri to use, must be a relative uri.
@param append if the uri should be appended, if the uri is already set.
@return a RequestTemplate for chaining. | [
"Set",
"the",
"uri",
"for",
"the",
"request",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/RequestTemplate.java#L400-L442 |
130,185 | OpenFeign/feign | core/src/main/java/feign/RequestTemplate.java | RequestTemplate.target | public RequestTemplate target(String target) {
/* target can be empty */
if (Util.isBlank(target)) {
return this;
}
/* verify that the target contains the scheme, host and port */
if (!UriUtils.isAbsolute(target)) {
throw new IllegalArgumentException("target values must be absolute.");
... | java | public RequestTemplate target(String target) {
/* target can be empty */
if (Util.isBlank(target)) {
return this;
}
/* verify that the target contains the scheme, host and port */
if (!UriUtils.isAbsolute(target)) {
throw new IllegalArgumentException("target values must be absolute.");
... | [
"public",
"RequestTemplate",
"target",
"(",
"String",
"target",
")",
"{",
"/* target can be empty */",
"if",
"(",
"Util",
".",
"isBlank",
"(",
"target",
")",
")",
"{",
"return",
"this",
";",
"}",
"/* verify that the target contains the scheme, host and port */",
"if",... | Set the target host for this request.
@param target host for this request. Must be an absolute target.
@return a RequestTemplate for chaining. | [
"Set",
"the",
"target",
"host",
"for",
"this",
"request",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/RequestTemplate.java#L450-L484 |
130,186 | OpenFeign/feign | core/src/main/java/feign/RequestTemplate.java | RequestTemplate.url | public String url() {
/* build the fully qualified url with all query parameters */
StringBuilder url = new StringBuilder(this.path());
if (!this.queries.isEmpty()) {
url.append(this.queryLine());
}
if (fragment != null) {
url.append(fragment);
}
return url.toString();
} | java | public String url() {
/* build the fully qualified url with all query parameters */
StringBuilder url = new StringBuilder(this.path());
if (!this.queries.isEmpty()) {
url.append(this.queryLine());
}
if (fragment != null) {
url.append(fragment);
}
return url.toString();
} | [
"public",
"String",
"url",
"(",
")",
"{",
"/* build the fully qualified url with all query parameters */",
"StringBuilder",
"url",
"=",
"new",
"StringBuilder",
"(",
"this",
".",
"path",
"(",
")",
")",
";",
"if",
"(",
"!",
"this",
".",
"queries",
".",
"isEmpty",
... | The URL for the request. If the template has not been resolved, the url will represent a uri
template.
@return the url | [
"The",
"URL",
"for",
"the",
"request",
".",
"If",
"the",
"template",
"has",
"not",
"been",
"resolved",
"the",
"url",
"will",
"represent",
"a",
"uri",
"template",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/RequestTemplate.java#L492-L504 |
130,187 | OpenFeign/feign | core/src/main/java/feign/RequestTemplate.java | RequestTemplate.path | public String path() {
/* build the fully qualified url with all query parameters */
StringBuilder path = new StringBuilder();
if (this.target != null) {
path.append(this.target);
}
if (this.uriTemplate != null) {
path.append(this.uriTemplate.toString());
}
if (path.length() == 0... | java | public String path() {
/* build the fully qualified url with all query parameters */
StringBuilder path = new StringBuilder();
if (this.target != null) {
path.append(this.target);
}
if (this.uriTemplate != null) {
path.append(this.uriTemplate.toString());
}
if (path.length() == 0... | [
"public",
"String",
"path",
"(",
")",
"{",
"/* build the fully qualified url with all query parameters */",
"StringBuilder",
"path",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"this",
".",
"target",
"!=",
"null",
")",
"{",
"path",
".",
"append",
"(",... | The Uri Path.
@return the uri path. | [
"The",
"Uri",
"Path",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/RequestTemplate.java#L511-L526 |
130,188 | OpenFeign/feign | core/src/main/java/feign/RequestTemplate.java | RequestTemplate.variables | public List<String> variables() {
/* combine the variables from the uri, query, header, and body templates */
List<String> variables = new ArrayList<>(this.uriTemplate.getVariables());
/* queries */
for (QueryTemplate queryTemplate : this.queries.values()) {
variables.addAll(queryTemplate.getVari... | java | public List<String> variables() {
/* combine the variables from the uri, query, header, and body templates */
List<String> variables = new ArrayList<>(this.uriTemplate.getVariables());
/* queries */
for (QueryTemplate queryTemplate : this.queries.values()) {
variables.addAll(queryTemplate.getVari... | [
"public",
"List",
"<",
"String",
">",
"variables",
"(",
")",
"{",
"/* combine the variables from the uri, query, header, and body templates */",
"List",
"<",
"String",
">",
"variables",
"=",
"new",
"ArrayList",
"<>",
"(",
"this",
".",
"uriTemplate",
".",
"getVariables... | List all of the template variable expressions for this template.
@return a list of template variable names | [
"List",
"all",
"of",
"the",
"template",
"variable",
"expressions",
"for",
"this",
"template",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/RequestTemplate.java#L533-L551 |
130,189 | OpenFeign/feign | core/src/main/java/feign/RequestTemplate.java | RequestTemplate.query | public RequestTemplate query(String name, Iterable<String> values) {
return appendQuery(name, values, this.collectionFormat);
} | java | public RequestTemplate query(String name, Iterable<String> values) {
return appendQuery(name, values, this.collectionFormat);
} | [
"public",
"RequestTemplate",
"query",
"(",
"String",
"name",
",",
"Iterable",
"<",
"String",
">",
"values",
")",
"{",
"return",
"appendQuery",
"(",
"name",
",",
"values",
",",
"this",
".",
"collectionFormat",
")",
";",
"}"
] | Specify a Query String parameter, with the specified values. Values can be literals or template
expressions.
@param name of the parameter.
@param values for this parameter.
@return a RequestTemplate for chaining. | [
"Specify",
"a",
"Query",
"String",
"parameter",
"with",
"the",
"specified",
"values",
".",
"Values",
"can",
"be",
"literals",
"or",
"template",
"expressions",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/RequestTemplate.java#L572-L574 |
130,190 | OpenFeign/feign | core/src/main/java/feign/RequestTemplate.java | RequestTemplate.appendQuery | private RequestTemplate appendQuery(String name,
Iterable<String> values,
CollectionFormat collectionFormat) {
if (!values.iterator().hasNext()) {
/* empty value, clear the existing values */
this.queries.remove(name);
ret... | java | private RequestTemplate appendQuery(String name,
Iterable<String> values,
CollectionFormat collectionFormat) {
if (!values.iterator().hasNext()) {
/* empty value, clear the existing values */
this.queries.remove(name);
ret... | [
"private",
"RequestTemplate",
"appendQuery",
"(",
"String",
"name",
",",
"Iterable",
"<",
"String",
">",
"values",
",",
"CollectionFormat",
"collectionFormat",
")",
"{",
"if",
"(",
"!",
"values",
".",
"iterator",
"(",
")",
".",
"hasNext",
"(",
")",
")",
"{... | Appends the query name and values.
@param name of the parameter.
@param values for the parameter, may be expressions.
@param collectionFormat to use when resolving collection based query variables.
@return a RequestTemplate for chaining. | [
"Appends",
"the",
"query",
"name",
"and",
"values",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/RequestTemplate.java#L599-L617 |
130,191 | OpenFeign/feign | core/src/main/java/feign/RequestTemplate.java | RequestTemplate.queries | @SuppressWarnings("unused")
public RequestTemplate queries(Map<String, Collection<String>> queries) {
if (queries == null || queries.isEmpty()) {
this.queries.clear();
} else {
queries.forEach(this::query);
}
return this;
} | java | @SuppressWarnings("unused")
public RequestTemplate queries(Map<String, Collection<String>> queries) {
if (queries == null || queries.isEmpty()) {
this.queries.clear();
} else {
queries.forEach(this::query);
}
return this;
} | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"public",
"RequestTemplate",
"queries",
"(",
"Map",
"<",
"String",
",",
"Collection",
"<",
"String",
">",
">",
"queries",
")",
"{",
"if",
"(",
"queries",
"==",
"null",
"||",
"queries",
".",
"isEmpty",
"(",
... | Sets the Query Parameters.
@param queries to use for this request.
@return a RequestTemplate for chaining. | [
"Sets",
"the",
"Query",
"Parameters",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/RequestTemplate.java#L625-L633 |
130,192 | OpenFeign/feign | core/src/main/java/feign/RequestTemplate.java | RequestTemplate.queries | public Map<String, Collection<String>> queries() {
Map<String, Collection<String>> queryMap = new LinkedHashMap<>();
this.queries.forEach((key, queryTemplate) -> {
List<String> values = new ArrayList<>(queryTemplate.getValues());
/* add the expanded collection, but lock it */
queryMap.put(key... | java | public Map<String, Collection<String>> queries() {
Map<String, Collection<String>> queryMap = new LinkedHashMap<>();
this.queries.forEach((key, queryTemplate) -> {
List<String> values = new ArrayList<>(queryTemplate.getValues());
/* add the expanded collection, but lock it */
queryMap.put(key... | [
"public",
"Map",
"<",
"String",
",",
"Collection",
"<",
"String",
">",
">",
"queries",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"Collection",
"<",
"String",
">",
">",
"queryMap",
"=",
"new",
"LinkedHashMap",
"<>",
"(",
")",
";",
"this",
".",
"querie... | Return an immutable Map of all Query Parameters and their values.
@return registered Query Parameters. | [
"Return",
"an",
"immutable",
"Map",
"of",
"all",
"Query",
"Parameters",
"and",
"their",
"values",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/RequestTemplate.java#L641-L651 |
130,193 | OpenFeign/feign | core/src/main/java/feign/RequestTemplate.java | RequestTemplate.header | public RequestTemplate header(String name, Iterable<String> values) {
if (name == null || name.isEmpty()) {
throw new IllegalArgumentException("name is required.");
}
if (values == null) {
values = Collections.emptyList();
}
return appendHeader(name, values);
} | java | public RequestTemplate header(String name, Iterable<String> values) {
if (name == null || name.isEmpty()) {
throw new IllegalArgumentException("name is required.");
}
if (values == null) {
values = Collections.emptyList();
}
return appendHeader(name, values);
} | [
"public",
"RequestTemplate",
"header",
"(",
"String",
"name",
",",
"Iterable",
"<",
"String",
">",
"values",
")",
"{",
"if",
"(",
"name",
"==",
"null",
"||",
"name",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"... | Specify a Header, with the specified values. Values can be literals or template expressions.
@param name of the header.
@param values for this header.
@return a RequestTemplate for chaining. | [
"Specify",
"a",
"Header",
"with",
"the",
"specified",
"values",
".",
"Values",
"can",
"be",
"literals",
"or",
"template",
"expressions",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/RequestTemplate.java#L667-L676 |
130,194 | OpenFeign/feign | core/src/main/java/feign/RequestTemplate.java | RequestTemplate.appendHeader | private RequestTemplate appendHeader(String name, Iterable<String> values) {
if (!values.iterator().hasNext()) {
/* empty value, clear the existing values */
this.headers.remove(name);
return this;
}
this.headers.compute(name, (headerName, headerTemplate) -> {
if (headerTemplate == n... | java | private RequestTemplate appendHeader(String name, Iterable<String> values) {
if (!values.iterator().hasNext()) {
/* empty value, clear the existing values */
this.headers.remove(name);
return this;
}
this.headers.compute(name, (headerName, headerTemplate) -> {
if (headerTemplate == n... | [
"private",
"RequestTemplate",
"appendHeader",
"(",
"String",
"name",
",",
"Iterable",
"<",
"String",
">",
"values",
")",
"{",
"if",
"(",
"!",
"values",
".",
"iterator",
"(",
")",
".",
"hasNext",
"(",
")",
")",
"{",
"/* empty value, clear the existing values */... | Create a Header Template.
@param name of the header
@param values for the header, may be expressions.
@return a RequestTemplate for chaining. | [
"Create",
"a",
"Header",
"Template",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/RequestTemplate.java#L685-L699 |
130,195 | OpenFeign/feign | core/src/main/java/feign/RequestTemplate.java | RequestTemplate.headers | public RequestTemplate headers(Map<String, Collection<String>> headers) {
if (headers != null && !headers.isEmpty()) {
headers.forEach(this::header);
} else {
this.headers.clear();
}
return this;
} | java | public RequestTemplate headers(Map<String, Collection<String>> headers) {
if (headers != null && !headers.isEmpty()) {
headers.forEach(this::header);
} else {
this.headers.clear();
}
return this;
} | [
"public",
"RequestTemplate",
"headers",
"(",
"Map",
"<",
"String",
",",
"Collection",
"<",
"String",
">",
">",
"headers",
")",
"{",
"if",
"(",
"headers",
"!=",
"null",
"&&",
"!",
"headers",
".",
"isEmpty",
"(",
")",
")",
"{",
"headers",
".",
"forEach",... | Headers for this Request.
@param headers to use.
@return a RequestTemplate for chaining. | [
"Headers",
"for",
"this",
"Request",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/RequestTemplate.java#L707-L714 |
130,196 | OpenFeign/feign | core/src/main/java/feign/RequestTemplate.java | RequestTemplate.headers | public Map<String, Collection<String>> headers() {
Map<String, Collection<String>> headerMap = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
this.headers.forEach((key, headerTemplate) -> {
List<String> values = new ArrayList<>(headerTemplate.getValues());
/* add the expanded collection, but only if... | java | public Map<String, Collection<String>> headers() {
Map<String, Collection<String>> headerMap = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
this.headers.forEach((key, headerTemplate) -> {
List<String> values = new ArrayList<>(headerTemplate.getValues());
/* add the expanded collection, but only if... | [
"public",
"Map",
"<",
"String",
",",
"Collection",
"<",
"String",
">",
">",
"headers",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"Collection",
"<",
"String",
">",
">",
"headerMap",
"=",
"new",
"TreeMap",
"<>",
"(",
"String",
".",
"CASE_INSENSITIVE_ORDER"... | Returns an immutable copy of the Headers for this request.
@return the currently applied headers. | [
"Returns",
"an",
"immutable",
"copy",
"of",
"the",
"Headers",
"for",
"this",
"request",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/RequestTemplate.java#L721-L732 |
130,197 | OpenFeign/feign | core/src/main/java/feign/RequestTemplate.java | RequestTemplate.body | @Deprecated
public RequestTemplate body(byte[] bodyData, Charset charset) {
this.body(Request.Body.encoded(bodyData, charset));
return this;
} | java | @Deprecated
public RequestTemplate body(byte[] bodyData, Charset charset) {
this.body(Request.Body.encoded(bodyData, charset));
return this;
} | [
"@",
"Deprecated",
"public",
"RequestTemplate",
"body",
"(",
"byte",
"[",
"]",
"bodyData",
",",
"Charset",
"charset",
")",
"{",
"this",
".",
"body",
"(",
"Request",
".",
"Body",
".",
"encoded",
"(",
"bodyData",
",",
"charset",
")",
")",
";",
"return",
... | Sets the Body and Charset for this request.
@param bodyData to send, can be null.
@param charset of the encoded data.
@return a RequestTemplate for chaining.
@deprecated use {@link RequestTemplate#body(feign.Request.Body)} instead | [
"Sets",
"the",
"Body",
"and",
"Charset",
"for",
"this",
"request",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/RequestTemplate.java#L742-L747 |
130,198 | OpenFeign/feign | core/src/main/java/feign/RequestTemplate.java | RequestTemplate.body | @Deprecated
public RequestTemplate body(String bodyText) {
byte[] bodyData = bodyText != null ? bodyText.getBytes(UTF_8) : null;
return body(bodyData, UTF_8);
} | java | @Deprecated
public RequestTemplate body(String bodyText) {
byte[] bodyData = bodyText != null ? bodyText.getBytes(UTF_8) : null;
return body(bodyData, UTF_8);
} | [
"@",
"Deprecated",
"public",
"RequestTemplate",
"body",
"(",
"String",
"bodyText",
")",
"{",
"byte",
"[",
"]",
"bodyData",
"=",
"bodyText",
"!=",
"null",
"?",
"bodyText",
".",
"getBytes",
"(",
"UTF_8",
")",
":",
"null",
";",
"return",
"body",
"(",
"bodyD... | Set the Body for this request. Charset is assumed to be UTF_8. Data must be encoded.
@param bodyText to send.
@return a RequestTemplate for chaining.
@deprecated use {@link RequestTemplate#body(feign.Request.Body)} instead | [
"Set",
"the",
"Body",
"for",
"this",
"request",
".",
"Charset",
"is",
"assumed",
"to",
"be",
"UTF_8",
".",
"Data",
"must",
"be",
"encoded",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/RequestTemplate.java#L756-L760 |
130,199 | OpenFeign/feign | core/src/main/java/feign/RequestTemplate.java | RequestTemplate.body | public RequestTemplate body(Request.Body body) {
this.body = body;
header(CONTENT_LENGTH);
if (body.length() > 0) {
header(CONTENT_LENGTH, String.valueOf(body.length()));
}
return this;
} | java | public RequestTemplate body(Request.Body body) {
this.body = body;
header(CONTENT_LENGTH);
if (body.length() > 0) {
header(CONTENT_LENGTH, String.valueOf(body.length()));
}
return this;
} | [
"public",
"RequestTemplate",
"body",
"(",
"Request",
".",
"Body",
"body",
")",
"{",
"this",
".",
"body",
"=",
"body",
";",
"header",
"(",
"CONTENT_LENGTH",
")",
";",
"if",
"(",
"body",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"header",
"(",
"CO... | Set the Body for this request.
@param body to send.
@return a RequestTemplate for chaining. | [
"Set",
"the",
"Body",
"for",
"this",
"request",
"."
] | 318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/RequestTemplate.java#L768-L777 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.