Class DecoratorMarshaller<T>

  • All Implemented Interfaces:
    Function<T,​T>, org.infinispan.protostream.BaseMarshaller<T>, org.infinispan.protostream.ProtobufTagMarshaller<T>, Marshallable<T>, ProtoStreamMarshaller<T>, org.wildfly.security.ParametricPrivilegedAction<T,​T>
    Direct Known Subclasses:
    SynchronizedDecoratorMarshaller

    public class DecoratorMarshaller<T>
    extends Object
    implements ProtoStreamMarshaller<T>, org.wildfly.security.ParametricPrivilegedAction<T,​T>
    Marshaller for a decorator that does not provide public access to its decorated object.
    Author:
    Paul Ferraro
    • Constructor Detail

      • DecoratorMarshaller

        public DecoratorMarshaller​(Class<T> decoratedClass,
                                   UnaryOperator<T> decorator,
                                   T sample)
        Constructs a decorator marshaller.
        Parameters:
        decoratedClass - the generalized type of the decorated object
        decorator - the decoration function
        sample - a sample object used to determine the type of the decorated object
    • Method Detail

      • getJavaClass

        public Class<? extends T> getJavaClass()
        Description copied from interface: Marshallable
        Returns the type of object handled by this marshallable instance.
        Specified by:
        getJavaClass in interface org.infinispan.protostream.BaseMarshaller<T>
        Specified by:
        getJavaClass in interface Marshallable<T>
        Returns:
        the type of object handled by this marshallable instance.
      • writeTo

        public void writeTo​(ProtoStreamWriter writer,
                            T value)
                     throws IOException
        Description copied from interface: Marshallable
        Writes the specified object to the specified writer.
        Specified by:
        writeTo in interface Marshallable<T>
        Parameters:
        writer - a ProtoStream writer
        value - the object to be written
        Throws:
        IOException - if the object could not be written
      • run

        public T run​(T value)
        Specified by:
        run in interface org.wildfly.security.ParametricPrivilegedAction<T,​T>