Class EnumSetFieldSetMarshaller<E extends Enum<E>>
- java.lang.Object
-
- org.wildfly.clustering.marshalling.protostream.util.EnumSetFieldSetMarshaller<E>
-
- Type Parameters:
E- the enum type for this marshaller
- All Implemented Interfaces:
FieldReadable<EnumSetBuilder<E>>,FieldSetMarshaller<EnumSet<E>,EnumSetBuilder<E>>,FieldSetMarshaller.Supplied<EnumSet<E>,EnumSetBuilder<E>>,Writable<EnumSet<E>>
public class EnumSetFieldSetMarshaller<E extends Enum<E>> extends Object implements FieldSetMarshaller.Supplied<EnumSet<E>,EnumSetBuilder<E>>
Marshaller for the fields of anEnumSet.- Author:
- Paul Ferraro
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.wildfly.clustering.marshalling.protostream.FieldSetMarshaller
FieldSetMarshaller.Simple<T>, FieldSetMarshaller.Supplied<T,V extends Supplier<T>>
-
-
Constructor Summary
Constructors Constructor Description EnumSetFieldSetMarshaller()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EnumSetBuilder<E>createInitialValue()Returns a builder for use with#readField(ProtoStreamReader, Object).intgetFields()Returns the number of fields in this field setEnumSetBuilder<E>readFrom(ProtoStreamReader reader, int index, org.infinispan.protostream.descriptors.WireType type, EnumSetBuilder<E> builder)Reads a single field from the specified reader.voidwriteTo(ProtoStreamWriter writer, EnumSet<E> set)Writes the specified object to the specified writer.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.wildfly.clustering.marshalling.protostream.FieldReadable
nextIndex
-
Methods inherited from interface org.wildfly.clustering.marshalling.protostream.FieldSetMarshaller.Supplied
build
-
-
-
-
Method Detail
-
createInitialValue
public EnumSetBuilder<E> createInitialValue()
Description copied from interface:FieldSetMarshallerReturns a builder for use with#readField(ProtoStreamReader, Object). May return a shared instance, if the builder type is immutable, or a new instance, if the builder is mutable.- Specified by:
createInitialValuein interfaceFieldSetMarshaller<EnumSet<E extends Enum<E>>,EnumSetBuilder<E extends Enum<E>>>- Returns:
- a builder.
-
getFields
public int getFields()
Description copied from interface:FieldReadableReturns the number of fields in this field set- Specified by:
getFieldsin interfaceFieldReadable<E extends Enum<E>>- Returns:
- a number of fields
-
readFrom
public EnumSetBuilder<E> readFrom(ProtoStreamReader reader, int index, org.infinispan.protostream.descriptors.WireType type, EnumSetBuilder<E> builder) throws IOException
Description copied from interface:FieldReadableReads a single field from the specified reader.- Specified by:
readFromin interfaceFieldReadable<E extends Enum<E>>- Parameters:
reader- a readerindex- the zero-based index, relative to this field set, of the field to be readtype- the wire type of the field to be readbuilder- the current value- Returns:
- the read value
- Throws:
IOException- if a field could not be read
-
writeTo
public void writeTo(ProtoStreamWriter writer, EnumSet<E> set) throws IOException
Description copied from interface:WritableWrites the specified object to the specified writer.
-
-