Class Serializer.Provided<T>

java.lang.Object
org.wildfly.clustering.marshalling.Serializer.Provided<T>
All Implemented Interfaces:
Serializer<T>
Enclosing interface:
Serializer<T>

public static class Serializer.Provided<T> extends Object implements Serializer<T>
  • Constructor Details

  • Method Details

    • write

      public void write(DataOutput output, T value) throws IOException
      Description copied from interface: Serializer
      Writes the specified object to the specified output stream
      Specified by:
      write in interface Serializer<T>
      Parameters:
      output - the data output stream
      value - an object to serialize
      Throws:
      IOException - if an I/O error occurs
    • read

      public T read(DataInput input) throws IOException
      Description copied from interface: Serializer
      Reads an object from the specified input stream.
      Specified by:
      read in interface Serializer<T>
      Parameters:
      input - a data input stream
      Returns:
      the deserialized object
      Throws:
      IOException - if an I/O error occurs
    • size

      public OptionalInt size(T object)
      Description copied from interface: Serializer
      Returns the size of the buffer to use for marshalling the specified object, if known.
      Specified by:
      size in interface Serializer<T>
      Parameters:
      object - the object to be sized
      Returns:
      the buffer size (in bytes), or empty if unknown.
    • wrap

      public <V> Serializer<V> wrap(Function<V,T> unwrapper, Function<T,V> wrapper)
      Description copied from interface: Serializer
      Creates a wrapped serializer that delegates to this serializer applying the specified wrapping/unwrapping functions.
      Specified by:
      wrap in interface Serializer<T>
      Type Parameters:
      V - the wrapper type
      Parameters:
      unwrapper - an unwrapping function
      wrapper - a wrapping function
      Returns:
      a wrapped serializer