Class DefaultProtoStreamSizeOperation
java.lang.Object
org.wildfly.clustering.marshalling.protostream.AbstractProtoStreamOperation
org.wildfly.clustering.marshalling.protostream.DefaultProtoStreamSizeOperation
- All Implemented Interfaces:
org.infinispan.protostream.ProtobufTagMarshaller.OperationContext,ProtoStreamOperation,ProtoStreamSizeOperation
public class DefaultProtoStreamSizeOperation
extends AbstractProtoStreamOperation
implements ProtoStreamSizeOperation
A default ProtoStream size operation.
- Author:
- Paul Ferraro
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.wildfly.clustering.marshalling.protostream.ProtoStreamOperation
ProtoStreamOperation.Context -
Constructor Summary
ConstructorsConstructorDescriptionDefaultProtoStreamSizeOperation(org.infinispan.protostream.ImmutableSerializationContext context) Creates a new ProtoStream size operation using a new context.DefaultProtoStreamSizeOperation(org.infinispan.protostream.ImmutableSerializationContext context, org.wildfly.clustering.marshalling.protostream.AbstractProtoStreamWriter.ProtoStreamWriterContext writerContext) Creates a new ProtoStream size operation using the specified context. -
Method Summary
Modifier and TypeMethodDescription<T> OptionalIntcomputeSize(org.wildfly.common.function.ExceptionBiConsumer<ProtoStreamWriter, T, IOException> operation, T value) Computes the size of the specified object using the specified operation.Returns the context of this operationMethods inherited from class org.wildfly.clustering.marshalling.protostream.AbstractProtoStreamOperation
getParam, getSerializationContext, setParamMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.wildfly.clustering.marshalling.protostream.ProtoStreamOperation
findMarshaller, getSerializationContextMethods inherited from interface org.wildfly.clustering.marshalling.protostream.ProtoStreamSizeOperation
tagSize, varIntSize
-
Constructor Details
-
DefaultProtoStreamSizeOperation
public DefaultProtoStreamSizeOperation(org.infinispan.protostream.ImmutableSerializationContext context) Creates a new ProtoStream size operation using a new context.- Parameters:
context- the serialization context
-
DefaultProtoStreamSizeOperation
public DefaultProtoStreamSizeOperation(org.infinispan.protostream.ImmutableSerializationContext context, org.wildfly.clustering.marshalling.protostream.AbstractProtoStreamWriter.ProtoStreamWriterContext writerContext) Creates a new ProtoStream size operation using the specified context.- Parameters:
context- the serialization contextsizeContext- the context of the size operation
-
-
Method Details
-
getContext
Description copied from interface:ProtoStreamOperationReturns the context of this operation- Specified by:
getContextin interfaceProtoStreamOperation- Returns:
- the operation context
-
computeSize
public <T> OptionalInt computeSize(org.wildfly.common.function.ExceptionBiConsumer<ProtoStreamWriter, T, IOException> operation, T value) Description copied from interface:ProtoStreamSizeOperationComputes the size of the specified object using the specified operation.- Specified by:
computeSizein interfaceProtoStreamSizeOperation- Type Parameters:
T- the source object type- Parameters:
operation- a write operation used to compute the sizevalue- the object to be sized- Returns:
- the computed size
-