public final class EnumMarshallerDelegate<T extends java.lang.Enum<T>> extends java.lang.Object implements BaseMarshallerDelegate<T>
| Modifier and Type | Field and Description |
|---|---|
private java.util.Set<java.lang.Integer> |
definedValues |
private EnumDescriptor |
enumDescriptor |
private EnumMarshaller<T> |
enumMarshaller |
| Constructor and Description |
|---|
EnumMarshallerDelegate(EnumMarshaller<T> enumMarshaller,
EnumDescriptor enumDescriptor) |
| Modifier and Type | Method and Description |
|---|---|
java.util.Set<java.lang.Integer> |
getDefinedValues() |
EnumDescriptor |
getEnumDescriptor() |
EnumMarshaller<T> |
getMarshaller()
Gets the wrapped marshaller.
|
void |
marshall(FieldDescriptor fd,
T value,
ProtoStreamWriterImpl writer,
RawProtoStreamWriter out)
Marshalls an object.
|
T |
unmarshall(FieldDescriptor fieldDescriptor,
ProtoStreamReaderImpl reader,
RawProtoStreamReader in)
Unmarshalls an object.
|
private final EnumMarshaller<T extends java.lang.Enum<T>> enumMarshaller
private final EnumDescriptor enumDescriptor
private final java.util.Set<java.lang.Integer> definedValues
public EnumMarshallerDelegate(EnumMarshaller<T> enumMarshaller, EnumDescriptor enumDescriptor)
public EnumMarshaller<T> getMarshaller()
BaseMarshallerDelegategetMarshaller in interface BaseMarshallerDelegate<T extends java.lang.Enum<T>>public EnumDescriptor getEnumDescriptor()
public java.util.Set<java.lang.Integer> getDefinedValues()
public void marshall(FieldDescriptor fd, T value, ProtoStreamWriterImpl writer, RawProtoStreamWriter out) throws java.io.IOException
BaseMarshallerDelegatemarshall in interface BaseMarshallerDelegate<T extends java.lang.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)java.io.IOException - if marshalling fails for some reasonpublic T unmarshall(FieldDescriptor fieldDescriptor, ProtoStreamReaderImpl reader, RawProtoStreamReader in) throws java.io.IOException
BaseMarshallerDelegateunmarshall in interface BaseMarshallerDelegate<T extends java.lang.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)java.io.IOException - if unmarshalling fails for some reason