Interface FieldSetMarshaller<T,V>

Type Parameters:
T - the writer type
V - 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, EnumSetFieldSetMarshaller, InetAddressMarshaller, LocalDateMarshaller, LocalTimeMarshaller, UUIDMarshaller, YearMarshaller, ZoneOffsetMarshaller

public interface FieldSetMarshaller<T,V> extends FieldReadable<V>, Writable<T>
Marshaller for a set of fields, to be shared between multiple marshallers.
Author:
Paul Ferraro
  • Method Details

    • createInitialValue

      V createInitialValue()
      Returns a builder for use with FieldReadable.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

      T build(V value)
      Builds the target object from the read value.
      Parameters:
      value - a read value
      Returns:
      the target object
    • asMarshaller

      default ProtoStreamMarshaller<T> asMarshaller()
      Creates a marshaller that reads and writes only the fields of this field set.
      Returns:
      a new marshaller
    • asMarshaller

      default ProtoStreamMarshaller<T> asMarshaller(Class<T> targetClass)
      Creates a marshaller that reads and writes only the fields of this field set.
      Parameters:
      targetClass - the marshaller type
      Returns:
      a new marshaller