Interface ScalarMarshaller<T>
- Type Parameters:
T- the type of this marshaller
- All Superinterfaces:
Marshallable<T>,Readable<T>,Writable<T>
- All Known Implementing Classes:
IdentifierScalarMarshaller,PackedArrayMarshaller,Scalar,ScalarClass
Marshaller for a single scalar value.
This marshaller does not write any tags, nor does it read beyond a single value.
- Author:
- Paul Ferraro
-
Method Summary
Modifier and TypeMethodDescriptionorg.infinispan.protostream.descriptors.WireTypeReturns the wire type of the scalar value written by this marshaller.default <V> ProtoStreamMarshaller<V>toMarshaller(Class<V> targetClass, BiPredicate<T, T> equals, Function<V, T> unwrapper, Supplier<V> defaultFactory, Function<T, V> wrapper) Returns a marshaller for a wrapper of this scalar value, using the specified wrapping and unwrapping functions.default <V> ProtoStreamMarshaller<V>Returns a marshaller for a wrapper of this scalar value, using the specified wrapping and unwrapping functions.default <V> ProtoStreamMarshaller<V>toMarshaller(Class<V> targetClass, Function<V, T> unwrapper, Supplier<V> defaultFactory, Function<T, V> wrapper) Returns a marshaller for a wrapper of this scalar value, using the specified wrapping and unwrapping functions.default <V> ProtoStreamMarshaller<V>toMarshaller(Class<V> targetClass, Predicate<V> skipWrite, Function<V, T> unwrapper, Supplier<V> defaultFactory, Function<T, V> wrapper) Returns a marshaller for a wrapper of this scalar value, using the specified wrapping and unwrapping functions.Methods inherited from interface org.wildfly.clustering.marshalling.protostream.Marshallable
getJavaClass, size
-
Method Details
-
getWireType
org.infinispan.protostream.descriptors.WireType getWireType()Returns the wire type of the scalar value written by this marshaller.- Returns:
- the wire type of the scalar value written by this marshaller.
-
toMarshaller
default <V> ProtoStreamMarshaller<V> toMarshaller(Class<V> targetClass, Function<V, T> unwrapper, Function<T, V> wrapper) Returns a marshaller for a wrapper of this scalar value, using the specified wrapping and unwrapping functions.- Type Parameters:
V- the wrapper type- Parameters:
targetClass- the wrapper marshaller typeunwrapper- a function exposing the scalar type written by this marshaller from the wrapper instancewrapper- a function creating a wrapped instance from the scalar value read by this marshaller- Returns:
- a new marshaller
-
toMarshaller
default <V> ProtoStreamMarshaller<V> toMarshaller(Class<V> targetClass, Function<V, T> unwrapper, Supplier<V> defaultFactory, Function<T, V> wrapper) Returns a marshaller for a wrapper of this scalar value, using the specified wrapping and unwrapping functions.- Type Parameters:
V- the wrapper type- Parameters:
targetClass- the wrapper marshaller typeunwrapper- a function exposing the scalar type written by this marshaller from the wrapper instancedefaultFactory- provides the default value returned by the marshaller created by this function in the event that this marshaller did not write a scalar value.wrapper- a function creating a wrapped instance from the scalar value read by this marshaller- Returns:
- a new marshaller
-
toMarshaller
default <V> ProtoStreamMarshaller<V> toMarshaller(Class<V> targetClass, BiPredicate<T, T> equals, Function<V, T> unwrapper, Supplier<V> defaultFactory, Function<T, V> wrapper) Returns a marshaller for a wrapper of this scalar value, using the specified wrapping and unwrapping functions.- Type Parameters:
V- the wrapper type- Parameters:
targetClass- the wrapper marshaller typeequals- a predicate indicating whether the wrapped scalar value of the object to be written by this marshaller matches the wrapped scalar value of the value returned by the specified default factoryunwrapper- a function exposing the scalar type written by this marshaller from the wrapper instancedefaultFactory- provides the default value returned by the marshaller created by this function in the event that this marshaller did not write a scalar value.wrapper- a function creating a wrapped instance from the scalar value read by this marshaller- Returns:
- a new marshaller
-
toMarshaller
default <V> ProtoStreamMarshaller<V> toMarshaller(Class<V> targetClass, Predicate<V> skipWrite, Function<V, T> unwrapper, Supplier<V> defaultFactory, Function<T, V> wrapper) Returns a marshaller for a wrapper of this scalar value, using the specified wrapping and unwrapping functions.- Type Parameters:
V- the wrapper type- Parameters:
targetClass- the wrapper marshaller typeskipWrite- a predicate indicating whether the marshaller returned by this function can skip writing its scalar value, and instead return the value returned by the default factory on read.unwrapper- a function exposing the scalar type written by this marshaller from the wrapper instancedefaultFactory- provides the default value returned by the marshaller created by this function in the event that this marshaller did not write a scalar value.wrapper- a function creating a wrapped instance from the scalar value read by this marshaller- Returns:
- a new marshaller
-