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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
19,400 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/broker/kafka/KafkaProperties.java | KafkaProperties.partitionKeyStrategy | @SuppressWarnings("unchecked")
public static <Message> Descriptor.Properties.Property<Message, PartitionKeyStrategy<Message>> partitionKeyStrategy() {
return PARTITION_KEY_STRATEGY;
} | java | @SuppressWarnings("unchecked")
public static <Message> Descriptor.Properties.Property<Message, PartitionKeyStrategy<Message>> partitionKeyStrategy() {
return PARTITION_KEY_STRATEGY;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"Message",
">",
"Descriptor",
".",
"Properties",
".",
"Property",
"<",
"Message",
",",
"PartitionKeyStrategy",
"<",
"Message",
">",
">",
"partitionKeyStrategy",
"(",
")",
"{",
"return",... | A PartitionKeyStrategy produces a key for each message published to a Kafka topic.
The key is used to determine on which topic's partition a message is published. It is guaranteed that messages
with the same key will arrive to the same partition, in the order they are published. | [
"A",
"PartitionKeyStrategy",
"produces",
"a",
"key",
"for",
"each",
"message",
"published",
"to",
"a",
"Kafka",
"topic",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/broker/kafka/KafkaProperties.java#L24-L27 |
19,401 | lagom/lagom | service/javadsl/client/src/main/java/com/lightbend/lagom/javadsl/client/CircuitBreakingServiceLocator.java | CircuitBreakingServiceLocator.doWithServiceImpl | protected <T> CompletionStage<Optional<T>> doWithServiceImpl(String name, Descriptor.Call<?, ?> serviceCall, Function<URI, CompletionStage<T>> block) {
return locate(name, serviceCall).thenCompose(uri -> {
return uri
.map(u -> block.apply(u).thenApply(Optional::of))
... | java | protected <T> CompletionStage<Optional<T>> doWithServiceImpl(String name, Descriptor.Call<?, ?> serviceCall, Function<URI, CompletionStage<T>> block) {
return locate(name, serviceCall).thenCompose(uri -> {
return uri
.map(u -> block.apply(u).thenApply(Optional::of))
... | [
"protected",
"<",
"T",
">",
"CompletionStage",
"<",
"Optional",
"<",
"T",
">",
">",
"doWithServiceImpl",
"(",
"String",
"name",
",",
"Descriptor",
".",
"Call",
"<",
"?",
",",
"?",
">",
"serviceCall",
",",
"Function",
"<",
"URI",
",",
"CompletionStage",
"... | Do the given block with the given service looked up.
This is invoked by {@link #doWithService(String, Descriptor.Call, Function)}, after wrapping the passed in block
in a circuit breaker if configured to do so.
The default implementation just delegates to the {@link #locate(String, Descriptor.Call)} method, but this ... | [
"Do",
"the",
"given",
"block",
"with",
"the",
"given",
"service",
"looked",
"up",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/client/src/main/java/com/lightbend/lagom/javadsl/client/CircuitBreakingServiceLocator.java#L59-L65 |
19,402 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/RequestHeader.java | RequestHeader.withMethod | public RequestHeader withMethod(Method method) {
return new RequestHeader(method, uri, protocol, acceptedResponseProtocols, principal, headers, lowercaseHeaders);
} | java | public RequestHeader withMethod(Method method) {
return new RequestHeader(method, uri, protocol, acceptedResponseProtocols, principal, headers, lowercaseHeaders);
} | [
"public",
"RequestHeader",
"withMethod",
"(",
"Method",
"method",
")",
"{",
"return",
"new",
"RequestHeader",
"(",
"method",
",",
"uri",
",",
"protocol",
",",
"acceptedResponseProtocols",
",",
"principal",
",",
"headers",
",",
"lowercaseHeaders",
")",
";",
"}"
] | Return a copy of this request header with the given method set.
@param method The method to set.
@return A copy of this request header. | [
"Return",
"a",
"copy",
"of",
"this",
"request",
"header",
"with",
"the",
"given",
"method",
"set",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/RequestHeader.java#L92-L94 |
19,403 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/RequestHeader.java | RequestHeader.withUri | public RequestHeader withUri(URI uri) {
return new RequestHeader(method, uri, protocol, acceptedResponseProtocols, principal, headers, lowercaseHeaders);
} | java | public RequestHeader withUri(URI uri) {
return new RequestHeader(method, uri, protocol, acceptedResponseProtocols, principal, headers, lowercaseHeaders);
} | [
"public",
"RequestHeader",
"withUri",
"(",
"URI",
"uri",
")",
"{",
"return",
"new",
"RequestHeader",
"(",
"method",
",",
"uri",
",",
"protocol",
",",
"acceptedResponseProtocols",
",",
"principal",
",",
"headers",
",",
"lowercaseHeaders",
")",
";",
"}"
] | Return a copy of this request header with the given uri set.
@param uri The uri to set.
@return A copy of this request header. | [
"Return",
"a",
"copy",
"of",
"this",
"request",
"header",
"with",
"the",
"given",
"uri",
"set",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/RequestHeader.java#L102-L104 |
19,404 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/RequestHeader.java | RequestHeader.withAcceptedResponseProtocols | public RequestHeader withAcceptedResponseProtocols(PSequence<MessageProtocol> acceptedResponseProtocols) {
return new RequestHeader(method, uri, protocol, acceptedResponseProtocols, principal, headers, lowercaseHeaders);
} | java | public RequestHeader withAcceptedResponseProtocols(PSequence<MessageProtocol> acceptedResponseProtocols) {
return new RequestHeader(method, uri, protocol, acceptedResponseProtocols, principal, headers, lowercaseHeaders);
} | [
"public",
"RequestHeader",
"withAcceptedResponseProtocols",
"(",
"PSequence",
"<",
"MessageProtocol",
">",
"acceptedResponseProtocols",
")",
"{",
"return",
"new",
"RequestHeader",
"(",
"method",
",",
"uri",
",",
"protocol",
",",
"acceptedResponseProtocols",
",",
"princi... | Return a copy of this request header with the given accepted response protocols set.
@param acceptedResponseProtocols The accepted response protocols to set.
@return A copy of this request header. | [
"Return",
"a",
"copy",
"of",
"this",
"request",
"header",
"with",
"the",
"given",
"accepted",
"response",
"protocols",
"set",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/RequestHeader.java#L117-L119 |
19,405 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/RequestHeader.java | RequestHeader.withPrincipal | public RequestHeader withPrincipal(Principal principal) {
return new RequestHeader(method, uri, protocol, acceptedResponseProtocols, Optional.ofNullable(principal), headers, lowercaseHeaders);
} | java | public RequestHeader withPrincipal(Principal principal) {
return new RequestHeader(method, uri, protocol, acceptedResponseProtocols, Optional.ofNullable(principal), headers, lowercaseHeaders);
} | [
"public",
"RequestHeader",
"withPrincipal",
"(",
"Principal",
"principal",
")",
"{",
"return",
"new",
"RequestHeader",
"(",
"method",
",",
"uri",
",",
"protocol",
",",
"acceptedResponseProtocols",
",",
"Optional",
".",
"ofNullable",
"(",
"principal",
")",
",",
"... | Return a copy of this request header with the principal set.
@param principal The principal to set.
@return A copy of this request header. | [
"Return",
"a",
"copy",
"of",
"this",
"request",
"header",
"with",
"the",
"principal",
"set",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/RequestHeader.java#L127-L129 |
19,406 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/RequestHeader.java | RequestHeader.clearPrincipal | public RequestHeader clearPrincipal() {
return new RequestHeader(method, uri, protocol, acceptedResponseProtocols, Optional.empty(), headers, lowercaseHeaders);
} | java | public RequestHeader clearPrincipal() {
return new RequestHeader(method, uri, protocol, acceptedResponseProtocols, Optional.empty(), headers, lowercaseHeaders);
} | [
"public",
"RequestHeader",
"clearPrincipal",
"(",
")",
"{",
"return",
"new",
"RequestHeader",
"(",
"method",
",",
"uri",
",",
"protocol",
",",
"acceptedResponseProtocols",
",",
"Optional",
".",
"empty",
"(",
")",
",",
"headers",
",",
"lowercaseHeaders",
")",
"... | Return a copy of this request header with the principal cleared.
@return A copy of this request header. | [
"Return",
"a",
"copy",
"of",
"this",
"request",
"header",
"with",
"the",
"principal",
"cleared",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/RequestHeader.java#L137-L139 |
19,407 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/MessageHeader.java | MessageHeader.getHeader | public Optional<String> getHeader(String name) {
PSequence<String> values = lowercaseHeaders.get(name.toLowerCase(Locale.ENGLISH));
if (values == null || values.isEmpty()) {
return Optional.empty();
} else {
return Optional.of(values.get(0));
}
} | java | public Optional<String> getHeader(String name) {
PSequence<String> values = lowercaseHeaders.get(name.toLowerCase(Locale.ENGLISH));
if (values == null || values.isEmpty()) {
return Optional.empty();
} else {
return Optional.of(values.get(0));
}
} | [
"public",
"Optional",
"<",
"String",
">",
"getHeader",
"(",
"String",
"name",
")",
"{",
"PSequence",
"<",
"String",
">",
"values",
"=",
"lowercaseHeaders",
".",
"get",
"(",
"name",
".",
"toLowerCase",
"(",
"Locale",
".",
"ENGLISH",
")",
")",
";",
"if",
... | Get the header with the given name.
The lookup is case insensitive.
@param name The name of the header.
@return The header value. | [
"Get",
"the",
"header",
"with",
"the",
"given",
"name",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/MessageHeader.java#L67-L74 |
19,408 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/broker/Message.java | Message.get | @SuppressWarnings("unchecked")
public <Metadata> Optional<Metadata> get(MetadataKey<Metadata> key) {
return Optional.ofNullable((Metadata) metadataMap.get(key));
} | java | @SuppressWarnings("unchecked")
public <Metadata> Optional<Metadata> get(MetadataKey<Metadata> key) {
return Optional.ofNullable((Metadata) metadataMap.get(key));
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"Metadata",
">",
"Optional",
"<",
"Metadata",
">",
"get",
"(",
"MetadataKey",
"<",
"Metadata",
">",
"key",
")",
"{",
"return",
"Optional",
".",
"ofNullable",
"(",
"(",
"Metadata",
")",
"met... | Get the metadata for the given metadata key.
@param key The key of the metadata.
@return The metadata, if found for that key. | [
"Get",
"the",
"metadata",
"for",
"the",
"given",
"metadata",
"key",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/broker/Message.java#L40-L43 |
19,409 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/broker/Message.java | Message.add | public <Metadata> Message<Payload> add(MetadataKey<Metadata> key, Metadata metadata) {
return new Message<>(payload, metadataMap.plus(key, metadata));
} | java | public <Metadata> Message<Payload> add(MetadataKey<Metadata> key, Metadata metadata) {
return new Message<>(payload, metadataMap.plus(key, metadata));
} | [
"public",
"<",
"Metadata",
">",
"Message",
"<",
"Payload",
">",
"add",
"(",
"MetadataKey",
"<",
"Metadata",
">",
"key",
",",
"Metadata",
"metadata",
")",
"{",
"return",
"new",
"Message",
"<>",
"(",
"payload",
",",
"metadataMap",
".",
"plus",
"(",
"key",
... | Add a metadata key and value to this message.
@param key The key to add.
@param metadata The metadata to add.
@return A copy of this message with the key and value added. | [
"Add",
"a",
"metadata",
"key",
"and",
"value",
"to",
"this",
"message",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/broker/Message.java#L52-L54 |
19,410 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/broker/Message.java | Message.create | public static <Payload> Message<Payload> create(Payload payload) {
return new Message<>(payload, HashTreePMap.empty());
} | java | public static <Payload> Message<Payload> create(Payload payload) {
return new Message<>(payload, HashTreePMap.empty());
} | [
"public",
"static",
"<",
"Payload",
">",
"Message",
"<",
"Payload",
">",
"create",
"(",
"Payload",
"payload",
")",
"{",
"return",
"new",
"Message",
"<>",
"(",
"payload",
",",
"HashTreePMap",
".",
"empty",
"(",
")",
")",
";",
"}"
] | Create a message with the given payload. | [
"Create",
"a",
"message",
"with",
"the",
"given",
"payload",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/broker/Message.java#L82-L84 |
19,411 | lagom/lagom | service/javadsl/client/src/main/java/com/lightbend/lagom/internal/javadsl/BinderAccessor.java | BinderAccessor.binder | public static Binder binder(Object module) {
if (module instanceof AbstractModule) {
try {
Method method = AbstractModule.class.getDeclaredMethod("binder");
if (!method.isAccessible()) {
method.setAccessible(true);
}
... | java | public static Binder binder(Object module) {
if (module instanceof AbstractModule) {
try {
Method method = AbstractModule.class.getDeclaredMethod("binder");
if (!method.isAccessible()) {
method.setAccessible(true);
}
... | [
"public",
"static",
"Binder",
"binder",
"(",
"Object",
"module",
")",
"{",
"if",
"(",
"module",
"instanceof",
"AbstractModule",
")",
"{",
"try",
"{",
"Method",
"method",
"=",
"AbstractModule",
".",
"class",
".",
"getDeclaredMethod",
"(",
"\"binder\"",
")",
"... | Get the binder from an AbstractModule. | [
"Get",
"the",
"binder",
"from",
"an",
"AbstractModule",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/client/src/main/java/com/lightbend/lagom/internal/javadsl/BinderAccessor.java#L20-L34 |
19,412 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/Descriptor.java | Descriptor.withCalls | public Descriptor withCalls(Call<?, ?>... calls) {
return replaceAllCalls(this.calls.plusAll(Arrays.asList(calls)));
} | java | public Descriptor withCalls(Call<?, ?>... calls) {
return replaceAllCalls(this.calls.plusAll(Arrays.asList(calls)));
} | [
"public",
"Descriptor",
"withCalls",
"(",
"Call",
"<",
"?",
",",
"?",
">",
"...",
"calls",
")",
"{",
"return",
"replaceAllCalls",
"(",
"this",
".",
"calls",
".",
"plusAll",
"(",
"Arrays",
".",
"asList",
"(",
"calls",
")",
")",
")",
";",
"}"
] | Add the given service calls to this service.
@param calls The calls to add.
@return A copy of this descriptor with the new calls added. | [
"Add",
"the",
"given",
"service",
"calls",
"to",
"this",
"service",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/Descriptor.java#L710-L712 |
19,413 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/Descriptor.java | Descriptor.replaceAllCalls | public Descriptor replaceAllCalls(PSequence<Call<?, ?>> calls) {
return new Descriptor(name, calls, pathParamSerializers, messageSerializers, serializerFactory, exceptionSerializer, autoAcl, acls, headerFilter, locatableService, circuitBreaker, topicCalls);
} | java | public Descriptor replaceAllCalls(PSequence<Call<?, ?>> calls) {
return new Descriptor(name, calls, pathParamSerializers, messageSerializers, serializerFactory, exceptionSerializer, autoAcl, acls, headerFilter, locatableService, circuitBreaker, topicCalls);
} | [
"public",
"Descriptor",
"replaceAllCalls",
"(",
"PSequence",
"<",
"Call",
"<",
"?",
",",
"?",
">",
">",
"calls",
")",
"{",
"return",
"new",
"Descriptor",
"(",
"name",
",",
"calls",
",",
"pathParamSerializers",
",",
"messageSerializers",
",",
"serializerFactory... | Replace all the service calls provided by this descriptor with the the given service calls.
@param calls The calls to replace the existing ones with.
@return A copy of this descriptor with the new calls. | [
"Replace",
"all",
"the",
"service",
"calls",
"provided",
"by",
"this",
"descriptor",
"with",
"the",
"the",
"given",
"service",
"calls",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/Descriptor.java#L720-L722 |
19,414 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/Descriptor.java | Descriptor.replaceAllPathParamSerializers | public Descriptor replaceAllPathParamSerializers(PMap<Type, PathParamSerializer<?>> pathParamSerializers) {
return new Descriptor(name, calls, pathParamSerializers, messageSerializers, serializerFactory, exceptionSerializer, autoAcl, acls, headerFilter, locatableService, circuitBreaker, topicCalls);
} | java | public Descriptor replaceAllPathParamSerializers(PMap<Type, PathParamSerializer<?>> pathParamSerializers) {
return new Descriptor(name, calls, pathParamSerializers, messageSerializers, serializerFactory, exceptionSerializer, autoAcl, acls, headerFilter, locatableService, circuitBreaker, topicCalls);
} | [
"public",
"Descriptor",
"replaceAllPathParamSerializers",
"(",
"PMap",
"<",
"Type",
",",
"PathParamSerializer",
"<",
"?",
">",
">",
"pathParamSerializers",
")",
"{",
"return",
"new",
"Descriptor",
"(",
"name",
",",
"calls",
",",
"pathParamSerializers",
",",
"messa... | Replace all the path param serializers registered with this descriptor with the the given path param serializers.
@param pathParamSerializers The path param serializers to replace the existing ones with.
@return A copy of this descriptor with the new path param serializers. | [
"Replace",
"all",
"the",
"path",
"param",
"serializers",
"registered",
"with",
"this",
"descriptor",
"with",
"the",
"the",
"given",
"path",
"param",
"serializers",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/Descriptor.java#L730-L732 |
19,415 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/Descriptor.java | Descriptor.replaceAllMessageSerializers | public Descriptor replaceAllMessageSerializers(PMap<Type, MessageSerializer<?, ?>> messageSerializers) {
return new Descriptor(name, calls, pathParamSerializers, messageSerializers, serializerFactory, exceptionSerializer, autoAcl, acls, headerFilter, locatableService, circuitBreaker, topicCalls);
} | java | public Descriptor replaceAllMessageSerializers(PMap<Type, MessageSerializer<?, ?>> messageSerializers) {
return new Descriptor(name, calls, pathParamSerializers, messageSerializers, serializerFactory, exceptionSerializer, autoAcl, acls, headerFilter, locatableService, circuitBreaker, topicCalls);
} | [
"public",
"Descriptor",
"replaceAllMessageSerializers",
"(",
"PMap",
"<",
"Type",
",",
"MessageSerializer",
"<",
"?",
",",
"?",
">",
">",
"messageSerializers",
")",
"{",
"return",
"new",
"Descriptor",
"(",
"name",
",",
"calls",
",",
"pathParamSerializers",
",",
... | Replace all the message serializers registered with this descriptor with the the given message serializers.
@param messageSerializers The message serializers to replace the existing ones with.
@return A copy of this descriptor with the new message serializers. | [
"Replace",
"all",
"the",
"message",
"serializers",
"registered",
"with",
"this",
"descriptor",
"with",
"the",
"the",
"given",
"message",
"serializers",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/Descriptor.java#L740-L742 |
19,416 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/Descriptor.java | Descriptor.replaceAllTopicCalls | public Descriptor replaceAllTopicCalls(PSequence<TopicCall<?>> topicCalls) {
return new Descriptor(name, calls, pathParamSerializers, messageSerializers, serializerFactory, exceptionSerializer, autoAcl, acls, headerFilter, locatableService, circuitBreaker, topicCalls);
} | java | public Descriptor replaceAllTopicCalls(PSequence<TopicCall<?>> topicCalls) {
return new Descriptor(name, calls, pathParamSerializers, messageSerializers, serializerFactory, exceptionSerializer, autoAcl, acls, headerFilter, locatableService, circuitBreaker, topicCalls);
} | [
"public",
"Descriptor",
"replaceAllTopicCalls",
"(",
"PSequence",
"<",
"TopicCall",
"<",
"?",
">",
">",
"topicCalls",
")",
"{",
"return",
"new",
"Descriptor",
"(",
"name",
",",
"calls",
",",
"pathParamSerializers",
",",
"messageSerializers",
",",
"serializerFactor... | Replace all the topic calls provided by this descriptor with the the given topic calls.
@param topicCalls The topic calls to replace the existing ones with.
@return A copy of this descriptor with the new topic calls. | [
"Replace",
"all",
"the",
"topic",
"calls",
"provided",
"by",
"this",
"descriptor",
"with",
"the",
"the",
"given",
"topic",
"calls",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/Descriptor.java#L750-L752 |
19,417 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/Descriptor.java | Descriptor.withExceptionSerializer | public Descriptor withExceptionSerializer(ExceptionSerializer exceptionSerializer) {
return new Descriptor(name, calls, pathParamSerializers, messageSerializers, serializerFactory, exceptionSerializer, autoAcl, acls, headerFilter, locatableService, circuitBreaker, topicCalls);
} | java | public Descriptor withExceptionSerializer(ExceptionSerializer exceptionSerializer) {
return new Descriptor(name, calls, pathParamSerializers, messageSerializers, serializerFactory, exceptionSerializer, autoAcl, acls, headerFilter, locatableService, circuitBreaker, topicCalls);
} | [
"public",
"Descriptor",
"withExceptionSerializer",
"(",
"ExceptionSerializer",
"exceptionSerializer",
")",
"{",
"return",
"new",
"Descriptor",
"(",
"name",
",",
"calls",
",",
"pathParamSerializers",
",",
"messageSerializers",
",",
"serializerFactory",
",",
"exceptionSeria... | Use the given exception serializer to serialize and deserialized exceptions handled by this service.
@param exceptionSerializer The exception handler to use.
@return A copy of this descriptor. | [
"Use",
"the",
"given",
"exception",
"serializer",
"to",
"serialize",
"and",
"deserialized",
"exceptions",
"handled",
"by",
"this",
"service",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/Descriptor.java#L760-L762 |
19,418 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/Descriptor.java | Descriptor.withServiceAcls | public Descriptor withServiceAcls(ServiceAcl... acls) {
return replaceAllAcls(this.acls.plusAll(Arrays.asList(acls)));
} | java | public Descriptor withServiceAcls(ServiceAcl... acls) {
return replaceAllAcls(this.acls.plusAll(Arrays.asList(acls)));
} | [
"public",
"Descriptor",
"withServiceAcls",
"(",
"ServiceAcl",
"...",
"acls",
")",
"{",
"return",
"replaceAllAcls",
"(",
"this",
".",
"acls",
".",
"plusAll",
"(",
"Arrays",
".",
"asList",
"(",
"acls",
")",
")",
")",
";",
"}"
] | Add the given manual ACLs.
If auto ACLs are configured, these will be added in addition to the auto ACLs.
@param acls The ACLs to add.
@return A copy of this descriptor. | [
"Add",
"the",
"given",
"manual",
"ACLs",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/Descriptor.java#L798-L800 |
19,419 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/Descriptor.java | Descriptor.replaceAllAcls | public Descriptor replaceAllAcls(PSequence<ServiceAcl> acls) {
return new Descriptor(name, calls, pathParamSerializers, messageSerializers, serializerFactory, exceptionSerializer, autoAcl, acls, headerFilter, locatableService, circuitBreaker, topicCalls);
} | java | public Descriptor replaceAllAcls(PSequence<ServiceAcl> acls) {
return new Descriptor(name, calls, pathParamSerializers, messageSerializers, serializerFactory, exceptionSerializer, autoAcl, acls, headerFilter, locatableService, circuitBreaker, topicCalls);
} | [
"public",
"Descriptor",
"replaceAllAcls",
"(",
"PSequence",
"<",
"ServiceAcl",
">",
"acls",
")",
"{",
"return",
"new",
"Descriptor",
"(",
"name",
",",
"calls",
",",
"pathParamSerializers",
",",
"messageSerializers",
",",
"serializerFactory",
",",
"exceptionSerialize... | Replace all the ACLs with the given ACL sequence.
This will not replace ACLs generated by autoAcl, to disable autoAcl, turn it off.
@param acls The ACLs to use.
@return A copy of this descriptor. | [
"Replace",
"all",
"the",
"ACLs",
"with",
"the",
"given",
"ACL",
"sequence",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/Descriptor.java#L810-L812 |
19,420 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/Descriptor.java | Descriptor.withTopics | public Descriptor withTopics(TopicCall<?>... topicCalls) {
return new Descriptor(name, calls, pathParamSerializers, messageSerializers, serializerFactory, exceptionSerializer, autoAcl, acls, headerFilter, locatableService, circuitBreaker,
this.topicCalls.plusAll(Arrays.asList(topicCalls)));
... | java | public Descriptor withTopics(TopicCall<?>... topicCalls) {
return new Descriptor(name, calls, pathParamSerializers, messageSerializers, serializerFactory, exceptionSerializer, autoAcl, acls, headerFilter, locatableService, circuitBreaker,
this.topicCalls.plusAll(Arrays.asList(topicCalls)));
... | [
"public",
"Descriptor",
"withTopics",
"(",
"TopicCall",
"<",
"?",
">",
"...",
"topicCalls",
")",
"{",
"return",
"new",
"Descriptor",
"(",
"name",
",",
"calls",
",",
"pathParamSerializers",
",",
"messageSerializers",
",",
"serializerFactory",
",",
"exceptionSeriali... | Add the given topic calls to this service.
@param topicCalls The topic calls to add.
@return A copy of this descriptor with the new calls added. | [
"Add",
"the",
"given",
"topic",
"calls",
"to",
"this",
"service",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/Descriptor.java#L870-L873 |
19,421 | lagom/lagom | service/javadsl/broker/src/main/java/com/lightbend/lagom/javadsl/broker/TopicProducer.java | TopicProducer.singleStreamWithOffset | public static <Message> Topic<Message> singleStreamWithOffset(
Function<Offset, Source<Pair<Message, Offset>, ?>> eventStream) {
return taggedStreamWithOffset(SINGLETON_TAG, (tag, offset) -> eventStream.apply(offset));
} | java | public static <Message> Topic<Message> singleStreamWithOffset(
Function<Offset, Source<Pair<Message, Offset>, ?>> eventStream) {
return taggedStreamWithOffset(SINGLETON_TAG, (tag, offset) -> eventStream.apply(offset));
} | [
"public",
"static",
"<",
"Message",
">",
"Topic",
"<",
"Message",
">",
"singleStreamWithOffset",
"(",
"Function",
"<",
"Offset",
",",
"Source",
"<",
"Pair",
"<",
"Message",
",",
"Offset",
">",
",",
"?",
">",
">",
"eventStream",
")",
"{",
"return",
"tagge... | Publish a single stream.
This producer will ensure every element from the stream will be published at least once (usually only once),
using the message offsets to track where in the stream the producer is up to publishing.
@param eventStream A function to create the event stream given the last offset that was publish... | [
"Publish",
"a",
"single",
"stream",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/broker/src/main/java/com/lightbend/lagom/javadsl/broker/TopicProducer.java#L38-L41 |
19,422 | lagom/lagom | service/javadsl/broker/src/main/java/com/lightbend/lagom/javadsl/broker/TopicProducer.java | TopicProducer.taggedStreamWithOffset | public static <Message, Event extends AggregateEvent<Event>> Topic<Message> taggedStreamWithOffset(
PSequence<AggregateEventTag<Event>> tags,
BiFunction<AggregateEventTag<Event>, Offset, Source<Pair<Message, Offset>, ?>> eventStream) {
return new TaggedOffsetTopicProducer<>(tags, eventSt... | java | public static <Message, Event extends AggregateEvent<Event>> Topic<Message> taggedStreamWithOffset(
PSequence<AggregateEventTag<Event>> tags,
BiFunction<AggregateEventTag<Event>, Offset, Source<Pair<Message, Offset>, ?>> eventStream) {
return new TaggedOffsetTopicProducer<>(tags, eventSt... | [
"public",
"static",
"<",
"Message",
",",
"Event",
"extends",
"AggregateEvent",
"<",
"Event",
">",
">",
"Topic",
"<",
"Message",
">",
"taggedStreamWithOffset",
"(",
"PSequence",
"<",
"AggregateEventTag",
"<",
"Event",
">",
">",
"tags",
",",
"BiFunction",
"<",
... | Publish a stream that is sharded across many tags.
The tags will be distributed around the cluster, ensuring that at most one event stream for each tag is
being published at a particular time.
This producer will ensure every element from each tags stream will be published at least once (usually only
once), using the ... | [
"Publish",
"a",
"stream",
"that",
"is",
"sharded",
"across",
"many",
"tags",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/broker/src/main/java/com/lightbend/lagom/javadsl/broker/TopicProducer.java#L61-L65 |
19,423 | lagom/lagom | service/javadsl/broker/src/main/java/com/lightbend/lagom/javadsl/broker/TopicProducer.java | TopicProducer.taggedStreamWithOffset | public static <Message, Event extends AggregateEvent<Event>> Topic<Message> taggedStreamWithOffset(
AggregateEventShards<Event> shards,
BiFunction<AggregateEventTag<Event>, Offset, Source<Pair<Message, Offset>, ?>> eventStream) {
return new TaggedOffsetTopicProducer<>(shards.allTags(), e... | java | public static <Message, Event extends AggregateEvent<Event>> Topic<Message> taggedStreamWithOffset(
AggregateEventShards<Event> shards,
BiFunction<AggregateEventTag<Event>, Offset, Source<Pair<Message, Offset>, ?>> eventStream) {
return new TaggedOffsetTopicProducer<>(shards.allTags(), e... | [
"public",
"static",
"<",
"Message",
",",
"Event",
"extends",
"AggregateEvent",
"<",
"Event",
">",
">",
"Topic",
"<",
"Message",
">",
"taggedStreamWithOffset",
"(",
"AggregateEventShards",
"<",
"Event",
">",
"shards",
",",
"BiFunction",
"<",
"AggregateEventTag",
... | Publish all tags of a stream that is sharded across many tags.
The tags will be distributed around the cluster, ensuring that at most one event stream for each tag is
being published at a particular time.
This producer will ensure every element from each tags stream will be published at least once (usually only
once)... | [
"Publish",
"all",
"tags",
"of",
"a",
"stream",
"that",
"is",
"sharded",
"across",
"many",
"tags",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/broker/src/main/java/com/lightbend/lagom/javadsl/broker/TopicProducer.java#L81-L85 |
19,424 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/TransportErrorCode.java | TransportErrorCode.fromHttp | public static TransportErrorCode fromHttp(int code) {
TransportErrorCode builtIn = HTTP_ERROR_CODE_MAP.get(code);
if (builtIn == null) {
if (code > 599 || code < 100) {
throw new IllegalArgumentException("Invalid http status code: " + code);
} else if (code < 400)... | java | public static TransportErrorCode fromHttp(int code) {
TransportErrorCode builtIn = HTTP_ERROR_CODE_MAP.get(code);
if (builtIn == null) {
if (code > 599 || code < 100) {
throw new IllegalArgumentException("Invalid http status code: " + code);
} else if (code < 400)... | [
"public",
"static",
"TransportErrorCode",
"fromHttp",
"(",
"int",
"code",
")",
"{",
"TransportErrorCode",
"builtIn",
"=",
"HTTP_ERROR_CODE_MAP",
".",
"get",
"(",
"code",
")",
";",
"if",
"(",
"builtIn",
"==",
"null",
")",
"{",
"if",
"(",
"code",
">",
"599",... | Get a transport error code from the given HTTP error code.
@param code The HTTP error code, must be between 400 and 599 inclusive.
@return The transport error code.
@throws IllegalArgumentException if the HTTP code was not between 400 and 599. | [
"Get",
"a",
"transport",
"error",
"code",
"from",
"the",
"given",
"HTTP",
"error",
"code",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/TransportErrorCode.java#L142-L155 |
19,425 | lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/TransportErrorCode.java | TransportErrorCode.fromWebSocket | public static TransportErrorCode fromWebSocket(int code) {
TransportErrorCode builtIn = WEBSOCKET_ERROR_CODE_MAP.get(code);
if (builtIn == null) {
if (code < 0 || code > 65535) {
throw new IllegalArgumentException("Invalid WebSocket status code: " + code);
} else ... | java | public static TransportErrorCode fromWebSocket(int code) {
TransportErrorCode builtIn = WEBSOCKET_ERROR_CODE_MAP.get(code);
if (builtIn == null) {
if (code < 0 || code > 65535) {
throw new IllegalArgumentException("Invalid WebSocket status code: " + code);
} else ... | [
"public",
"static",
"TransportErrorCode",
"fromWebSocket",
"(",
"int",
"code",
")",
"{",
"TransportErrorCode",
"builtIn",
"=",
"WEBSOCKET_ERROR_CODE_MAP",
".",
"get",
"(",
"code",
")",
";",
"if",
"(",
"builtIn",
"==",
"null",
")",
"{",
"if",
"(",
"code",
"<"... | Get a transport error code from the given WebSocket close code.
@param code The WebSocket close code, must be between 0 and 65535 inclusive.
@return The transport error code.
@throws IllegalArgumentException if the code is not an unsigned 2 byte integer. | [
"Get",
"a",
"transport",
"error",
"code",
"from",
"the",
"given",
"WebSocket",
"close",
"code",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/TransportErrorCode.java#L164-L177 |
19,426 | lagom/lagom | docs/manual/java/guide/cluster/code/docs/home/persistence/Post4.java | Post4.becomePostAdded | private Behavior becomePostAdded(BlogState newState) {
BehaviorBuilder b = newBehaviorBuilder(newState);
b.setCommandHandler(ChangeBody.class,
(cmd, ctx) -> ctx.thenPersist(new BodyChanged(entityId(), cmd.getBody()), evt ->
ctx.reply(Done.getInstance())));
b.setEventHandler(BodyChanged.c... | java | private Behavior becomePostAdded(BlogState newState) {
BehaviorBuilder b = newBehaviorBuilder(newState);
b.setCommandHandler(ChangeBody.class,
(cmd, ctx) -> ctx.thenPersist(new BodyChanged(entityId(), cmd.getBody()), evt ->
ctx.reply(Done.getInstance())));
b.setEventHandler(BodyChanged.c... | [
"private",
"Behavior",
"becomePostAdded",
"(",
"BlogState",
"newState",
")",
"{",
"BehaviorBuilder",
"b",
"=",
"newBehaviorBuilder",
"(",
"newState",
")",
";",
"b",
".",
"setCommandHandler",
"(",
"ChangeBody",
".",
"class",
",",
"(",
"cmd",
",",
"ctx",
")",
... | Behavior can be changed in the event handlers. | [
"Behavior",
"can",
"be",
"changed",
"in",
"the",
"event",
"handlers",
"."
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/docs/manual/java/guide/cluster/code/docs/home/persistence/Post4.java#L59-L80 |
19,427 | google/flogger | google/src/main/java/com/google/common/flogger/GoogleLogger.java | GoogleLogger.forEnclosingClass | public static GoogleLogger forEnclosingClass() {
// NOTE: It is _vital_ that the call to "caller finder" is made directly inside the static
// factory method. See getCallerFinder() for more information.
String loggingClass = Platform.getCallerFinder().findLoggingClass(GoogleLogger.class);
return new Goo... | java | public static GoogleLogger forEnclosingClass() {
// NOTE: It is _vital_ that the call to "caller finder" is made directly inside the static
// factory method. See getCallerFinder() for more information.
String loggingClass = Platform.getCallerFinder().findLoggingClass(GoogleLogger.class);
return new Goo... | [
"public",
"static",
"GoogleLogger",
"forEnclosingClass",
"(",
")",
"{",
"// NOTE: It is _vital_ that the call to \"caller finder\" is made directly inside the static",
"// factory method. See getCallerFinder() for more information.",
"String",
"loggingClass",
"=",
"Platform",
".",
"getCa... | Returns a new Google specific logger instance using printf style message formatting. | [
"Returns",
"a",
"new",
"Google",
"specific",
"logger",
"instance",
"using",
"printf",
"style",
"message",
"formatting",
"."
] | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/google/src/main/java/com/google/common/flogger/GoogleLogger.java#L45-L50 |
19,428 | google/flogger | google/src/main/java/com/google/common/flogger/GoogleLogger.java | GoogleLogger.forInjectedClassName | @Deprecated
public static GoogleLogger forInjectedClassName(String className) {
checkArgument(!className.isEmpty(), "injected class name is empty");
// The injected class name is in binary form (e.g. java/util/Map$Entry) to re-use
// constant pool entries.
return new GoogleLogger(Platform.getBackend(c... | java | @Deprecated
public static GoogleLogger forInjectedClassName(String className) {
checkArgument(!className.isEmpty(), "injected class name is empty");
// The injected class name is in binary form (e.g. java/util/Map$Entry) to re-use
// constant pool entries.
return new GoogleLogger(Platform.getBackend(c... | [
"@",
"Deprecated",
"public",
"static",
"GoogleLogger",
"forInjectedClassName",
"(",
"String",
"className",
")",
"{",
"checkArgument",
"(",
"!",
"className",
".",
"isEmpty",
"(",
")",
",",
"\"injected class name is empty\"",
")",
";",
"// The injected class name is in bi... | Returns a new Google specific logger instance for the given class, using printf
style message formatting.
@deprecated prefer forEnclosingClass(); this method exists only to support
compile-time log site injection. | [
"Returns",
"a",
"new",
"Google",
"specific",
"logger",
"instance",
"for",
"the",
"given",
"class",
"using",
"printf",
"style",
"message",
"formatting",
"."
] | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/google/src/main/java/com/google/common/flogger/GoogleLogger.java#L59-L65 |
19,429 | google/flogger | api/src/main/java/com/google/common/flogger/backend/Tags.java | Tags.merge | public Tags merge(Tags other) {
// Dereference "other" first as a null pointer check so we cannot risk returning null later.
if (other.isEmpty()) {
return this;
}
if (this.isEmpty()) {
return other;
}
SortedMap<String, SortedSet<Object>> merged = new TreeMap<String, SortedSet<Object>... | java | public Tags merge(Tags other) {
// Dereference "other" first as a null pointer check so we cannot risk returning null later.
if (other.isEmpty()) {
return this;
}
if (this.isEmpty()) {
return other;
}
SortedMap<String, SortedSet<Object>> merged = new TreeMap<String, SortedSet<Object>... | [
"public",
"Tags",
"merge",
"(",
"Tags",
"other",
")",
"{",
"// Dereference \"other\" first as a null pointer check so we cannot risk returning null later.",
"if",
"(",
"other",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"this",
";",
"}",
"if",
"(",
"this",
".",
... | Merges two tags instances, combining values for any name contained in both. | [
"Merges",
"two",
"tags",
"instances",
"combining",
"values",
"for",
"any",
"name",
"contained",
"in",
"both",
"."
] | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/backend/Tags.java#L261-L292 |
19,430 | google/flogger | api/src/main/java/com/google/common/flogger/backend/system/DefaultPlatform.java | DefaultPlatform.resolveAttribute | @Nullable
private static <T> T resolveAttribute(String attributeName, Class<T> type) {
String getter = readProperty(attributeName);
if (getter == null) {
return null;
}
int idx = getter.indexOf('#');
if (idx <= 0 || idx == getter.length() - 1) {
error("invalid getter (expected <class>#... | java | @Nullable
private static <T> T resolveAttribute(String attributeName, Class<T> type) {
String getter = readProperty(attributeName);
if (getter == null) {
return null;
}
int idx = getter.indexOf('#');
if (idx <= 0 || idx == getter.length() - 1) {
error("invalid getter (expected <class>#... | [
"@",
"Nullable",
"private",
"static",
"<",
"T",
">",
"T",
"resolveAttribute",
"(",
"String",
"attributeName",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"String",
"getter",
"=",
"readProperty",
"(",
"attributeName",
")",
";",
"if",
"(",
"getter",
"==... | Helper to call a static no-arg getter to obtain an instance of a specified type. This is used
for platform aspects which are optional, but are expected to have a singleton available.
@return the return value of the specified static no-argument method, or null if the method
cannot be called or the returned value is of ... | [
"Helper",
"to",
"call",
"a",
"static",
"no",
"-",
"arg",
"getter",
"to",
"obtain",
"an",
"instance",
"of",
"a",
"specified",
"type",
".",
"This",
"is",
"used",
"for",
"platform",
"aspects",
"which",
"are",
"optional",
"but",
"are",
"expected",
"to",
"hav... | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/backend/system/DefaultPlatform.java#L122-L134 |
19,431 | google/flogger | api/src/main/java/com/google/common/flogger/parser/DefaultPrintfMessageParser.java | DefaultPrintfMessageParser.wrapHexParameter | private static Parameter wrapHexParameter(final FormatOptions options, int index) {
// %h / %H is really just %x / %X on the hashcode.
return new Parameter(options, index) {
@Override
protected void accept(ParameterVisitor visitor, Object value) {
visitor.visit(value.hashCode(), FormatChar.H... | java | private static Parameter wrapHexParameter(final FormatOptions options, int index) {
// %h / %H is really just %x / %X on the hashcode.
return new Parameter(options, index) {
@Override
protected void accept(ParameterVisitor visitor, Object value) {
visitor.visit(value.hashCode(), FormatChar.H... | [
"private",
"static",
"Parameter",
"wrapHexParameter",
"(",
"final",
"FormatOptions",
"options",
",",
"int",
"index",
")",
"{",
"// %h / %H is really just %x / %X on the hashcode.",
"return",
"new",
"Parameter",
"(",
"options",
",",
"index",
")",
"{",
"@",
"Override",
... | Static method so the anonymous synthetic parameter is static, rather than an inner class. | [
"Static",
"method",
"so",
"the",
"anonymous",
"synthetic",
"parameter",
"is",
"static",
"rather",
"than",
"an",
"inner",
"class",
"."
] | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/parser/DefaultPrintfMessageParser.java#L103-L116 |
19,432 | google/flogger | api/src/main/java/com/google/common/flogger/backend/system/AbstractBackend.java | AbstractBackend.log | void log(LogRecord record, boolean wasForced) {
// Do the fast boolean check (which normally succeeds) before calling isLoggable().
if (!wasForced || logger.isLoggable(record.getLevel())) {
// Unforced log statements or forced log statements at or above the logger's level can be
// passed to the nor... | java | void log(LogRecord record, boolean wasForced) {
// Do the fast boolean check (which normally succeeds) before calling isLoggable().
if (!wasForced || logger.isLoggable(record.getLevel())) {
// Unforced log statements or forced log statements at or above the logger's level can be
// passed to the nor... | [
"void",
"log",
"(",
"LogRecord",
"record",
",",
"boolean",
"wasForced",
")",
"{",
"// Do the fast boolean check (which normally succeeds) before calling isLoggable().",
"if",
"(",
"!",
"wasForced",
"||",
"logger",
".",
"isLoggable",
"(",
"record",
".",
"getLevel",
"(",
... | loggability check. | [
"loggability",
"check",
"."
] | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/backend/system/AbstractBackend.java#L71-L104 |
19,433 | google/flogger | api/src/main/java/com/google/common/flogger/backend/system/AbstractBackend.java | AbstractBackend.publish | private static void publish(Logger logger, LogRecord record) {
// Annoyingly this method appears to copy the array every time it is called, but there's
// nothing much we can do about this (and there could be synchronization issues even if we
// could access things directly because handlers can be changed a... | java | private static void publish(Logger logger, LogRecord record) {
// Annoyingly this method appears to copy the array every time it is called, but there's
// nothing much we can do about this (and there could be synchronization issues even if we
// could access things directly because handlers can be changed a... | [
"private",
"static",
"void",
"publish",
"(",
"Logger",
"logger",
",",
"LogRecord",
"record",
")",
"{",
"// Annoyingly this method appears to copy the array every time it is called, but there's",
"// nothing much we can do about this (and there could be synchronization issues even if we",
... | rate limiting. Thus we don't have to care about using iterative methods vs recursion here. | [
"rate",
"limiting",
".",
"Thus",
"we",
"don",
"t",
"have",
"to",
"care",
"about",
"using",
"iterative",
"methods",
"vs",
"recursion",
"here",
"."
] | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/backend/system/AbstractBackend.java#L123-L137 |
19,434 | google/flogger | api/src/main/java/com/google/common/flogger/backend/system/AbstractBackend.java | AbstractBackend.forceLoggingViaChildLogger | void forceLoggingViaChildLogger(LogRecord record) {
// Assume that nobody else will configure or manipulate loggers with this "secret" name.
Logger forcingLogger = getForcingLogger(logger);
// This logger can be garbage collected at any time, so we must always reset any configuration.
// This code is s... | java | void forceLoggingViaChildLogger(LogRecord record) {
// Assume that nobody else will configure or manipulate loggers with this "secret" name.
Logger forcingLogger = getForcingLogger(logger);
// This logger can be garbage collected at any time, so we must always reset any configuration.
// This code is s... | [
"void",
"forceLoggingViaChildLogger",
"(",
"LogRecord",
"record",
")",
"{",
"// Assume that nobody else will configure or manipulate loggers with this \"secret\" name.",
"Logger",
"forcingLogger",
"=",
"getForcingLogger",
"(",
"logger",
")",
";",
"// This logger can be garbage collec... | subclasses of Logger to be used. | [
"subclasses",
"of",
"Logger",
"to",
"be",
"used",
"."
] | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/backend/system/AbstractBackend.java#L142-L169 |
19,435 | google/flogger | api/src/main/java/com/google/common/flogger/util/Checks.java | Checks.checkMetadataIdentifier | public static String checkMetadataIdentifier(String s) {
// Note that we avoid using regular expressions here, since we've not used it anywhere else
// thus far in Flogger (avoid it make it more likely that Flogger can be transpiled for things
// like GWT).
if (s.isEmpty()) {
throw new IllegalArgu... | java | public static String checkMetadataIdentifier(String s) {
// Note that we avoid using regular expressions here, since we've not used it anywhere else
// thus far in Flogger (avoid it make it more likely that Flogger can be transpiled for things
// like GWT).
if (s.isEmpty()) {
throw new IllegalArgu... | [
"public",
"static",
"String",
"checkMetadataIdentifier",
"(",
"String",
"s",
")",
"{",
"// Note that we avoid using regular expressions here, since we've not used it anywhere else",
"// thus far in Flogger (avoid it make it more likely that Flogger can be transpiled for things",
"// like GWT).... | Checks if the given string is a valid metadata identifier. | [
"Checks",
"if",
"the",
"given",
"string",
"is",
"a",
"valid",
"metadata",
"identifier",
"."
] | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/util/Checks.java#L42-L60 |
19,436 | google/flogger | api/src/main/java/com/google/common/flogger/util/CallerFinder.java | CallerFinder.findCallerOf | @Nullable
public static StackTraceElement findCallerOf(Class<?> target, Throwable throwable, int skip) {
checkNotNull(target, "target");
checkNotNull(throwable, "throwable");
if (skip < 0) {
throw new IllegalArgumentException("skip count cannot be negative: " + skip);
}
// Getting the full s... | java | @Nullable
public static StackTraceElement findCallerOf(Class<?> target, Throwable throwable, int skip) {
checkNotNull(target, "target");
checkNotNull(throwable, "throwable");
if (skip < 0) {
throw new IllegalArgumentException("skip count cannot be negative: " + skip);
}
// Getting the full s... | [
"@",
"Nullable",
"public",
"static",
"StackTraceElement",
"findCallerOf",
"(",
"Class",
"<",
"?",
">",
"target",
",",
"Throwable",
"throwable",
",",
"int",
"skip",
")",
"{",
"checkNotNull",
"(",
"target",
",",
"\"target\"",
")",
";",
"checkNotNull",
"(",
"th... | Returns the stack trace element of the immediate caller of the specified class.
@param target the target class whose callers we are looking for.
@param throwable a new Throwable made at a known point in the call hierarchy.
@param skip the minimum number of calls known to have occurred between the first call to
the tar... | [
"Returns",
"the",
"stack",
"trace",
"element",
"of",
"the",
"immediate",
"caller",
"of",
"the",
"specified",
"class",
"."
] | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/util/CallerFinder.java#L43-L76 |
19,437 | google/flogger | api/src/main/java/com/google/common/flogger/util/CallerFinder.java | CallerFinder.getStackForCallerOf | @Nullable
public static StackTraceElement[] getStackForCallerOf(
Class<?> target, Throwable throwable, int maxDepth) {
checkNotNull(target, "target");
checkNotNull(throwable, "throwable");
if (maxDepth <= 0 && maxDepth != -1) {
throw new IllegalArgumentException("invalid maximum depth: " + max... | java | @Nullable
public static StackTraceElement[] getStackForCallerOf(
Class<?> target, Throwable throwable, int maxDepth) {
checkNotNull(target, "target");
checkNotNull(throwable, "throwable");
if (maxDepth <= 0 && maxDepth != -1) {
throw new IllegalArgumentException("invalid maximum depth: " + max... | [
"@",
"Nullable",
"public",
"static",
"StackTraceElement",
"[",
"]",
"getStackForCallerOf",
"(",
"Class",
"<",
"?",
">",
"target",
",",
"Throwable",
"throwable",
",",
"int",
"maxDepth",
")",
"{",
"checkNotNull",
"(",
"target",
",",
"\"target\"",
")",
";",
"ch... | Returns a synthetic stack trace starting at the immediate caller of the specified target.
@param target the class who caller the returned stack trace will start at.
@param throwable a new Throwable made at a known point in the call hierarchy.
@param maxDepth the maximum size of the returned stack (pass -1 for the comp... | [
"Returns",
"a",
"synthetic",
"stack",
"trace",
"starting",
"at",
"the",
"immediate",
"caller",
"of",
"the",
"specified",
"target",
"."
] | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/util/CallerFinder.java#L88-L135 |
19,438 | google/flogger | api/src/main/java/com/google/common/flogger/parser/MessageBuilder.java | MessageBuilder.build | public final T build() {
getParser().parseImpl(this);
// There was a gap in the parameters if either:
// 1) the mask had a gap, e.g. ..00110111
// 2) there were more than 32 parameters and the mask wasn't full.
// Gaps above the 32nd parameter are not detected.
if ((pmask & (pmask + 1)) != 0 || ... | java | public final T build() {
getParser().parseImpl(this);
// There was a gap in the parameters if either:
// 1) the mask had a gap, e.g. ..00110111
// 2) there were more than 32 parameters and the mask wasn't full.
// Gaps above the 32nd parameter are not detected.
if ((pmask & (pmask + 1)) != 0 || ... | [
"public",
"final",
"T",
"build",
"(",
")",
"{",
"getParser",
"(",
")",
".",
"parseImpl",
"(",
"this",
")",
";",
"// There was a gap in the parameters if either:",
"// 1) the mask had a gap, e.g. ..00110111",
"// 2) there were more than 32 parameters and the mask wasn't full.",
... | Builds a log message using the current message context.
@return the implementation specific result of parsing the current log message. | [
"Builds",
"a",
"log",
"message",
"using",
"the",
"current",
"message",
"context",
"."
] | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/parser/MessageBuilder.java#L110-L123 |
19,439 | google/flogger | api/src/main/java/com/google/common/flogger/FluentLogger.java | FluentLogger.forEnclosingClass | public static FluentLogger forEnclosingClass() {
// NOTE: It is _vital_ that the call to "caller finder" is made directly inside the static
// factory method. See getCallerFinder() for more information.
String loggingClass = Platform.getCallerFinder().findLoggingClass(FluentLogger.class);
return new Flu... | java | public static FluentLogger forEnclosingClass() {
// NOTE: It is _vital_ that the call to "caller finder" is made directly inside the static
// factory method. See getCallerFinder() for more information.
String loggingClass = Platform.getCallerFinder().findLoggingClass(FluentLogger.class);
return new Flu... | [
"public",
"static",
"FluentLogger",
"forEnclosingClass",
"(",
")",
"{",
"// NOTE: It is _vital_ that the call to \"caller finder\" is made directly inside the static",
"// factory method. See getCallerFinder() for more information.",
"String",
"loggingClass",
"=",
"Platform",
".",
"getCa... | Returns a new logger instance which parses log messages using printf format for the enclosing
class using the system default logging backend. | [
"Returns",
"a",
"new",
"logger",
"instance",
"which",
"parses",
"log",
"messages",
"using",
"printf",
"format",
"for",
"the",
"enclosing",
"class",
"using",
"the",
"system",
"default",
"logging",
"backend",
"."
] | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/FluentLogger.java#L67-L72 |
19,440 | google/flogger | api/src/main/java/com/google/common/flogger/LogContext.java | LogContext.logImpl | @SuppressWarnings("ReferenceEquality")
private void logImpl(String message, Object... args) {
this.args = args;
// Evaluate any (rare) LazyArg instances early. This may throw exceptions from user code, but
// it seems reasonable to propagate them in this case (they would have been thrown if the
// arg... | java | @SuppressWarnings("ReferenceEquality")
private void logImpl(String message, Object... args) {
this.args = args;
// Evaluate any (rare) LazyArg instances early. This may throw exceptions from user code, but
// it seems reasonable to propagate them in this case (they would have been thrown if the
// arg... | [
"@",
"SuppressWarnings",
"(",
"\"ReferenceEquality\"",
")",
"private",
"void",
"logImpl",
"(",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"this",
".",
"args",
"=",
"args",
";",
"// Evaluate any (rare) LazyArg instances early. This may throw exceptions ... | Make the backend logging call. This is the point at which we have paid the price of creating a
varargs array and doing any necessary auto-boxing. | [
"Make",
"the",
"backend",
"logging",
"call",
".",
"This",
"is",
"the",
"point",
"at",
"which",
"we",
"have",
"paid",
"the",
"price",
"of",
"creating",
"a",
"varargs",
"array",
"and",
"doing",
"any",
"necessary",
"auto",
"-",
"boxing",
"."
] | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/LogContext.java#L548-L567 |
19,441 | google/flogger | api/src/main/java/com/google/common/flogger/parameter/SimpleParameter.java | SimpleParameter.createParameterArray | private static SimpleParameter[] createParameterArray(FormatChar formatChar) {
SimpleParameter[] parameters = new SimpleParameter[MAX_CACHED_PARAMETERS];
for (int index = 0; index < MAX_CACHED_PARAMETERS; index++) {
parameters[index] = new SimpleParameter(index, formatChar, FormatOptions.getDefault());
... | java | private static SimpleParameter[] createParameterArray(FormatChar formatChar) {
SimpleParameter[] parameters = new SimpleParameter[MAX_CACHED_PARAMETERS];
for (int index = 0; index < MAX_CACHED_PARAMETERS; index++) {
parameters[index] = new SimpleParameter(index, formatChar, FormatOptions.getDefault());
... | [
"private",
"static",
"SimpleParameter",
"[",
"]",
"createParameterArray",
"(",
"FormatChar",
"formatChar",
")",
"{",
"SimpleParameter",
"[",
"]",
"parameters",
"=",
"new",
"SimpleParameter",
"[",
"MAX_CACHED_PARAMETERS",
"]",
";",
"for",
"(",
"int",
"index",
"=",
... | Helper to make reusable default parameter instances for the commonest indices. | [
"Helper",
"to",
"make",
"reusable",
"default",
"parameter",
"instances",
"for",
"the",
"commonest",
"indices",
"."
] | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/parameter/SimpleParameter.java#L50-L56 |
19,442 | google/flogger | api/src/main/java/com/google/common/flogger/LoggerConfig.java | LoggerConfig.getConfig | public static LoggerConfig getConfig(String name) {
LoggerConfig config = strongRefMap.get(checkNotNull(name, "logger name"));
if (config == null) {
// Ignore race condition of multiple put as all instances are equivalent.
// TODO(dbeaumont): Add a check and warn if the map grows "too large".
... | java | public static LoggerConfig getConfig(String name) {
LoggerConfig config = strongRefMap.get(checkNotNull(name, "logger name"));
if (config == null) {
// Ignore race condition of multiple put as all instances are equivalent.
// TODO(dbeaumont): Add a check and warn if the map grows "too large".
... | [
"public",
"static",
"LoggerConfig",
"getConfig",
"(",
"String",
"name",
")",
"{",
"LoggerConfig",
"config",
"=",
"strongRefMap",
".",
"get",
"(",
"checkNotNull",
"(",
"name",
",",
"\"logger name\"",
")",
")",
";",
"if",
"(",
"config",
"==",
"null",
")",
"{... | Returns a configuration instance suitable for configuring a logger with the same name.
<p>This method obtains and wraps the underlying logger with the given name, retaining a strong
reference and making it safe to use for persistent configuration changes. Note that as it makes
very little sense to have a logger config... | [
"Returns",
"a",
"configuration",
"instance",
"suitable",
"for",
"configuring",
"a",
"logger",
"with",
"the",
"same",
"name",
"."
] | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/LoggerConfig.java#L127-L136 |
19,443 | google/flogger | api/src/main/java/com/google/common/flogger/AbstractLogger.java | AbstractLogger.write | final void write(LogData data) {
checkNotNull(data, "data");
try {
backend.log(data);
} catch (RuntimeException error) {
try {
backend.handleError(error, data);
} catch (LoggingException allowed) {
// Bypass the catch-all if the exception is deliberately created during erro... | java | final void write(LogData data) {
checkNotNull(data, "data");
try {
backend.log(data);
} catch (RuntimeException error) {
try {
backend.handleError(error, data);
} catch (LoggingException allowed) {
// Bypass the catch-all if the exception is deliberately created during erro... | [
"final",
"void",
"write",
"(",
"LogData",
"data",
")",
"{",
"checkNotNull",
"(",
"data",
",",
"\"data\"",
")",
";",
"try",
"{",
"backend",
".",
"log",
"(",
"data",
")",
";",
"}",
"catch",
"(",
"RuntimeException",
"error",
")",
"{",
"try",
"{",
"backe... | Invokes the logging backend to write a log statement. | [
"Invokes",
"the",
"logging",
"backend",
"to",
"write",
"a",
"log",
"statement",
"."
] | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/AbstractLogger.java#L134-L149 |
19,444 | google/flogger | api/src/main/java/com/google/common/flogger/backend/SimpleMessageFormatter.java | SimpleMessageFormatter.safeFormatTo | private static void safeFormatTo(Formattable value, StringBuilder out, FormatOptions options) {
// Only care about 3 specific flags for Formattable.
int formatFlags = options.getFlags() & (FLAG_LEFT_ALIGN | FLAG_UPPER_CASE | FLAG_SHOW_ALT_FORM);
if (formatFlags != 0) {
// TODO: Maybe re-order the opti... | java | private static void safeFormatTo(Formattable value, StringBuilder out, FormatOptions options) {
// Only care about 3 specific flags for Formattable.
int formatFlags = options.getFlags() & (FLAG_LEFT_ALIGN | FLAG_UPPER_CASE | FLAG_SHOW_ALT_FORM);
if (formatFlags != 0) {
// TODO: Maybe re-order the opti... | [
"private",
"static",
"void",
"safeFormatTo",
"(",
"Formattable",
"value",
",",
"StringBuilder",
"out",
",",
"FormatOptions",
"options",
")",
"{",
"// Only care about 3 specific flags for Formattable.",
"int",
"formatFlags",
"=",
"options",
".",
"getFlags",
"(",
")",
"... | Returns a string representation of the user supplied formattable, accounting for any possible
runtime exceptions.
@param value the value to be formatted.
@return a best-effort string representation of the given value, even if exceptions were thrown. | [
"Returns",
"a",
"string",
"representation",
"of",
"the",
"user",
"supplied",
"formattable",
"accounting",
"for",
"any",
"possible",
"runtime",
"exceptions",
"."
] | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/backend/SimpleMessageFormatter.java#L131-L153 |
19,445 | google/flogger | log4j/src/main/java/com/google/common/flogger/backend/log4j/Log4jLoggerBackend.java | Log4jLoggerBackend.toLog4jLevel | static org.apache.log4j.Level toLog4jLevel(java.util.logging.Level level) {
if (level.intValue() >= java.util.logging.Level.SEVERE.intValue()) {
return org.apache.log4j.Level.ERROR;
} else if (level.intValue() >= java.util.logging.Level.WARNING.intValue()) {
return org.apache.log4j.Level.WARN;
}... | java | static org.apache.log4j.Level toLog4jLevel(java.util.logging.Level level) {
if (level.intValue() >= java.util.logging.Level.SEVERE.intValue()) {
return org.apache.log4j.Level.ERROR;
} else if (level.intValue() >= java.util.logging.Level.WARNING.intValue()) {
return org.apache.log4j.Level.WARN;
}... | [
"static",
"org",
".",
"apache",
".",
"log4j",
".",
"Level",
"toLog4jLevel",
"(",
"java",
".",
"util",
".",
"logging",
".",
"Level",
"level",
")",
"{",
"if",
"(",
"level",
".",
"intValue",
"(",
")",
">=",
"java",
".",
"util",
".",
"logging",
".",
"L... | Converts java.util.logging.Level to org.apache.log4j.Level. | [
"Converts",
"java",
".",
"util",
".",
"logging",
".",
"Level",
"to",
"org",
".",
"apache",
".",
"log4j",
".",
"Level",
"."
] | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/log4j/src/main/java/com/google/common/flogger/backend/log4j/Log4jLoggerBackend.java#L26-L37 |
19,446 | google/flogger | api/src/main/java/com/google/common/flogger/parser/ParseException.java | ParseException.withBounds | public static ParseException withBounds(
String errorMessage, String logMessage, int start, int end) {
return new ParseException(msg(errorMessage, logMessage, start, end), logMessage);
} | java | public static ParseException withBounds(
String errorMessage, String logMessage, int start, int end) {
return new ParseException(msg(errorMessage, logMessage, start, end), logMessage);
} | [
"public",
"static",
"ParseException",
"withBounds",
"(",
"String",
"errorMessage",
",",
"String",
"logMessage",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"new",
"ParseException",
"(",
"msg",
"(",
"errorMessage",
",",
"logMessage",
",",
"start... | Creates a new parse exception for situations in which both the start and end positions of the
error are known.
@param errorMessage the user error message.
@param logMessage the original log message.
@param start the index of the first character in the invalid section of the log message.
@param end the index after the ... | [
"Creates",
"a",
"new",
"parse",
"exception",
"for",
"situations",
"in",
"which",
"both",
"the",
"start",
"and",
"end",
"positions",
"of",
"the",
"error",
"are",
"known",
"."
] | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/parser/ParseException.java#L43-L46 |
19,447 | google/flogger | api/src/main/java/com/google/common/flogger/parser/ParseException.java | ParseException.atPosition | public static ParseException atPosition(String errorMessage, String logMessage, int position) {
return new ParseException(msg(errorMessage, logMessage, position, position + 1), logMessage);
} | java | public static ParseException atPosition(String errorMessage, String logMessage, int position) {
return new ParseException(msg(errorMessage, logMessage, position, position + 1), logMessage);
} | [
"public",
"static",
"ParseException",
"atPosition",
"(",
"String",
"errorMessage",
",",
"String",
"logMessage",
",",
"int",
"position",
")",
"{",
"return",
"new",
"ParseException",
"(",
"msg",
"(",
"errorMessage",
",",
"logMessage",
",",
"position",
",",
"positi... | Creates a new parse exception for situations in which the position of the error is known.
@param errorMessage the user error message.
@param logMessage the original log message.
@param position the index of the invalid character in the log message.
@return the parser exception. | [
"Creates",
"a",
"new",
"parse",
"exception",
"for",
"situations",
"in",
"which",
"the",
"position",
"of",
"the",
"error",
"is",
"known",
"."
] | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/parser/ParseException.java#L56-L58 |
19,448 | google/flogger | api/src/main/java/com/google/common/flogger/parser/ParseException.java | ParseException.withStartPosition | public static ParseException withStartPosition(
String errorMessage, String logMessage, int start) {
return new ParseException(msg(errorMessage, logMessage, start, -1), logMessage);
} | java | public static ParseException withStartPosition(
String errorMessage, String logMessage, int start) {
return new ParseException(msg(errorMessage, logMessage, start, -1), logMessage);
} | [
"public",
"static",
"ParseException",
"withStartPosition",
"(",
"String",
"errorMessage",
",",
"String",
"logMessage",
",",
"int",
"start",
")",
"{",
"return",
"new",
"ParseException",
"(",
"msg",
"(",
"errorMessage",
",",
"logMessage",
",",
"start",
",",
"-",
... | Creates a new parse exception for situations in which only the start position of the error is
known.
@param errorMessage the user error message.
@param logMessage the original log message.
@param start the index of the first character in the invalid section of the log message.
@return the parser exception. | [
"Creates",
"a",
"new",
"parse",
"exception",
"for",
"situations",
"in",
"which",
"only",
"the",
"start",
"position",
"of",
"the",
"error",
"is",
"known",
"."
] | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/parser/ParseException.java#L69-L72 |
19,449 | google/flogger | api/src/main/java/com/google/common/flogger/parser/ParseException.java | ParseException.msg | private static String msg(String errorMessage, String logMessage, int errorStart, int errorEnd) {
if (errorEnd < 0) {
errorEnd = logMessage.length();
}
StringBuilder out = new StringBuilder(errorMessage).append(": ");
if (errorStart > SNIPPET_LENGTH + ELLIPSIS.length()) {
out.append(ELLIPSIS... | java | private static String msg(String errorMessage, String logMessage, int errorStart, int errorEnd) {
if (errorEnd < 0) {
errorEnd = logMessage.length();
}
StringBuilder out = new StringBuilder(errorMessage).append(": ");
if (errorStart > SNIPPET_LENGTH + ELLIPSIS.length()) {
out.append(ELLIPSIS... | [
"private",
"static",
"String",
"msg",
"(",
"String",
"errorMessage",
",",
"String",
"logMessage",
",",
"int",
"errorStart",
",",
"int",
"errorEnd",
")",
"{",
"if",
"(",
"errorEnd",
"<",
"0",
")",
"{",
"errorEnd",
"=",
"logMessage",
".",
"length",
"(",
")... | Helper to format a human readable error message for this exception. | [
"Helper",
"to",
"format",
"a",
"human",
"readable",
"error",
"message",
"for",
"this",
"exception",
"."
] | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/parser/ParseException.java#L89-L106 |
19,450 | google/flogger | log4j/src/main/java/com/google/common/flogger/backend/log4j/LogDataFormatter.java | LogDataFormatter.formatBadLogData | static void formatBadLogData(
RuntimeException error, LogData badLogData, SimpleLogHandler receiver) {
StringBuilder errorMsg =
new StringBuilder("LOGGING ERROR: ").append(error.getMessage()).append('\n');
int length = errorMsg.length();
try {
appendLogData(badLogData, errorMsg);
} c... | java | static void formatBadLogData(
RuntimeException error, LogData badLogData, SimpleLogHandler receiver) {
StringBuilder errorMsg =
new StringBuilder("LOGGING ERROR: ").append(error.getMessage()).append('\n');
int length = errorMsg.length();
try {
appendLogData(badLogData, errorMsg);
} c... | [
"static",
"void",
"formatBadLogData",
"(",
"RuntimeException",
"error",
",",
"LogData",
"badLogData",
",",
"SimpleLogHandler",
"receiver",
")",
"{",
"StringBuilder",
"errorMsg",
"=",
"new",
"StringBuilder",
"(",
"\"LOGGING ERROR: \"",
")",
".",
"append",
"(",
"error... | Formats the log message in response to an exception during a previous logging attempt. A
synthetic error message is generated from the original log data and the given exception is set
as the cause. The level of this record is the maximum of WARNING or the original level. | [
"Formats",
"the",
"log",
"message",
"in",
"response",
"to",
"an",
"exception",
"during",
"a",
"previous",
"logging",
"attempt",
".",
"A",
"synthetic",
"error",
"message",
"is",
"generated",
"from",
"the",
"original",
"log",
"data",
"and",
"the",
"given",
"ex... | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/log4j/src/main/java/com/google/common/flogger/backend/log4j/LogDataFormatter.java#L44-L62 |
19,451 | google/flogger | api/src/main/java/com/google/common/flogger/backend/FormatOptions.java | FormatOptions.of | public static FormatOptions of(int flags, int width, int precision) {
if (!checkFlagConsistency(flags, width != UNSET)) {
throw new IllegalArgumentException("invalid flags: 0x" + Integer.toHexString(flags));
}
if ((width < 1 || width > MAX_ALLOWED_WIDTH) && width != UNSET) {
throw new IllegalArg... | java | public static FormatOptions of(int flags, int width, int precision) {
if (!checkFlagConsistency(flags, width != UNSET)) {
throw new IllegalArgumentException("invalid flags: 0x" + Integer.toHexString(flags));
}
if ((width < 1 || width > MAX_ALLOWED_WIDTH) && width != UNSET) {
throw new IllegalArg... | [
"public",
"static",
"FormatOptions",
"of",
"(",
"int",
"flags",
",",
"int",
"width",
",",
"int",
"precision",
")",
"{",
"if",
"(",
"!",
"checkFlagConsistency",
"(",
"flags",
",",
"width",
"!=",
"UNSET",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentExcept... | Creates a options instance with the given values. | [
"Creates",
"a",
"options",
"instance",
"with",
"the",
"given",
"values",
"."
] | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/backend/FormatOptions.java#L137-L148 |
19,452 | google/flogger | api/src/main/java/com/google/common/flogger/backend/FormatOptions.java | FormatOptions.parse | public static FormatOptions parse(String message, int pos, int end, boolean isUpperCase)
throws ParseException {
// It is vital that we shortcut parsing and return the default instance here (rather than just
// creating a new instance with default values) because we check for it using '==' later).
// ... | java | public static FormatOptions parse(String message, int pos, int end, boolean isUpperCase)
throws ParseException {
// It is vital that we shortcut parsing and return the default instance here (rather than just
// creating a new instance with default values) because we check for it using '==' later).
// ... | [
"public",
"static",
"FormatOptions",
"parse",
"(",
"String",
"message",
",",
"int",
"pos",
",",
"int",
"end",
",",
"boolean",
"isUpperCase",
")",
"throws",
"ParseException",
"{",
"// It is vital that we shortcut parsing and return the default instance here (rather than just",... | Parses a sub-sequence of a log message to extract and return its options. Note that callers
cannot rely on this method producing new instances each time it is called as caching of common
option values may occur.
@param message the original log message in which the formatting options have been identified.
@param pos th... | [
"Parses",
"a",
"sub",
"-",
"sequence",
"of",
"a",
"log",
"message",
"to",
"extract",
"and",
"return",
"its",
"options",
".",
"Note",
"that",
"callers",
"cannot",
"rely",
"on",
"this",
"method",
"producing",
"new",
"instances",
"each",
"time",
"it",
"is",
... | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/backend/FormatOptions.java#L161-L220 |
19,453 | google/flogger | api/src/main/java/com/google/common/flogger/backend/FormatOptions.java | FormatOptions.parseValidFlags | static int parseValidFlags(String flagChars, boolean hasUpperVariant) {
int flags = hasUpperVariant ? FLAG_UPPER_CASE : 0;
for (int i = 0; i < flagChars.length(); i++) {
int flagIdx = indexOfFlagCharacter(flagChars.charAt(i));
if (flagIdx < 0) {
throw new IllegalArgumentException("invalid fl... | java | static int parseValidFlags(String flagChars, boolean hasUpperVariant) {
int flags = hasUpperVariant ? FLAG_UPPER_CASE : 0;
for (int i = 0; i < flagChars.length(); i++) {
int flagIdx = indexOfFlagCharacter(flagChars.charAt(i));
if (flagIdx < 0) {
throw new IllegalArgumentException("invalid fl... | [
"static",
"int",
"parseValidFlags",
"(",
"String",
"flagChars",
",",
"boolean",
"hasUpperVariant",
")",
"{",
"int",
"flags",
"=",
"hasUpperVariant",
"?",
"FLAG_UPPER_CASE",
":",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"flagChars",
".",
... | Internal helper method for creating a bit-mask from a string of valid flag characters. | [
"Internal",
"helper",
"method",
"for",
"creating",
"a",
"bit",
"-",
"mask",
"from",
"a",
"string",
"of",
"valid",
"flag",
"characters",
"."
] | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/backend/FormatOptions.java#L245-L255 |
19,454 | google/flogger | api/src/main/java/com/google/common/flogger/backend/FormatOptions.java | FormatOptions.filter | public FormatOptions filter(int allowedFlags, boolean allowWidth, boolean allowPrecision) {
if (isDefault()) {
return this;
}
int newFlags = allowedFlags & flags;
int newWidth = allowWidth ? width : UNSET;
int newPrecision = allowPrecision ? precision : UNSET;
// Remember that we must neve... | java | public FormatOptions filter(int allowedFlags, boolean allowWidth, boolean allowPrecision) {
if (isDefault()) {
return this;
}
int newFlags = allowedFlags & flags;
int newWidth = allowWidth ? width : UNSET;
int newPrecision = allowPrecision ? precision : UNSET;
// Remember that we must neve... | [
"public",
"FormatOptions",
"filter",
"(",
"int",
"allowedFlags",
",",
"boolean",
"allowWidth",
",",
"boolean",
"allowPrecision",
")",
"{",
"if",
"(",
"isDefault",
"(",
")",
")",
"{",
"return",
"this",
";",
"}",
"int",
"newFlags",
"=",
"allowedFlags",
"&",
... | Returns a possibly new FormatOptions instance possibly containing a subset of the formatting
information. This is useful if a backend implementation wishes to create formatting options
that ignore some of the specified formatting information.
@param allowedFlags A mask of flag values to be retained in the returned ins... | [
"Returns",
"a",
"possibly",
"new",
"FormatOptions",
"instance",
"possibly",
"containing",
"a",
"subset",
"of",
"the",
"formatting",
"information",
".",
"This",
"is",
"useful",
"if",
"a",
"backend",
"implementation",
"wishes",
"to",
"create",
"formatting",
"options... | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/backend/FormatOptions.java#L278-L297 |
19,455 | google/flogger | api/src/main/java/com/google/common/flogger/backend/FormatOptions.java | FormatOptions.checkFlagConsistency | static boolean checkFlagConsistency(int flags, boolean hasWidth) {
// Check that we specify at most one of 'prefix plus' and 'prefix space'.
if ((flags & (FLAG_PREFIX_PLUS_FOR_POSITIVE_VALUES | FLAG_PREFIX_SPACE_FOR_POSITIVE_VALUES))
== (FLAG_PREFIX_PLUS_FOR_POSITIVE_VALUES | FLAG_PREFIX_SPACE_FOR_POSIT... | java | static boolean checkFlagConsistency(int flags, boolean hasWidth) {
// Check that we specify at most one of 'prefix plus' and 'prefix space'.
if ((flags & (FLAG_PREFIX_PLUS_FOR_POSITIVE_VALUES | FLAG_PREFIX_SPACE_FOR_POSITIVE_VALUES))
== (FLAG_PREFIX_PLUS_FOR_POSITIVE_VALUES | FLAG_PREFIX_SPACE_FOR_POSIT... | [
"static",
"boolean",
"checkFlagConsistency",
"(",
"int",
"flags",
",",
"boolean",
"hasWidth",
")",
"{",
"// Check that we specify at most one of 'prefix plus' and 'prefix space'.",
"if",
"(",
"(",
"flags",
"&",
"(",
"FLAG_PREFIX_PLUS_FOR_POSITIVE_VALUES",
"|",
"FLAG_PREFIX_SP... | Helper to check for legal combinations of flags. | [
"Helper",
"to",
"check",
"for",
"legal",
"combinations",
"of",
"flags",
"."
] | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/backend/FormatOptions.java#L353-L369 |
19,456 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/util/Generics.java | Generics.resolveTypeVariable | public Class resolveTypeVariable (TypeVariable typeVariable) {
for (int i = argumentsSize - 2; i >= 0; i -= 2)
if (arguments[i] == typeVariable) return (Class)arguments[i + 1];
return null;
} | java | public Class resolveTypeVariable (TypeVariable typeVariable) {
for (int i = argumentsSize - 2; i >= 0; i -= 2)
if (arguments[i] == typeVariable) return (Class)arguments[i + 1];
return null;
} | [
"public",
"Class",
"resolveTypeVariable",
"(",
"TypeVariable",
"typeVariable",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"argumentsSize",
"-",
"2",
";",
"i",
">=",
"0",
";",
"i",
"-=",
"2",
")",
"if",
"(",
"arguments",
"[",
"i",
"]",
"==",
"typeVariable",... | Returns the class for the specified type variable, or null if it is not known.
@return May be null. | [
"Returns",
"the",
"class",
"for",
"the",
"specified",
"type",
"variable",
"or",
"null",
"if",
"it",
"is",
"not",
"known",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/util/Generics.java#L163-L167 |
19,457 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/util/GenericsUtil.java | GenericsUtil.resolveType | static public Type resolveType (Class fromClass, Class toClass, Type type) {
// Explicit type, eg String.
if (type instanceof Class) return (Class)type;
// Type variable, eg T.
if (type instanceof TypeVariable) return resolveTypeVariable(fromClass, toClass, type, true);
// Type which has a type parameter, e... | java | static public Type resolveType (Class fromClass, Class toClass, Type type) {
// Explicit type, eg String.
if (type instanceof Class) return (Class)type;
// Type variable, eg T.
if (type instanceof TypeVariable) return resolveTypeVariable(fromClass, toClass, type, true);
// Type which has a type parameter, e... | [
"static",
"public",
"Type",
"resolveType",
"(",
"Class",
"fromClass",
",",
"Class",
"toClass",
",",
"Type",
"type",
")",
"{",
"// Explicit type, eg String.",
"if",
"(",
"type",
"instanceof",
"Class",
")",
"return",
"(",
"Class",
")",
"type",
";",
"// Type vari... | Returns the class for the specified type after replacing any type variables using the class hierarchy between the specified
classes.
@param toClass Must be a sub class of fromClass. | [
"Returns",
"the",
"class",
"for",
"the",
"specified",
"type",
"after",
"replacing",
"any",
"type",
"variables",
"using",
"the",
"class",
"hierarchy",
"between",
"the",
"specified",
"classes",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/util/GenericsUtil.java#L36-L72 |
19,458 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/util/GenericsUtil.java | GenericsUtil.resolveTypeVariable | static private Type resolveTypeVariable (Class fromClass, Class current, Type type, boolean first) {
Type genericSuper = current.getGenericSuperclass();
if (!(genericSuper instanceof ParameterizedType)) return type; // No type arguments passed to super class.
// Search fromClass to current inclusive, using the c... | java | static private Type resolveTypeVariable (Class fromClass, Class current, Type type, boolean first) {
Type genericSuper = current.getGenericSuperclass();
if (!(genericSuper instanceof ParameterizedType)) return type; // No type arguments passed to super class.
// Search fromClass to current inclusive, using the c... | [
"static",
"private",
"Type",
"resolveTypeVariable",
"(",
"Class",
"fromClass",
",",
"Class",
"current",
",",
"Type",
"type",
",",
"boolean",
"first",
")",
"{",
"Type",
"genericSuper",
"=",
"current",
".",
"getGenericSuperclass",
"(",
")",
";",
"if",
"(",
"!"... | Returns the class for the specified type variable by finding the first class in the hierarchy between the specified classes
which explicitly specifies the type variable's class.
@param current Must be a sub class of fromClass.
@return A Class if the type variable was resolved, else a TypeVariable to continue searching ... | [
"Returns",
"the",
"class",
"for",
"the",
"specified",
"type",
"variable",
"by",
"finding",
"the",
"first",
"class",
"in",
"the",
"hierarchy",
"between",
"the",
"specified",
"classes",
"which",
"explicitly",
"specifies",
"the",
"type",
"variable",
"s",
"class",
... | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/util/GenericsUtil.java#L79-L113 |
19,459 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/util/GenericsUtil.java | GenericsUtil.resolveTypeParameters | static public Type[] resolveTypeParameters (Class fromClass, Class toClass, Type type) {
// Type which has a type parameter, eg ArrayList<T>.
if (type instanceof ParameterizedType) {
Type[] actualArgs = ((ParameterizedType)type).getActualTypeArguments();
int n = actualArgs.length;
Type[] generics = new Typ... | java | static public Type[] resolveTypeParameters (Class fromClass, Class toClass, Type type) {
// Type which has a type parameter, eg ArrayList<T>.
if (type instanceof ParameterizedType) {
Type[] actualArgs = ((ParameterizedType)type).getActualTypeArguments();
int n = actualArgs.length;
Type[] generics = new Typ... | [
"static",
"public",
"Type",
"[",
"]",
"resolveTypeParameters",
"(",
"Class",
"fromClass",
",",
"Class",
"toClass",
",",
"Type",
"type",
")",
"{",
"// Type which has a type parameter, eg ArrayList<T>.",
"if",
"(",
"type",
"instanceof",
"ParameterizedType",
")",
"{",
... | Resolves type variables for the type parameters of the specified type by using the class hierarchy between the specified
classes.
@param toClass Must be a sub class of fromClass.
@return Null if the type has no type parameters, else contains Class entries for type parameters that were resolved and
TypeVariable entries ... | [
"Resolves",
"type",
"variables",
"for",
"the",
"type",
"parameters",
"of",
"the",
"specified",
"type",
"by",
"using",
"the",
"class",
"hierarchy",
"between",
"the",
"specified",
"classes",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/util/GenericsUtil.java#L120-L141 |
19,460 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/io/Input.java | Input.require | protected int require (int required) throws KryoException {
int remaining = limit - position;
if (remaining >= required) return remaining;
if (required > capacity) throw new KryoException("Buffer too small: capacity: " + capacity + ", required: " + required);
int count;
// Try to fill the buffer.
if... | java | protected int require (int required) throws KryoException {
int remaining = limit - position;
if (remaining >= required) return remaining;
if (required > capacity) throw new KryoException("Buffer too small: capacity: " + capacity + ", required: " + required);
int count;
// Try to fill the buffer.
if... | [
"protected",
"int",
"require",
"(",
"int",
"required",
")",
"throws",
"KryoException",
"{",
"int",
"remaining",
"=",
"limit",
"-",
"position",
";",
"if",
"(",
"remaining",
">=",
"required",
")",
"return",
"remaining",
";",
"if",
"(",
"required",
">",
"capa... | Fills the buffer with at least the number of bytes specified.
@param required Must be > 0.
@return The number of bytes remaining in the buffer, which will be at least <code>required</code> bytes.
@throws KryoException if {@link #fill(byte[], int, int)} is unable to provide more bytes (buffer underflow). | [
"Fills",
"the",
"buffer",
"with",
"at",
"least",
"the",
"number",
"of",
"bytes",
"specified",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/io/Input.java#L193-L227 |
19,461 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/io/Input.java | Input.optional | protected int optional (int optional) throws KryoException {
int remaining = limit - position;
if (remaining >= optional) return optional;
optional = Math.min(optional, capacity);
int count;
// Try to fill the buffer.
count = fill(buffer, limit, capacity - limit);
if (count == -1) return remain... | java | protected int optional (int optional) throws KryoException {
int remaining = limit - position;
if (remaining >= optional) return optional;
optional = Math.min(optional, capacity);
int count;
// Try to fill the buffer.
count = fill(buffer, limit, capacity - limit);
if (count == -1) return remain... | [
"protected",
"int",
"optional",
"(",
"int",
"optional",
")",
"throws",
"KryoException",
"{",
"int",
"remaining",
"=",
"limit",
"-",
"position",
";",
"if",
"(",
"remaining",
">=",
"optional",
")",
"return",
"optional",
";",
"optional",
"=",
"Math",
".",
"mi... | Fills the buffer with at least the number of bytes specified, if possible.
@param optional Must be > 0.
@return the number of bytes remaining, but not more than optional, or -1 if {@link #fill(byte[], int, int)} is unable to
provide more bytes. | [
"Fills",
"the",
"buffer",
"with",
"at",
"least",
"the",
"number",
"of",
"bytes",
"specified",
"if",
"possible",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/io/Input.java#L233-L263 |
19,462 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/io/Input.java | Input.readInt | public int readInt () throws KryoException {
require(4);
byte[] buffer = this.buffer;
int p = this.position;
this.position = p + 4;
return buffer[p] & 0xFF //
| (buffer[p + 1] & 0xFF) << 8 //
| (buffer[p + 2] & 0xFF) << 16 //
| (buffer[p + 3] & 0xFF) << 24;
} | java | public int readInt () throws KryoException {
require(4);
byte[] buffer = this.buffer;
int p = this.position;
this.position = p + 4;
return buffer[p] & 0xFF //
| (buffer[p + 1] & 0xFF) << 8 //
| (buffer[p + 2] & 0xFF) << 16 //
| (buffer[p + 3] & 0xFF) << 24;
} | [
"public",
"int",
"readInt",
"(",
")",
"throws",
"KryoException",
"{",
"require",
"(",
"4",
")",
";",
"byte",
"[",
"]",
"buffer",
"=",
"this",
".",
"buffer",
";",
"int",
"p",
"=",
"this",
".",
"position",
";",
"this",
".",
"position",
"=",
"p",
"+",... | Reads a 4 byte int. | [
"Reads",
"a",
"4",
"byte",
"int",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/io/Input.java#L377-L386 |
19,463 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/io/Input.java | Input.readVarInt | public int readVarInt (boolean optimizePositive) throws KryoException {
if (require(1) < 5) return readVarInt_slow(optimizePositive);
int b = buffer[position++];
int result = b & 0x7F;
if ((b & 0x80) != 0) {
byte[] buffer = this.buffer;
int p = position;
b = buffer[p++];
result |= (b & 0x7F)... | java | public int readVarInt (boolean optimizePositive) throws KryoException {
if (require(1) < 5) return readVarInt_slow(optimizePositive);
int b = buffer[position++];
int result = b & 0x7F;
if ((b & 0x80) != 0) {
byte[] buffer = this.buffer;
int p = position;
b = buffer[p++];
result |= (b & 0x7F)... | [
"public",
"int",
"readVarInt",
"(",
"boolean",
"optimizePositive",
")",
"throws",
"KryoException",
"{",
"if",
"(",
"require",
"(",
"1",
")",
"<",
"5",
")",
"return",
"readVarInt_slow",
"(",
"optimizePositive",
")",
";",
"int",
"b",
"=",
"buffer",
"[",
"pos... | Reads a 1-5 byte int.
@see #canReadVarInt() | [
"Reads",
"a",
"1",
"-",
"5",
"byte",
"int",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/io/Input.java#L406-L430 |
19,464 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/io/Input.java | Input.readLong | public long readLong () throws KryoException {
require(8);
byte[] buffer = this.buffer;
int p = position;
position = p + 8;
return buffer[p] & 0xFF //
| (buffer[p + 1] & 0xFF) << 8 //
| (buffer[p + 2] & 0xFF) << 16 //
| (long)(buffer[p + 3] & 0xFF) << 24 //
| (long)(buffer[p + 4] & 0xFF) ... | java | public long readLong () throws KryoException {
require(8);
byte[] buffer = this.buffer;
int p = position;
position = p + 8;
return buffer[p] & 0xFF //
| (buffer[p + 1] & 0xFF) << 8 //
| (buffer[p + 2] & 0xFF) << 16 //
| (long)(buffer[p + 3] & 0xFF) << 24 //
| (long)(buffer[p + 4] & 0xFF) ... | [
"public",
"long",
"readLong",
"(",
")",
"throws",
"KryoException",
"{",
"require",
"(",
"8",
")",
";",
"byte",
"[",
"]",
"buffer",
"=",
"this",
".",
"buffer",
";",
"int",
"p",
"=",
"position",
";",
"position",
"=",
"p",
"+",
"8",
";",
"return",
"bu... | Reads an 8 byte long. | [
"Reads",
"an",
"8",
"byte",
"long",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/io/Input.java#L543-L556 |
19,465 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/io/Input.java | Input.readVarLong | public long readVarLong (boolean optimizePositive) throws KryoException {
if (require(1) < 9) return readVarLong_slow(optimizePositive);
int p = position;
int b = buffer[p++];
long result = b & 0x7F;
if ((b & 0x80) != 0) {
byte[] buffer = this.buffer;
b = buffer[p++];
result |= (b & 0x7F) << ... | java | public long readVarLong (boolean optimizePositive) throws KryoException {
if (require(1) < 9) return readVarLong_slow(optimizePositive);
int p = position;
int b = buffer[p++];
long result = b & 0x7F;
if ((b & 0x80) != 0) {
byte[] buffer = this.buffer;
b = buffer[p++];
result |= (b & 0x7F) << ... | [
"public",
"long",
"readVarLong",
"(",
"boolean",
"optimizePositive",
")",
"throws",
"KryoException",
"{",
"if",
"(",
"require",
"(",
"1",
")",
"<",
"9",
")",
"return",
"readVarLong_slow",
"(",
"optimizePositive",
")",
";",
"int",
"p",
"=",
"position",
";",
... | Reads a 1-9 byte long.
@see #canReadLong() | [
"Reads",
"a",
"1",
"-",
"9",
"byte",
"long",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/io/Input.java#L569-L609 |
19,466 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/io/Input.java | Input.readFloat | public float readFloat () throws KryoException {
require(4);
byte[] buffer = this.buffer;
int p = this.position;
this.position = p + 4;
return Float.intBitsToFloat(buffer[p] & 0xFF //
| (buffer[p + 1] & 0xFF) << 8 //
| (buffer[p + 2] & 0xFF) << 16 //
| (buffer[p + 3] & 0xFF) << 24);
} | java | public float readFloat () throws KryoException {
require(4);
byte[] buffer = this.buffer;
int p = this.position;
this.position = p + 4;
return Float.intBitsToFloat(buffer[p] & 0xFF //
| (buffer[p + 1] & 0xFF) << 8 //
| (buffer[p + 2] & 0xFF) << 16 //
| (buffer[p + 3] & 0xFF) << 24);
} | [
"public",
"float",
"readFloat",
"(",
")",
"throws",
"KryoException",
"{",
"require",
"(",
"4",
")",
";",
"byte",
"[",
"]",
"buffer",
"=",
"this",
".",
"buffer",
";",
"int",
"p",
"=",
"this",
".",
"position",
";",
"this",
".",
"position",
"=",
"p",
... | Reads a 4 byte float. | [
"Reads",
"a",
"4",
"byte",
"float",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/io/Input.java#L694-L703 |
19,467 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/io/Input.java | Input.readDouble | public double readDouble () throws KryoException {
require(8);
byte[] buffer = this.buffer;
int p = position;
position = p + 8;
return Double.longBitsToDouble(buffer[p] & 0xFF //
| (buffer[p + 1] & 0xFF) << 8 //
| (buffer[p + 2] & 0xFF) << 16 //
| (long)(buffer[p + 3] & 0xFF) << 24 //
| (... | java | public double readDouble () throws KryoException {
require(8);
byte[] buffer = this.buffer;
int p = position;
position = p + 8;
return Double.longBitsToDouble(buffer[p] & 0xFF //
| (buffer[p + 1] & 0xFF) << 8 //
| (buffer[p + 2] & 0xFF) << 16 //
| (long)(buffer[p + 3] & 0xFF) << 24 //
| (... | [
"public",
"double",
"readDouble",
"(",
")",
"throws",
"KryoException",
"{",
"require",
"(",
"8",
")",
";",
"byte",
"[",
"]",
"buffer",
"=",
"this",
".",
"buffer",
";",
"int",
"p",
"=",
"position",
";",
"position",
"=",
"p",
"+",
"8",
";",
"return",
... | Reads an 8 byte double. | [
"Reads",
"an",
"8",
"byte",
"double",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/io/Input.java#L713-L726 |
19,468 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/io/Input.java | Input.readShort | public short readShort () throws KryoException {
require(2);
int p = position;
position = p + 2;
return (short)((buffer[p] & 0xFF) | ((buffer[p + 1] & 0xFF)) << 8);
} | java | public short readShort () throws KryoException {
require(2);
int p = position;
position = p + 2;
return (short)((buffer[p] & 0xFF) | ((buffer[p + 1] & 0xFF)) << 8);
} | [
"public",
"short",
"readShort",
"(",
")",
"throws",
"KryoException",
"{",
"require",
"(",
"2",
")",
";",
"int",
"p",
"=",
"position",
";",
"position",
"=",
"p",
"+",
"2",
";",
"return",
"(",
"short",
")",
"(",
"(",
"buffer",
"[",
"p",
"]",
"&",
"... | Reads a 2 byte short. | [
"Reads",
"a",
"2",
"byte",
"short",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/io/Input.java#L736-L741 |
19,469 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/io/Input.java | Input.readShortUnsigned | public int readShortUnsigned () throws KryoException {
require(2);
int p = position;
position = p + 2;
return (buffer[p] & 0xFF) | ((buffer[p + 1] & 0xFF)) << 8;
} | java | public int readShortUnsigned () throws KryoException {
require(2);
int p = position;
position = p + 2;
return (buffer[p] & 0xFF) | ((buffer[p + 1] & 0xFF)) << 8;
} | [
"public",
"int",
"readShortUnsigned",
"(",
")",
"throws",
"KryoException",
"{",
"require",
"(",
"2",
")",
";",
"int",
"p",
"=",
"position",
";",
"position",
"=",
"p",
"+",
"2",
";",
"return",
"(",
"buffer",
"[",
"p",
"]",
"&",
"0xFF",
")",
"|",
"("... | Reads a 2 byte short as an int from 0 to 65535. | [
"Reads",
"a",
"2",
"byte",
"short",
"as",
"an",
"int",
"from",
"0",
"to",
"65535",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/io/Input.java#L744-L749 |
19,470 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/io/Input.java | Input.readChar | public char readChar () throws KryoException {
require(2);
int p = position;
position = p + 2;
return (char)((buffer[p] & 0xFF) | ((buffer[p + 1] & 0xFF)) << 8);
} | java | public char readChar () throws KryoException {
require(2);
int p = position;
position = p + 2;
return (char)((buffer[p] & 0xFF) | ((buffer[p + 1] & 0xFF)) << 8);
} | [
"public",
"char",
"readChar",
"(",
")",
"throws",
"KryoException",
"{",
"require",
"(",
"2",
")",
";",
"int",
"p",
"=",
"position",
";",
"position",
"=",
"p",
"+",
"2",
";",
"return",
"(",
"char",
")",
"(",
"(",
"buffer",
"[",
"p",
"]",
"&",
"0xF... | Reads a 2 byte char. | [
"Reads",
"a",
"2",
"byte",
"char",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/io/Input.java#L754-L759 |
19,471 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/io/Input.java | Input.readInts | public int[] readInts (int length) throws KryoException {
int[] array = new int[length];
if (optional(length << 2) == length << 2) {
byte[] buffer = this.buffer;
int p = this.position;
for (int i = 0; i < length; i++, p += 4) {
array[i] = buffer[p] & 0xFF //
| (buffer[p + 1] & 0xFF) << 8 //... | java | public int[] readInts (int length) throws KryoException {
int[] array = new int[length];
if (optional(length << 2) == length << 2) {
byte[] buffer = this.buffer;
int p = this.position;
for (int i = 0; i < length; i++, p += 4) {
array[i] = buffer[p] & 0xFF //
| (buffer[p + 1] & 0xFF) << 8 //... | [
"public",
"int",
"[",
"]",
"readInts",
"(",
"int",
"length",
")",
"throws",
"KryoException",
"{",
"int",
"[",
"]",
"array",
"=",
"new",
"int",
"[",
"length",
"]",
";",
"if",
"(",
"optional",
"(",
"length",
"<<",
"2",
")",
"==",
"length",
"<<",
"2",... | Reads an int array in bulk. This may be more efficient than reading them individually. | [
"Reads",
"an",
"int",
"array",
"in",
"bulk",
".",
"This",
"may",
"be",
"more",
"efficient",
"than",
"reading",
"them",
"individually",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/io/Input.java#L905-L922 |
19,472 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/io/Input.java | Input.readLongs | public long[] readLongs (int length) throws KryoException {
long[] array = new long[length];
if (optional(length << 3) == length << 3) {
byte[] buffer = this.buffer;
int p = this.position;
for (int i = 0; i < length; i++, p += 8) {
array[i] = buffer[p] & 0xFF //
| (buffer[p + 1] & 0xFF) << ... | java | public long[] readLongs (int length) throws KryoException {
long[] array = new long[length];
if (optional(length << 3) == length << 3) {
byte[] buffer = this.buffer;
int p = this.position;
for (int i = 0; i < length; i++, p += 8) {
array[i] = buffer[p] & 0xFF //
| (buffer[p + 1] & 0xFF) << ... | [
"public",
"long",
"[",
"]",
"readLongs",
"(",
"int",
"length",
")",
"throws",
"KryoException",
"{",
"long",
"[",
"]",
"array",
"=",
"new",
"long",
"[",
"length",
"]",
";",
"if",
"(",
"optional",
"(",
"length",
"<<",
"3",
")",
"==",
"length",
"<<",
... | Reads a long array in bulk. This may be more efficient than reading them individually. | [
"Reads",
"a",
"long",
"array",
"in",
"bulk",
".",
"This",
"may",
"be",
"more",
"efficient",
"than",
"reading",
"them",
"individually",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/io/Input.java#L937-L958 |
19,473 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/io/Input.java | Input.readFloats | public float[] readFloats (int length) throws KryoException {
float[] array = new float[length];
if (optional(length << 2) == length << 2) {
byte[] buffer = this.buffer;
int p = this.position;
for (int i = 0; i < length; i++, p += 4) {
array[i] = Float.intBitsToFloat(buffer[p] & 0xFF //
| (... | java | public float[] readFloats (int length) throws KryoException {
float[] array = new float[length];
if (optional(length << 2) == length << 2) {
byte[] buffer = this.buffer;
int p = this.position;
for (int i = 0; i < length; i++, p += 4) {
array[i] = Float.intBitsToFloat(buffer[p] & 0xFF //
| (... | [
"public",
"float",
"[",
"]",
"readFloats",
"(",
"int",
"length",
")",
"throws",
"KryoException",
"{",
"float",
"[",
"]",
"array",
"=",
"new",
"float",
"[",
"length",
"]",
";",
"if",
"(",
"optional",
"(",
"length",
"<<",
"2",
")",
"==",
"length",
"<<"... | Reads a float array in bulk. This may be more efficient than reading them individually. | [
"Reads",
"a",
"float",
"array",
"in",
"bulk",
".",
"This",
"may",
"be",
"more",
"efficient",
"than",
"reading",
"them",
"individually",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/io/Input.java#L973-L990 |
19,474 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/io/Input.java | Input.readDoubles | public double[] readDoubles (int length) throws KryoException {
double[] array = new double[length];
if (optional(length << 3) == length << 3) {
byte[] buffer = this.buffer;
int p = this.position;
for (int i = 0; i < length; i++, p += 8) {
array[i] = Double.longBitsToDouble(buffer[p] & 0xFF //
... | java | public double[] readDoubles (int length) throws KryoException {
double[] array = new double[length];
if (optional(length << 3) == length << 3) {
byte[] buffer = this.buffer;
int p = this.position;
for (int i = 0; i < length; i++, p += 8) {
array[i] = Double.longBitsToDouble(buffer[p] & 0xFF //
... | [
"public",
"double",
"[",
"]",
"readDoubles",
"(",
"int",
"length",
")",
"throws",
"KryoException",
"{",
"double",
"[",
"]",
"array",
"=",
"new",
"double",
"[",
"length",
"]",
";",
"if",
"(",
"optional",
"(",
"length",
"<<",
"3",
")",
"==",
"length",
... | Reads a double array in bulk. This may be more efficient than reading them individually. | [
"Reads",
"a",
"double",
"array",
"in",
"bulk",
".",
"This",
"may",
"be",
"more",
"efficient",
"than",
"reading",
"them",
"individually",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/io/Input.java#L993-L1014 |
19,475 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/io/Input.java | Input.readShorts | public short[] readShorts (int length) throws KryoException {
short[] array = new short[length];
if (optional(length << 1) == length << 1) {
byte[] buffer = this.buffer;
int p = this.position;
for (int i = 0; i < length; i++, p += 2)
array[i] = (short)((buffer[p] & 0xFF) | ((buffer[p + 1] & 0xFF)... | java | public short[] readShorts (int length) throws KryoException {
short[] array = new short[length];
if (optional(length << 1) == length << 1) {
byte[] buffer = this.buffer;
int p = this.position;
for (int i = 0; i < length; i++, p += 2)
array[i] = (short)((buffer[p] & 0xFF) | ((buffer[p + 1] & 0xFF)... | [
"public",
"short",
"[",
"]",
"readShorts",
"(",
"int",
"length",
")",
"throws",
"KryoException",
"{",
"short",
"[",
"]",
"array",
"=",
"new",
"short",
"[",
"length",
"]",
";",
"if",
"(",
"optional",
"(",
"length",
"<<",
"1",
")",
"==",
"length",
"<<"... | Reads a short array in bulk. This may be more efficient than reading them individually. | [
"Reads",
"a",
"short",
"array",
"in",
"bulk",
".",
"This",
"may",
"be",
"more",
"efficient",
"than",
"reading",
"them",
"individually",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/io/Input.java#L1017-L1030 |
19,476 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/io/Input.java | Input.readChars | public char[] readChars (int length) throws KryoException {
char[] array = new char[length];
if (optional(length << 1) == length << 1) {
byte[] buffer = this.buffer;
int p = this.position;
for (int i = 0; i < length; i++, p += 2)
array[i] = (char)((buffer[p] & 0xFF) | ((buffer[p + 1] & 0xFF)) << ... | java | public char[] readChars (int length) throws KryoException {
char[] array = new char[length];
if (optional(length << 1) == length << 1) {
byte[] buffer = this.buffer;
int p = this.position;
for (int i = 0; i < length; i++, p += 2)
array[i] = (char)((buffer[p] & 0xFF) | ((buffer[p + 1] & 0xFF)) << ... | [
"public",
"char",
"[",
"]",
"readChars",
"(",
"int",
"length",
")",
"throws",
"KryoException",
"{",
"char",
"[",
"]",
"array",
"=",
"new",
"char",
"[",
"length",
"]",
";",
"if",
"(",
"optional",
"(",
"length",
"<<",
"1",
")",
"==",
"length",
"<<",
... | Reads a char array in bulk. This may be more efficient than reading them individually. | [
"Reads",
"a",
"char",
"array",
"in",
"bulk",
".",
"This",
"may",
"be",
"more",
"efficient",
"than",
"reading",
"them",
"individually",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/io/Input.java#L1033-L1046 |
19,477 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/io/Input.java | Input.readBooleans | public boolean[] readBooleans (int length) throws KryoException {
boolean[] array = new boolean[length];
if (optional(length) == length) {
byte[] buffer = this.buffer;
int p = this.position;
for (int i = 0; i < length; i++, p++)
array[i] = buffer[p] != 0;
position = p;
} else {
for (in... | java | public boolean[] readBooleans (int length) throws KryoException {
boolean[] array = new boolean[length];
if (optional(length) == length) {
byte[] buffer = this.buffer;
int p = this.position;
for (int i = 0; i < length; i++, p++)
array[i] = buffer[p] != 0;
position = p;
} else {
for (in... | [
"public",
"boolean",
"[",
"]",
"readBooleans",
"(",
"int",
"length",
")",
"throws",
"KryoException",
"{",
"boolean",
"[",
"]",
"array",
"=",
"new",
"boolean",
"[",
"length",
"]",
";",
"if",
"(",
"optional",
"(",
"length",
")",
"==",
"length",
")",
"{",... | Reads a boolean array in bulk. This may be more efficient than reading them individually. | [
"Reads",
"a",
"boolean",
"array",
"in",
"bulk",
".",
"This",
"may",
"be",
"more",
"efficient",
"than",
"reading",
"them",
"individually",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/io/Input.java#L1049-L1062 |
19,478 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/serializers/FieldSerializer.java | FieldSerializer.getField | public CachedField getField (String fieldName) {
for (CachedField cachedField : cachedFields.fields)
if (cachedField.name.equals(fieldName)) return cachedField;
throw new IllegalArgumentException("Field \"" + fieldName + "\" not found on class: " + type.getName());
} | java | public CachedField getField (String fieldName) {
for (CachedField cachedField : cachedFields.fields)
if (cachedField.name.equals(fieldName)) return cachedField;
throw new IllegalArgumentException("Field \"" + fieldName + "\" not found on class: " + type.getName());
} | [
"public",
"CachedField",
"getField",
"(",
"String",
"fieldName",
")",
"{",
"for",
"(",
"CachedField",
"cachedField",
":",
"cachedFields",
".",
"fields",
")",
"if",
"(",
"cachedField",
".",
"name",
".",
"equals",
"(",
"fieldName",
")",
")",
"return",
"cachedF... | Returns the field with the specified name, allowing field specific settings to be configured. | [
"Returns",
"the",
"field",
"with",
"the",
"specified",
"name",
"allowing",
"field",
"specific",
"settings",
"to",
"be",
"configured",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/serializers/FieldSerializer.java#L170-L174 |
19,479 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/unsafe/UnsafeUtil.java | UnsafeUtil.newDirectBuffer | static public ByteBuffer newDirectBuffer (long address, int size) {
if (directByteBufferConstructor == null)
throw new UnsupportedOperationException("No direct ByteBuffer constructor is available.");
try {
return directByteBufferConstructor.newInstance(address, size, null);
} catch (Exception ex) {
throw... | java | static public ByteBuffer newDirectBuffer (long address, int size) {
if (directByteBufferConstructor == null)
throw new UnsupportedOperationException("No direct ByteBuffer constructor is available.");
try {
return directByteBufferConstructor.newInstance(address, size, null);
} catch (Exception ex) {
throw... | [
"static",
"public",
"ByteBuffer",
"newDirectBuffer",
"(",
"long",
"address",
",",
"int",
"size",
")",
"{",
"if",
"(",
"directByteBufferConstructor",
"==",
"null",
")",
"throw",
"new",
"UnsupportedOperationException",
"(",
"\"No direct ByteBuffer constructor is available.\... | Create a ByteBuffer that uses the specified off-heap memory address instead of allocating a new one.
@param address Address of the memory region to be used for a ByteBuffer.
@param size Size in bytes of the memory region.
@throws UnsupportedOperationException if creating a ByteBuffer this way is not available. | [
"Create",
"a",
"ByteBuffer",
"that",
"uses",
"the",
"specified",
"off",
"-",
"heap",
"memory",
"address",
"instead",
"of",
"allocating",
"a",
"new",
"one",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/unsafe/UnsafeUtil.java#L123-L131 |
19,480 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/unsafe/UnsafeUtil.java | UnsafeUtil.dispose | static public void dispose (ByteBuffer buffer) {
if (!(buffer instanceof DirectBuffer)) return;
if (cleanerMethod != null) {
try {
cleanMethod.invoke(cleanerMethod.invoke(buffer));
} catch (Throwable ignored) {
}
}
} | java | static public void dispose (ByteBuffer buffer) {
if (!(buffer instanceof DirectBuffer)) return;
if (cleanerMethod != null) {
try {
cleanMethod.invoke(cleanerMethod.invoke(buffer));
} catch (Throwable ignored) {
}
}
} | [
"static",
"public",
"void",
"dispose",
"(",
"ByteBuffer",
"buffer",
")",
"{",
"if",
"(",
"!",
"(",
"buffer",
"instanceof",
"DirectBuffer",
")",
")",
"return",
";",
"if",
"(",
"cleanerMethod",
"!=",
"null",
")",
"{",
"try",
"{",
"cleanMethod",
".",
"invok... | Release a direct buffer immediately rather than waiting for GC. | [
"Release",
"a",
"direct",
"buffer",
"immediately",
"rather",
"than",
"waiting",
"for",
"GC",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/unsafe/UnsafeUtil.java#L139-L147 |
19,481 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/io/OutputChunked.java | OutputChunked.endChunk | public void endChunk () {
flush();
if (TRACE) trace("kryo", "End chunk.");
try {
getOutputStream().write(0); // Zero length chunk.
} catch (IOException ex) {
throw new KryoException(ex);
}
} | java | public void endChunk () {
flush();
if (TRACE) trace("kryo", "End chunk.");
try {
getOutputStream().write(0); // Zero length chunk.
} catch (IOException ex) {
throw new KryoException(ex);
}
} | [
"public",
"void",
"endChunk",
"(",
")",
"{",
"flush",
"(",
")",
";",
"if",
"(",
"TRACE",
")",
"trace",
"(",
"\"kryo\"",
",",
"\"End chunk.\"",
")",
";",
"try",
"{",
"getOutputStream",
"(",
")",
".",
"write",
"(",
"0",
")",
";",
"// Zero length chunk.\r... | Marks the curent written data as the end of a chunk. This chunk can then be skipped when reading. | [
"Marks",
"the",
"curent",
"written",
"data",
"as",
"the",
"end",
"of",
"a",
"chunk",
".",
"This",
"chunk",
"can",
"then",
"be",
"skipped",
"when",
"reading",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/io/OutputChunked.java#L97-L105 |
19,482 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/util/ObjectMap.java | ObjectMap.put | public V put (K key, V value) {
if (key == null) throw new IllegalArgumentException("key cannot be null.");
K[] keyTable = this.keyTable;
int mask = this.mask;
// Check for existing keys.
int hashCode = key.hashCode();
int index1 = hashCode & mask;
K key1 = keyTable[index1];
if (key.equals(key... | java | public V put (K key, V value) {
if (key == null) throw new IllegalArgumentException("key cannot be null.");
K[] keyTable = this.keyTable;
int mask = this.mask;
// Check for existing keys.
int hashCode = key.hashCode();
int index1 = hashCode & mask;
K key1 = keyTable[index1];
if (key.equals(key... | [
"public",
"V",
"put",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"key cannot be null.\"",
")",
";",
"K",
"[",
"]",
"keyTable",
"=",
"this",
".",
"keyTable",
";",... | Returns the old value associated with the specified key, or null. | [
"Returns",
"the",
"old",
"value",
"associated",
"with",
"the",
"specified",
"key",
"or",
"null",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/util/ObjectMap.java#L100-L183 |
19,483 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/util/ObjectMap.java | ObjectMap.remove | public V remove (K key) {
int hashCode = key.hashCode();
int index = hashCode & mask;
if (key.equals(keyTable[index])) {
keyTable[index] = null;
V oldValue = valueTable[index];
valueTable[index] = null;
size--;
return oldValue;
}
index = hash2(hashCode);
if (key.equals(keyTable[i... | java | public V remove (K key) {
int hashCode = key.hashCode();
int index = hashCode & mask;
if (key.equals(keyTable[index])) {
keyTable[index] = null;
V oldValue = valueTable[index];
valueTable[index] = null;
size--;
return oldValue;
}
index = hash2(hashCode);
if (key.equals(keyTable[i... | [
"public",
"V",
"remove",
"(",
"K",
"key",
")",
"{",
"int",
"hashCode",
"=",
"key",
".",
"hashCode",
"(",
")",
";",
"int",
"index",
"=",
"hashCode",
"&",
"mask",
";",
"if",
"(",
"key",
".",
"equals",
"(",
"keyTable",
"[",
"index",
"]",
")",
")",
... | Returns the value associated with the key, or null. | [
"Returns",
"the",
"value",
"associated",
"with",
"the",
"key",
"or",
"null",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/util/ObjectMap.java#L399-L440 |
19,484 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/util/ObjectMap.java | ObjectMap.shrink | public void shrink (int maximumCapacity) {
if (maximumCapacity < 0) throw new IllegalArgumentException("maximumCapacity must be >= 0: " + maximumCapacity);
if (size > maximumCapacity) maximumCapacity = size;
if (capacity <= maximumCapacity) return;
maximumCapacity = nextPowerOfTwo(maximumCapacity);
resiz... | java | public void shrink (int maximumCapacity) {
if (maximumCapacity < 0) throw new IllegalArgumentException("maximumCapacity must be >= 0: " + maximumCapacity);
if (size > maximumCapacity) maximumCapacity = size;
if (capacity <= maximumCapacity) return;
maximumCapacity = nextPowerOfTwo(maximumCapacity);
resiz... | [
"public",
"void",
"shrink",
"(",
"int",
"maximumCapacity",
")",
"{",
"if",
"(",
"maximumCapacity",
"<",
"0",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"maximumCapacity must be >= 0: \"",
"+",
"maximumCapacity",
")",
";",
"if",
"(",
"size",
">",
"ma... | Reduces the size of the backing arrays to be the specified capacity or less. If the capacity is already less, nothing is
done. If the map contains more items than the specified capacity, the next highest power of two capacity is used instead. | [
"Reduces",
"the",
"size",
"of",
"the",
"backing",
"arrays",
"to",
"be",
"the",
"specified",
"capacity",
"or",
"less",
".",
"If",
"the",
"capacity",
"is",
"already",
"less",
"nothing",
"is",
"done",
".",
"If",
"the",
"map",
"contains",
"more",
"items",
"t... | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/util/ObjectMap.java#L477-L483 |
19,485 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/Kryo.java | Kryo.getDefaultSerializer | public Serializer getDefaultSerializer (Class type) {
if (type == null) throw new IllegalArgumentException("type cannot be null.");
Serializer serializerForAnnotation = getDefaultSerializerForAnnotatedType(type);
if (serializerForAnnotation != null) return serializerForAnnotation;
for (int i = 0, n = de... | java | public Serializer getDefaultSerializer (Class type) {
if (type == null) throw new IllegalArgumentException("type cannot be null.");
Serializer serializerForAnnotation = getDefaultSerializerForAnnotatedType(type);
if (serializerForAnnotation != null) return serializerForAnnotation;
for (int i = 0, n = de... | [
"public",
"Serializer",
"getDefaultSerializer",
"(",
"Class",
"type",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"type cannot be null.\"",
")",
";",
"Serializer",
"serializerForAnnotation",
"=",
"getDefaultSerial... | Returns the best matching serializer for a class. This method can be overridden to implement custom logic to choose a
serializer. | [
"Returns",
"the",
"best",
"matching",
"serializer",
"for",
"a",
"class",
".",
"This",
"method",
"can",
"be",
"overridden",
"to",
"implement",
"custom",
"logic",
"to",
"choose",
"a",
"serializer",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/Kryo.java#L368-L381 |
19,486 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/Kryo.java | Kryo.writeClass | public Registration writeClass (Output output, Class type) {
if (output == null) throw new IllegalArgumentException("output cannot be null.");
try {
return classResolver.writeClass(output, type);
} finally {
if (depth == 0 && autoReset) reset();
}
} | java | public Registration writeClass (Output output, Class type) {
if (output == null) throw new IllegalArgumentException("output cannot be null.");
try {
return classResolver.writeClass(output, type);
} finally {
if (depth == 0 && autoReset) reset();
}
} | [
"public",
"Registration",
"writeClass",
"(",
"Output",
"output",
",",
"Class",
"type",
")",
"{",
"if",
"(",
"output",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"output cannot be null.\"",
")",
";",
"try",
"{",
"return",
"classResolver... | Writes a class and returns its registration.
@param type May be null.
@return Will be null if type is null.
@see ClassResolver#writeClass(Output, Class) | [
"Writes",
"a",
"class",
"and",
"returns",
"its",
"registration",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/Kryo.java#L529-L536 |
19,487 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/Kryo.java | Kryo.writeObject | public void writeObject (Output output, Object object) {
if (output == null) throw new IllegalArgumentException("output cannot be null.");
if (object == null) throw new IllegalArgumentException("object cannot be null.");
beginObject();
try {
if (references && writeReferenceOrNull(output, object, false))... | java | public void writeObject (Output output, Object object) {
if (output == null) throw new IllegalArgumentException("output cannot be null.");
if (object == null) throw new IllegalArgumentException("object cannot be null.");
beginObject();
try {
if (references && writeReferenceOrNull(output, object, false))... | [
"public",
"void",
"writeObject",
"(",
"Output",
"output",
",",
"Object",
"object",
")",
"{",
"if",
"(",
"output",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"output cannot be null.\"",
")",
";",
"if",
"(",
"object",
"==",
"null",
"... | Writes an object using the registered serializer. | [
"Writes",
"an",
"object",
"using",
"the",
"registered",
"serializer",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/Kryo.java#L539-L550 |
19,488 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/Kryo.java | Kryo.writeObject | public void writeObject (Output output, Object object, Serializer serializer) {
if (output == null) throw new IllegalArgumentException("output cannot be null.");
if (object == null) throw new IllegalArgumentException("object cannot be null.");
if (serializer == null) throw new IllegalArgumentException("seriali... | java | public void writeObject (Output output, Object object, Serializer serializer) {
if (output == null) throw new IllegalArgumentException("output cannot be null.");
if (object == null) throw new IllegalArgumentException("object cannot be null.");
if (serializer == null) throw new IllegalArgumentException("seriali... | [
"public",
"void",
"writeObject",
"(",
"Output",
"output",
",",
"Object",
"object",
",",
"Serializer",
"serializer",
")",
"{",
"if",
"(",
"output",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"output cannot be null.\"",
")",
";",
"if",
... | Writes an object using the specified serializer. The registered serializer is ignored. | [
"Writes",
"an",
"object",
"using",
"the",
"specified",
"serializer",
".",
"The",
"registered",
"serializer",
"is",
"ignored",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/Kryo.java#L553-L565 |
19,489 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/Kryo.java | Kryo.writeObjectOrNull | public void writeObjectOrNull (Output output, Object object, Serializer serializer) {
if (output == null) throw new IllegalArgumentException("output cannot be null.");
if (serializer == null) throw new IllegalArgumentException("serializer cannot be null.");
beginObject();
try {
if (references) {
if... | java | public void writeObjectOrNull (Output output, Object object, Serializer serializer) {
if (output == null) throw new IllegalArgumentException("output cannot be null.");
if (serializer == null) throw new IllegalArgumentException("serializer cannot be null.");
beginObject();
try {
if (references) {
if... | [
"public",
"void",
"writeObjectOrNull",
"(",
"Output",
"output",
",",
"Object",
"object",
",",
"Serializer",
"serializer",
")",
"{",
"if",
"(",
"output",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"output cannot be null.\"",
")",
";",
"... | Writes an object or null using the specified serializer. The registered serializer is ignored.
@param object May be null. | [
"Writes",
"an",
"object",
"or",
"null",
"using",
"the",
"specified",
"serializer",
".",
"The",
"registered",
"serializer",
"is",
"ignored",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/Kryo.java#L594-L615 |
19,490 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/Kryo.java | Kryo.writeClassAndObject | public void writeClassAndObject (Output output, Object object) {
if (output == null) throw new IllegalArgumentException("output cannot be null.");
beginObject();
try {
if (object == null) {
writeClass(output, null);
return;
}
Registration registration = writeClass(output, object.getClass(... | java | public void writeClassAndObject (Output output, Object object) {
if (output == null) throw new IllegalArgumentException("output cannot be null.");
beginObject();
try {
if (object == null) {
writeClass(output, null);
return;
}
Registration registration = writeClass(output, object.getClass(... | [
"public",
"void",
"writeClassAndObject",
"(",
"Output",
"output",
",",
"Object",
"object",
")",
"{",
"if",
"(",
"output",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"output cannot be null.\"",
")",
";",
"beginObject",
"(",
")",
";",
... | Writes the class and object or null using the registered serializer.
@param object May be null. | [
"Writes",
"the",
"class",
"and",
"object",
"or",
"null",
"using",
"the",
"registered",
"serializer",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/Kryo.java#L619-L634 |
19,491 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/Kryo.java | Kryo.readClass | public Registration readClass (Input input) {
if (input == null) throw new IllegalArgumentException("input cannot be null.");
try {
return classResolver.readClass(input);
} finally {
if (depth == 0 && autoReset) reset();
}
} | java | public Registration readClass (Input input) {
if (input == null) throw new IllegalArgumentException("input cannot be null.");
try {
return classResolver.readClass(input);
} finally {
if (depth == 0 && autoReset) reset();
}
} | [
"public",
"Registration",
"readClass",
"(",
"Input",
"input",
")",
"{",
"if",
"(",
"input",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"input cannot be null.\"",
")",
";",
"try",
"{",
"return",
"classResolver",
".",
"readClass",
"(",
... | Reads a class and returns its registration.
@return May be null.
@see ClassResolver#readClass(Input) | [
"Reads",
"a",
"class",
"and",
"returns",
"its",
"registration",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/Kryo.java#L674-L681 |
19,492 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/Kryo.java | Kryo.readObject | public <T> T readObject (Input input, Class<T> type) {
if (input == null) throw new IllegalArgumentException("input cannot be null.");
if (type == null) throw new IllegalArgumentException("type cannot be null.");
beginObject();
try {
T object;
if (references) {
int stackSize = readReferenceOrNu... | java | public <T> T readObject (Input input, Class<T> type) {
if (input == null) throw new IllegalArgumentException("input cannot be null.");
if (type == null) throw new IllegalArgumentException("type cannot be null.");
beginObject();
try {
T object;
if (references) {
int stackSize = readReferenceOrNu... | [
"public",
"<",
"T",
">",
"T",
"readObject",
"(",
"Input",
"input",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"if",
"(",
"input",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"input cannot be null.\"",
")",
";",
"if",
"(",
... | Reads an object using the registered serializer. | [
"Reads",
"an",
"object",
"using",
"the",
"registered",
"serializer",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/Kryo.java#L684-L702 |
19,493 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/Kryo.java | Kryo.readClassAndObject | public Object readClassAndObject (Input input) {
if (input == null) throw new IllegalArgumentException("input cannot be null.");
beginObject();
try {
Registration registration = readClass(input);
if (registration == null) return null;
Class type = registration.getType();
Object object;
if... | java | public Object readClassAndObject (Input input) {
if (input == null) throw new IllegalArgumentException("input cannot be null.");
beginObject();
try {
Registration registration = readClass(input);
if (registration == null) return null;
Class type = registration.getType();
Object object;
if... | [
"public",
"Object",
"readClassAndObject",
"(",
"Input",
"input",
")",
"{",
"if",
"(",
"input",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"input cannot be null.\"",
")",
";",
"beginObject",
"(",
")",
";",
"try",
"{",
"Registration",
... | Reads the class and object or null using the registered serializer.
@return May be null. | [
"Reads",
"the",
"class",
"and",
"object",
"or",
"null",
"using",
"the",
"registered",
"serializer",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/Kryo.java#L784-L805 |
19,494 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/Kryo.java | Kryo.setReferenceResolver | public void setReferenceResolver (ReferenceResolver referenceResolver) {
if (referenceResolver == null) throw new IllegalArgumentException("referenceResolver cannot be null.");
this.references = true;
this.referenceResolver = referenceResolver;
if (TRACE) trace("kryo", "Reference resolver: " + referenceReso... | java | public void setReferenceResolver (ReferenceResolver referenceResolver) {
if (referenceResolver == null) throw new IllegalArgumentException("referenceResolver cannot be null.");
this.references = true;
this.referenceResolver = referenceResolver;
if (TRACE) trace("kryo", "Reference resolver: " + referenceReso... | [
"public",
"void",
"setReferenceResolver",
"(",
"ReferenceResolver",
"referenceResolver",
")",
"{",
"if",
"(",
"referenceResolver",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"referenceResolver cannot be null.\"",
")",
";",
"this",
".",
"refere... | Sets the reference resolver and enables references. | [
"Sets",
"the",
"reference",
"resolver",
"and",
"enables",
"references",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/Kryo.java#L1078-L1083 |
19,495 | EsotericSoftware/kryo | src/com/esotericsoftware/kryo/util/IntMap.java | IntMap.clear | public void clear (int maximumCapacity) {
if (capacity <= maximumCapacity) {
clear();
return;
}
zeroValue = null;
hasZeroValue = false;
size = 0;
resize(maximumCapacity);
} | java | public void clear (int maximumCapacity) {
if (capacity <= maximumCapacity) {
clear();
return;
}
zeroValue = null;
hasZeroValue = false;
size = 0;
resize(maximumCapacity);
} | [
"public",
"void",
"clear",
"(",
"int",
"maximumCapacity",
")",
"{",
"if",
"(",
"capacity",
"<=",
"maximumCapacity",
")",
"{",
"clear",
"(",
")",
";",
"return",
";",
"}",
"zeroValue",
"=",
"null",
";",
"hasZeroValue",
"=",
"false",
";",
"size",
"=",
"0"... | Clears the map and reduces the size of the backing arrays to be the specified capacity if they are larger. | [
"Clears",
"the",
"map",
"and",
"reduces",
"the",
"size",
"of",
"the",
"backing",
"arrays",
"to",
"be",
"the",
"specified",
"capacity",
"if",
"they",
"are",
"larger",
"."
] | a8be1ab26f347f299a3c3f7171d6447dd5390845 | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/util/IntMap.java#L496-L505 |
19,496 | aws/aws-sdk-java | aws-java-sdk-guardduty/src/main/java/com/amazonaws/services/guardduty/model/PortProbeAction.java | PortProbeAction.setPortProbeDetails | public void setPortProbeDetails(java.util.Collection<PortProbeDetail> portProbeDetails) {
if (portProbeDetails == null) {
this.portProbeDetails = null;
return;
}
this.portProbeDetails = new java.util.ArrayList<PortProbeDetail>(portProbeDetails);
} | java | public void setPortProbeDetails(java.util.Collection<PortProbeDetail> portProbeDetails) {
if (portProbeDetails == null) {
this.portProbeDetails = null;
return;
}
this.portProbeDetails = new java.util.ArrayList<PortProbeDetail>(portProbeDetails);
} | [
"public",
"void",
"setPortProbeDetails",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"PortProbeDetail",
">",
"portProbeDetails",
")",
"{",
"if",
"(",
"portProbeDetails",
"==",
"null",
")",
"{",
"this",
".",
"portProbeDetails",
"=",
"null",
";",
"return",... | A list of port probe details objects.
@param portProbeDetails
A list of port probe details objects. | [
"A",
"list",
"of",
"port",
"probe",
"details",
"objects",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-guardduty/src/main/java/com/amazonaws/services/guardduty/model/PortProbeAction.java#L95-L102 |
19,497 | aws/aws-sdk-java | aws-java-sdk-emr/src/main/java/com/amazonaws/services/elasticmapreduce/spi/security/EncryptionContext.java | EncryptionContext.withContext | public EncryptionContext withContext(String key, String value) {
this.context.put(key, value);
return this;
} | java | public EncryptionContext withContext(String key, String value) {
this.context.put(key, value);
return this;
} | [
"public",
"EncryptionContext",
"withContext",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"this",
".",
"context",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Fluent API to add encryption context. | [
"Fluent",
"API",
"to",
"add",
"encryption",
"context",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-emr/src/main/java/com/amazonaws/services/elasticmapreduce/spi/security/EncryptionContext.java#L54-L57 |
19,498 | aws/aws-sdk-java | aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/StopChannelResult.java | StopChannelResult.setEgressEndpoints | public void setEgressEndpoints(java.util.Collection<ChannelEgressEndpoint> egressEndpoints) {
if (egressEndpoints == null) {
this.egressEndpoints = null;
return;
}
this.egressEndpoints = new java.util.ArrayList<ChannelEgressEndpoint>(egressEndpoints);
} | java | public void setEgressEndpoints(java.util.Collection<ChannelEgressEndpoint> egressEndpoints) {
if (egressEndpoints == null) {
this.egressEndpoints = null;
return;
}
this.egressEndpoints = new java.util.ArrayList<ChannelEgressEndpoint>(egressEndpoints);
} | [
"public",
"void",
"setEgressEndpoints",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"ChannelEgressEndpoint",
">",
"egressEndpoints",
")",
"{",
"if",
"(",
"egressEndpoints",
"==",
"null",
")",
"{",
"this",
".",
"egressEndpoints",
"=",
"null",
";",
"return... | The endpoints where outgoing connections initiate from
@param egressEndpoints
The endpoints where outgoing connections initiate from | [
"The",
"endpoints",
"where",
"outgoing",
"connections",
"initiate",
"from"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/StopChannelResult.java#L243-L250 |
19,499 | aws/aws-sdk-java | aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/StopChannelResult.java | StopChannelResult.setInputAttachments | public void setInputAttachments(java.util.Collection<InputAttachment> inputAttachments) {
if (inputAttachments == null) {
this.inputAttachments = null;
return;
}
this.inputAttachments = new java.util.ArrayList<InputAttachment>(inputAttachments);
} | java | public void setInputAttachments(java.util.Collection<InputAttachment> inputAttachments) {
if (inputAttachments == null) {
this.inputAttachments = null;
return;
}
this.inputAttachments = new java.util.ArrayList<InputAttachment>(inputAttachments);
} | [
"public",
"void",
"setInputAttachments",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"InputAttachment",
">",
"inputAttachments",
")",
"{",
"if",
"(",
"inputAttachments",
"==",
"null",
")",
"{",
"this",
".",
"inputAttachments",
"=",
"null",
";",
"return",... | List of input attachments for channel.
@param inputAttachments
List of input attachments for channel. | [
"List",
"of",
"input",
"attachments",
"for",
"channel",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/StopChannelResult.java#L365-L372 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.