Interface Marshaller<V,S>

Type Parameters:
V - the value type
S - the marshalled type
All Superinterfaces:
Predicate<Object>, Predicate<Object>
All Known Subinterfaces:
ByteBufferMarshaller
All Known Implementing Classes:
AbstractByteBufferMarshaller, IdentifierMarshaller, JavaByteBufferMarshaller, JBossByteBufferMarshaller, MarshalledValueMarshaller, ProtoStreamByteBufferMarshaller, WrappedMessageByteBufferMarshaller

public interface Marshaller<V,S> extends Predicate<Object>
Marshals an object to and from its serialized form.
Author:
Paul Ferraro
  • Method Details

    • identity

      static <T> Marshaller<T,T> identity()
      An identity marshaller that does no marshalling.
      Type Parameters:
      T - the value type
      Returns:
      an identity marshaller
    • read

      V read(S value) throws IOException
      Reads a value from its marshalled form.
      Parameters:
      value - the marshalled form
      Returns:
      an unmarshalled value
      Throws:
      IOException - if the value could not be read
    • write

      S write(V value) throws IOException
      Writes a value to its serialized form
      Parameters:
      value - a value to marshal.
      Returns:
      the serialized form of the value
      Throws:
      IOException - if the value could not be written