java.lang.Object
java.lang.Enum<Scalar>
org.wildfly.clustering.marshalling.protostream.Scalar
All Implemented Interfaces:
Serializable, Comparable<Scalar>, Constable, Marshallable<Object>, Readable<Object>, ScalarMarshaller<Object>, Writable<Object>

public enum Scalar extends Enum<Scalar> implements ScalarMarshaller<Object>
Enumeration of common scalar marshaller implementations.
Author:
Paul Ferraro
  • Enum Constant Details

    • ANY

      public static final Scalar ANY
    • BOOLEAN

      public static final Scalar BOOLEAN
    • BYTE

      public static final Scalar BYTE
    • SHORT

      public static final Scalar SHORT
    • INTEGER

      public static final Scalar INTEGER
    • LONG

      public static final Scalar LONG
    • FLOAT

      public static final Scalar FLOAT
    • DOUBLE

      public static final Scalar DOUBLE
    • CHARACTER

      public static final Scalar CHARACTER
    • BYTE_BUFFER

      public static final Scalar BYTE_BUFFER
    • BYTE_ARRAY

      public static final Scalar BYTE_ARRAY
    • STRING

      public static final Scalar STRING
    • REFERENCE

      public static final Scalar REFERENCE
  • Method Details

    • values

      public static Scalar[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Scalar valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getJavaClass

      public 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

      public 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

      public 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

      public 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

      public 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>
      Parameters:
      operation - the marshalling operation
      value - the value whose size is to be calculated
      Returns:
      an optional buffer size, only present if the buffer size could be computed
    • cast

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