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,PropertiesMarshaller,PropertyMarshaller,ProxyMarshaller,ScheduleCommandMarshaller,SessionAttributeMapComputeFunctionMarshaller,SessionAttributeMapEntryMarshaller,SessionCreationMetaDataEntryFunctionMarshaller,SessionMetaDataEntryFunctionMarshaller,SimpleExpirationMetaDataMarshaller,SortedMapMarshaller,SortedSetMarshaller,StackTraceElementMarshaller,StringKeyMapEntryMarshaller,StringKeyMapMarshaller,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 TypeMethodDescriptiondefault Stringstatic <E extends Enum<E>>
ProtoStreamMarshaller<E> Creates a marshaller for an enum.static <T> ProtoStreamMarshaller<T> Creates a trivial marshaller for a constant value.static <T> ProtoStreamMarshaller<T> of(T value) Creates a trivial marshaller for a constant value.default Tread(org.infinispan.protostream.ProtobufTagMarshaller.ReadContext context) default <V extends T>
ProtoStreamMarshaller<V> Returns a new marshaller instance for a decorator of the type handled by this marshaller, created from the specified factory.default <V> ProtoStreamMarshaller<V> Returns a new marshaller instance for a wrapper, using the specified wrapper and unwrapper functions.default voidMethods inherited from interface org.infinispan.protostream.BaseMarshaller
getJavaClass, getSubClassNamesMethods inherited from interface org.wildfly.clustering.marshalling.protostream.Marshallable
getJavaClass, size
-
Method Details
-
getTypeName
-
read
default T read(org.infinispan.protostream.ProtobufTagMarshaller.ReadContext context) throws IOException - Specified by:
readin interfaceorg.infinispan.protostream.ProtobufTagMarshaller<T>- Throws:
IOException
-
write
default void write(org.infinispan.protostream.ProtobufTagMarshaller.WriteContext context, T value) throws IOException - Specified by:
writein interfaceorg.infinispan.protostream.ProtobufTagMarshaller<T>- Throws:
IOException
-
wrap
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 marshallerwrapper- 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 marshallerunwrapper- a function exposing the value of this marshalller from its wrapperwrapper- a function creating the wrapped instance from the value read by this marshaller.- Returns:
- a new marshaller
-
of
Creates a trivial marshaller for a constant value.- Type Parameters:
T- the marshaller type- Parameters:
value- a constant value- Returns:
- a new marshaller
-
of
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
Creates a marshaller for an enum.- Type Parameters:
E- the marshaller type- Parameters:
enumClass- the enum type- Returns:
- a new marshaller
-