Interface ScalarMarshallerProvider
-
- All Superinterfaces:
Marshallable<Object>,Readable<Object>,ScalarMarshaller<Object>,Writable<Object>
- All Known Implementing Classes:
Scalar
public interface ScalarMarshallerProvider extends ScalarMarshaller<Object>
Provider for aScalarMarshaller.- Author:
- Paul Ferraro
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <T> ScalarMarshaller<T>cast(Class<T> type)default Class<? extends Object>getJavaClass()Returns the type of object handled by this marshallable instance.ScalarMarshaller<?>getMarshaller()default org.infinispan.protostream.descriptors.WireTypegetWireType()Returns the wire type of the scalar value written by this marshaller.default ObjectreadFrom(ProtoStreamReader reader)Reads an object from the specified reader.default OptionalIntsize(ProtoStreamSizeOperation operation, Object value)Computes the size of the specified object.default voidwriteTo(ProtoStreamWriter writer, Object value)Writes the specified object to the specified writer.
-
-
-
Method Detail
-
getMarshaller
ScalarMarshaller<?> getMarshaller()
-
getJavaClass
default Class<? extends Object> getJavaClass()
Description copied from interface:MarshallableReturns the type of object handled by this marshallable instance.- Specified by:
getJavaClassin interfaceMarshallable<Object>- Returns:
- the type of object handled by this marshallable instance.
-
getWireType
default org.infinispan.protostream.descriptors.WireType getWireType()
Description copied from interface:ScalarMarshallerReturns the wire type of the scalar value written by this marshaller.- Specified by:
getWireTypein interfaceScalarMarshaller<Object>- Returns:
- the wire type of the scalar value written by this marshaller.
-
readFrom
default Object readFrom(ProtoStreamReader reader) throws IOException
Description copied from interface:ReadableReads an object from the specified reader.- Specified by:
readFromin interfaceReadable<Object>- Parameters:
reader- a ProtoStream reader- Returns:
- the read object
- Throws:
IOException- if the object could not be read
-
writeTo
default void writeTo(ProtoStreamWriter writer, Object value) throws IOException
Description copied from interface:WritableWrites the specified object to the specified writer.- Specified by:
writeToin interfaceWritable<Object>- Parameters:
writer- a ProtoStream writervalue- the object to be written- Throws:
IOException- if the object could not be written
-
size
default OptionalInt size(ProtoStreamSizeOperation operation, Object value)
Description copied from interface:MarshallableComputes the size of the specified object.- Specified by:
sizein interfaceMarshallable<Object>value- the value whose size is to be calculated- Returns:
- an optional buffer size, only present if the buffer size could be computed
-
cast
default <T> ScalarMarshaller<T> cast(Class<T> type)
-
-