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
Constructors Constructor Description DefaultProtoStreamSizeOperation(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> OptionalIntcomputeSize(org.wildfly.common.function.ExceptionBiConsumer<ProtoStreamWriter,T,IOException> operation, T value)Computes the size of the specified object using the specified operation.ProtoStreamOperation.ContextgetContext()Returns the context of this operation-
Methods inherited from class org.wildfly.clustering.marshalling.protostream.AbstractProtoStreamOperation
getParam, getSerializationContext, setParam
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.wildfly.clustering.marshalling.protostream.ProtoStreamOperation
findMarshaller, getSerializationContext
-
Methods inherited from interface org.wildfly.clustering.marshalling.protostream.ProtoStreamSizeOperation
tagSize, varIntSize
-
-
-
-
Constructor Detail
-
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 Detail
-
getContext
public ProtoStreamOperation.Context 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
-
-