Package org.infinispan.protostream.impl
Class EnumMarshallerDelegate<T extends Enum<T>>
- java.lang.Object
-
- org.infinispan.protostream.impl.EnumMarshallerDelegate<T>
-
- All Implemented Interfaces:
BaseMarshallerDelegate<T>
public final class EnumMarshallerDelegate<T extends Enum<T>> extends Object implements BaseMarshallerDelegate<T>
- Since:
- 1.0
- Author:
- [email protected]
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EnumMarshaller<T>
getMarshaller()
Gets the wrapped marshaller.void
marshall(FieldDescriptor fd, T value, org.infinispan.protostream.impl.ProtoStreamWriterImpl writer, RawProtoStreamWriter out)
Marshalls an object.T
readEnum(int expectedTag, int enumValue, UnknownFieldSet unknownFieldSet)
T
unmarshall(FieldDescriptor fd, org.infinispan.protostream.impl.ProtoStreamReaderImpl reader, RawProtoStreamReader in)
Unmarshalls an object.void
writeEnum(int fieldNumber, T value, RawProtoStreamWriter out)
-
-
-
Method Detail
-
getMarshaller
public EnumMarshaller<T> getMarshaller()
Description copied from interface:BaseMarshallerDelegate
Gets the wrapped marshaller.- Specified by:
getMarshaller
in interfaceBaseMarshallerDelegate<T extends Enum<T>>
- Returns:
- the wrapped marshaller instance
-
marshall
public void marshall(FieldDescriptor fd, T value, org.infinispan.protostream.impl.ProtoStreamWriterImpl writer, RawProtoStreamWriter out) throws IOException
Description copied from interface:BaseMarshallerDelegate
Marshalls an object.- Specified by:
marshall
in interfaceBaseMarshallerDelegate<T extends Enum<T>>
- Parameters:
fd
- theFieldDescriptor
of the field being marshalled ornull
if this is a top-level objectvalue
- the value being marshalled (cannot benull
)writer
- theProtoStreamWriterImpl
instance to use/re-use, if the specific marshaller type needs one; can benull
in which case the delegate has to create aProtoStreamWriterImpl
instance itself based on theout
parameterout
- the Protobuf tag output stream (cannot benull
)- Throws:
IOException
- if marshalling fails for some reason
-
writeEnum
public void writeEnum(int fieldNumber, T value, RawProtoStreamWriter out) throws IOException
- Throws:
IOException
-
unmarshall
public T unmarshall(FieldDescriptor fd, org.infinispan.protostream.impl.ProtoStreamReaderImpl reader, RawProtoStreamReader in) throws IOException
Description copied from interface:BaseMarshallerDelegate
Unmarshalls an object.- Specified by:
unmarshall
in interfaceBaseMarshallerDelegate<T extends Enum<T>>
- Parameters:
fd
- theFieldDescriptor
of the field being unmarshalled ornull
if this is a top-level objectreader
- theProtoStreamReaderImpl
instance to use/re-use, if the specific marshaller type needs one; can benull
in which case the delegate has to create aProtoStreamReaderImpl
instance itself based on thein
parameterin
- the Protobuf tag input stream (cannot benull
)- Throws:
IOException
- if unmarshalling fails for some reason
-
readEnum
public T readEnum(int expectedTag, int enumValue, UnknownFieldSet unknownFieldSet)
-
-