Interface ScalarMarshallerProvider

All Superinterfaces:
Marshallable<Object>, Readable<Object>, ScalarMarshaller<Object>, Writable<Object>
All Known Implementing Classes:
Scalar

public interface ScalarMarshallerProvider extends ScalarMarshaller<Object>
Provider for a ScalarMarshaller.
Author:
Paul Ferraro
  • Method Details

    • getMarshaller

      ScalarMarshaller<?> getMarshaller()
    • getJavaClass

      default Class<? extends Object> getJavaClass()
      Description copied from interface: Marshallable
      Returns the type of object handled by this marshallable instance.
      Specified by:
      getJavaClass in interface Marshallable<Object>
      Returns:
      the type of object handled by this marshallable instance.
    • getWireType

      default org.infinispan.protostream.descriptors.WireType getWireType()
      Description copied from interface: ScalarMarshaller
      Returns the wire type of the scalar value written by this marshaller.
      Specified by:
      getWireType in interface ScalarMarshaller<Object>
      Returns:
      the wire type of the scalar value written by this marshaller.
    • readFrom

      default Object readFrom(ProtoStreamReader reader) throws IOException
      Description copied from interface: Readable
      Reads an object from the specified reader.
      Specified by:
      readFrom in interface Readable<Object>
      Parameters:
      reader - a ProtoStream reader
      Returns:
      the read object
      Throws:
      IOException - if the object could not be read
    • writeTo

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

      default OptionalInt size(ProtoStreamSizeOperation operation, Object value)
      Description copied from interface: Marshallable
      Computes the size of the specified object.
      Specified by:
      size in interface Marshallable<Object>
      value - the value whose size is to be calculated
      Returns:
      an optional buffer size, only present if the buffer size could be computed
    • cast

      default <T> ScalarMarshaller<T> cast(Class<T> type)