public final class EnumMarshallerDelegate<T extends Enum<T>> extends Object implements BaseMarshallerDelegate<T>
Constructor and Description |
---|
EnumMarshallerDelegate(EnumMarshaller<T> enumMarshaller,
EnumDescriptor enumDescriptor) |
Modifier and Type | Method and Description |
---|---|
Set<Integer> |
getDefinedValues() |
EnumDescriptor |
getEnumDescriptor() |
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 |
unmarshall(FieldDescriptor fieldDescriptor,
org.infinispan.protostream.impl.ProtoStreamReaderImpl reader,
RawProtoStreamReader in)
Unmarshalls an object.
|
public EnumMarshallerDelegate(EnumMarshaller<T> enumMarshaller, EnumDescriptor enumDescriptor)
public EnumMarshaller<T> getMarshaller()
BaseMarshallerDelegate
getMarshaller
in interface BaseMarshallerDelegate<T extends Enum<T>>
public EnumDescriptor getEnumDescriptor()
public void marshall(FieldDescriptor fd, T value, org.infinispan.protostream.impl.ProtoStreamWriterImpl writer, RawProtoStreamWriter out) throws IOException
BaseMarshallerDelegate
marshall
in interface BaseMarshallerDelegate<T extends Enum<T>>
fd
- the FieldDescriptor
of the field being marshalled or null
if this is a
top-level objectvalue
- the value being marshalled (cannot be null
)writer
- the ProtoStreamWriterImpl
instance to use/re-use, if the specific marshaller type
needs one; can be null
in which case the delegate has to create a ProtoStreamWriterImpl
instance itself based on the out
parameterout
- the Protobuf tag output stream (cannot be null
)IOException
- if marshalling fails for some reasonpublic T unmarshall(FieldDescriptor fieldDescriptor, org.infinispan.protostream.impl.ProtoStreamReaderImpl reader, RawProtoStreamReader in) throws IOException
BaseMarshallerDelegate
unmarshall
in interface BaseMarshallerDelegate<T extends Enum<T>>
fieldDescriptor
- the FieldDescriptor
of the field being unmarshalled or null
if this is a
top-level objectreader
- the ProtoStreamReaderImpl
instance to use/re-use, if the specific marshaller type
needs one; can be null
in which case the delegate has to create a ProtoStreamReaderImpl
instance itself based on the in
parameterin
- the Protobuf tag input stream (cannot be null
)IOException
- if unmarshalling fails for some reasonCopyright © 2017 JBoss, a division of Red Hat. All rights reserved.