Class TypedEnumMarshaller<E extends Enum<E>>
- java.lang.Object
-
- org.wildfly.clustering.marshalling.protostream.TypedEnumMarshaller<E>
-
- Type Parameters:
E- the enum type of this marshaller
- All Implemented Interfaces:
FieldMarshaller<E>,Marshallable<E>
public class TypedEnumMarshaller<E extends Enum<E>> extends Object implements FieldMarshaller<E>
Marshaller for a typed enumeration.- Author:
- Paul Ferraro
-
-
Constructor Summary
Constructors Constructor Description TypedEnumMarshaller(ScalarMarshaller<Class<?>> type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<? extends E>getJavaClass()Returns the type of object handled by this marshallable instance.org.infinispan.protostream.descriptors.WireTypegetWireType()Returns the wire type of the scalar value written by this marshaller.EreadFrom(ProtoStreamReader reader)Reads an object from the specified reader.voidwriteTo(ProtoStreamWriter writer, E value)Writes the specified object to the specified writer.
-
-
-
Constructor Detail
-
TypedEnumMarshaller
public TypedEnumMarshaller(ScalarMarshaller<Class<?>> type)
-
-
Method Detail
-
readFrom
public E readFrom(ProtoStreamReader reader) throws IOException
Description copied from interface:MarshallableReads an object from the specified reader.- Specified by:
readFromin interfaceMarshallable<E extends Enum<E>>- Parameters:
reader- a ProtoStream reader- Returns:
- the read object
- Throws:
IOException- if the object could not be read
-
writeTo
public void writeTo(ProtoStreamWriter writer, E value) throws IOException
Description copied from interface:MarshallableWrites the specified object to the specified writer.- Specified by:
writeToin interfaceMarshallable<E extends Enum<E>>- Parameters:
writer- a ProtoStream writervalue- the object to be written- Throws:
IOException- if the object could not be written
-
getJavaClass
public Class<? extends E> getJavaClass()
Description copied from interface:MarshallableReturns the type of object handled by this marshallable instance.- Specified by:
getJavaClassin interfaceMarshallable<E extends Enum<E>>- Returns:
- the type of object handled by this marshallable instance.
-
getWireType
public org.infinispan.protostream.descriptors.WireType getWireType()
Description copied from interface:FieldMarshallerReturns the wire type of the scalar value written by this marshaller.- Specified by:
getWireTypein interfaceFieldMarshaller<E extends Enum<E>>- Returns:
- the wire type of the scalar value written by this marshaller.
-
-