Interface ProtoStreamMarshaller<T>

Type Parameters:
T - the type of this marshaller.
All Superinterfaces:
org.infinispan.protostream.BaseMarshaller<T>, Marshallable<T>, org.infinispan.protostream.ProtobufTagMarshaller<T>, Readable<T>, Writable<T>
All Known Implementing Classes:
AbstractCollectionMarshaller, AbstractMapMarshaller, AbstractMemberMarshaller, AddressSetFunctionMarshaller, BigDecimalMarshaller, BinaryFieldMarshaller, BinaryMemberMarshaller, BinaryMethodMarshaller, ByteBufferMarshalledKeyMarshaller, ByteBufferMarshalledValueMarshaller, CalendarMarshaller, ClassMarshaller, CollectionFunctionMarshaller, CollectionMarshaller, DecoratorMarshaller, DefaultSessionAccessMetaDataEntryMarshaller, DefaultSessionCreationMetaDataEntryMarshaller, DefaultSessionMetaDataEntryMarshaller, EnumMapMarshaller, EnumMarshaller, EnumSetMarshaller, ExceptionMarshaller, FieldMarshaller, InetSocketAddressMarshaller, LinkedHashMapMarshaller, LocalDateTimeMarshaller, LocaleMarshaller, MapComputeFunctionMarshaller, MapEntryMarshaller, MapMarshaller, MathContextMarshaller, MonthDayMarshaller, OffsetDateTimeMarshaller, OffsetTimeMarshaller, PeriodMarshaller, ProxyMarshaller, ScheduleCommandMarshaller, SessionAttributeMapComputeFunctionMarshaller, SessionAttributeMapEntryMarshaller, SessionCreationMetaDataEntryFunctionMarshaller, SessionMetaDataEntryFunctionMarshaller, SimpleExpirationMetaDataMarshaller, SortedMapMarshaller, SortedSetMarshaller, StackTraceElementMarshaller, SynchronizedDecoratorMarshaller, TernaryFieldMarshaller, TernaryMemberMarshaller, TernaryMethodMarshaller, UnaryFieldMarshaller, UnaryMemberMarshaller, UnaryMethodMarshaller, YearMonthMarshaller, ZonedDateTimeMarshaller

public interface ProtoStreamMarshaller<T> extends org.infinispan.protostream.ProtobufTagMarshaller<T>, Marshallable<T>
A ProtobufTagMarshaller that include a facility for computing buffer sizes.
Author:
Paul Ferraro
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.infinispan.protostream.ProtobufTagMarshaller

    org.infinispan.protostream.ProtobufTagMarshaller.OperationContext, org.infinispan.protostream.ProtobufTagMarshaller.ReadContext, org.infinispan.protostream.ProtobufTagMarshaller.WriteContext
  • Field Summary

    Fields inherited from interface org.infinispan.protostream.BaseMarshaller

    EMPTY
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
     
    static <E extends Enum<E>>
    ProtoStreamMarshaller<E>
    of(Class<E> enumClass)
    Creates a marshaller for an enum.
    static <T> ProtoStreamMarshaller<T>
    of(Supplier<T> factory)
    Creates a trivial marshaller for a constant value.
    static <T> ProtoStreamMarshaller<T>
    of(T value)
    Creates a trivial marshaller for a constant value.
    default T
    read(org.infinispan.protostream.ProtobufTagMarshaller.ReadContext context)
     
    default <V extends T>
    ProtoStreamMarshaller<V>
    wrap(Class<? extends V> type, Function<T,V> wrapper)
    Returns a new marshaller instance for a decorator of the type handled by this marshaller, created from the specified factory.
    default <V> ProtoStreamMarshaller<V>
    wrap(Class<? extends V> type, Function<V,T> unwrapper, Function<T,V> wrapper)
    Returns a new marshaller instance for a wrapper, using the specified wrapper and unwrapper functions.
    default void
    write(org.infinispan.protostream.ProtobufTagMarshaller.WriteContext context, T value)
     

    Methods inherited from interface org.infinispan.protostream.BaseMarshaller

    getJavaClass, getSubClassNames

    Methods inherited from interface org.wildfly.clustering.marshalling.protostream.Marshallable

    getJavaClass, size

    Methods inherited from interface org.wildfly.clustering.marshalling.protostream.Readable

    readFrom

    Methods inherited from interface org.wildfly.clustering.marshalling.protostream.Writable

    writeTo
  • Method Details

    • getTypeName

      default String getTypeName()
      Specified by:
      getTypeName in interface org.infinispan.protostream.BaseMarshaller<T>
    • read

      default T read(org.infinispan.protostream.ProtobufTagMarshaller.ReadContext context) throws IOException
      Specified by:
      read in interface org.infinispan.protostream.ProtobufTagMarshaller<T>
      Throws:
      IOException
    • write

      default void write(org.infinispan.protostream.ProtobufTagMarshaller.WriteContext context, T value) throws IOException
      Specified by:
      write in interface org.infinispan.protostream.ProtobufTagMarshaller<T>
      Throws:
      IOException
    • wrap

      default <V extends T> ProtoStreamMarshaller<V> wrap(Class<? extends V> type, Function<T,V> wrapper)
      Returns a new marshaller instance for a decorator of the type handled by this marshaller, created from the specified factory.
      Type Parameters:
      V - the decorator type
      Parameters:
      type - the decorator instance type of the new marshaller
      wrapper - a function for creating the decorator from the value read by this marshaller.\
      Returns:
      a new marshaller
    • wrap

      default <V> ProtoStreamMarshaller<V> wrap(Class<? extends V> type, Function<V,T> unwrapper, Function<T,V> wrapper)
      Returns a new marshaller instance for a wrapper, using the specified wrapper and unwrapper functions.
      Type Parameters:
      V - the wrapper type
      Parameters:
      type - the target class of the new marshaller
      unwrapper - a function exposing the value of this marshalller from its wrapper
      wrapper - a function creating the wrapped instance from the value read by this marshaller.
      Returns:
      a new marshaller
    • of

      static <T> ProtoStreamMarshaller<T> of(T value)
      Creates a trivial marshaller for a constant value.
      Type Parameters:
      T - the marshaller type
      Parameters:
      value - a constant value
      Returns:
      a new marshaller
    • of

      static <T> ProtoStreamMarshaller<T> of(Supplier<T> factory)
      Creates a trivial marshaller for a constant value.
      Type Parameters:
      T - the marshaller type
      Parameters:
      factory - a supplier of the constant value
      Returns:
      a new marshaller
    • of

      static <E extends Enum<E>> ProtoStreamMarshaller<E> of(Class<E> enumClass)
      Creates a marshaller for an enum.
      Type Parameters:
      E - the marshaller type
      Parameters:
      enumClass - the enum type
      Returns:
      a new marshaller