Interface FieldSetMarshaller<T,V>
- Type Parameters:
T- the writer typeV- the reader type
- All Superinterfaces:
FieldReadable<V>,Writable<T>
- All Known Subinterfaces:
ClassLoaderMarshaller,FieldSetMarshaller.Simple<T>,FieldSetMarshaller.Supplied<T,V>
- All Known Implementing Classes:
ComparatorMarshaller,DurationMarshaller,InetAddressMarshaller,LocalDateMarshaller,LocalTimeMarshaller,UUIDMarshaller,YearMarshaller,ZoneOffsetMarshaller
Marshaller for a set of fields, to be shared between multiple marshallers.
- Author:
- Paul Ferraro
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA simple field set marshaller whose reader and writer types are the samestatic interfaceFieldSetMarshaller.Supplied<T,V extends Supplier<T>> A field set marshaller whose reader type supplies the writer type. -
Method Summary
Modifier and TypeMethodDescriptiondefault ProtoStreamMarshaller<T> Creates a marshaller that reads and writes only the fields of this field set.default ProtoStreamMarshaller<T> asMarshaller(Class<T> targetClass) Creates a marshaller that reads and writes only the fields of this field set.Builds the target object from the read value.Returns a builder for use withFieldReadable.readFrom(ProtoStreamReader, int, WireType, Object).Methods inherited from interface org.wildfly.clustering.marshalling.protostream.FieldReadable
getFields, nextIndex, readFrom
-
Method Details
-
createInitialValue
V createInitialValue()Returns a builder for use withFieldReadable.readFrom(ProtoStreamReader, int, WireType, Object). May return a shared instance, if the builder type is immutable, or a new instance, if the builder is mutable.- Returns:
- a builder.
-
build
Builds the target object from the read value.- Parameters:
value- a read value- Returns:
- the target object
-
asMarshaller
Creates a marshaller that reads and writes only the fields of this field set.- Returns:
- a new marshaller
-
asMarshaller
Creates a marshaller that reads and writes only the fields of this field set.- Parameters:
targetClass- the marshaller type- Returns:
- a new marshaller
-