Class Field

    • Constructor Summary

      Constructors 
      Constructor Description
      Field()  
      Field​(int index, long offset, boolean optional, java.lang.Object value, Target target)
      Constructs a field with the specified index, offset and value.
      Field​(int index, long offset, byte[] value)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void deserialize​(DeserializerBuffer deser)
      Called when the object's values must be deserialized
      short getIndex()
      The field index
      org.slf4j.Logger getLogger()  
      long getOffset()
      The offset of the field's value when written to bytes
      byte[] getValue()
      The field value as bytes
      <T> T getValue​(java.lang.Class<T> clazz)
      Obtains the fields value converted to the specified type.
      boolean isOptional()
      Indicates if the field is written as an optional field
      void serialize​(SerializerBuffer ser)
      Called when the object's values must be serialized
      void serialize​(SerializerBuffer ser, Target target)
      Called when the object's values must be serialized
      void setIndex​(short index)
      The field index
      void setOffset​(long offset)
      The offset of the field's value when written to bytes
      void setOptional​(boolean optional)
      Indicates if the field is written as an optional field
      void setValue​(byte[] value)
      The field value as bytes
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Field

        public Field​(int index,
                     long offset,
                     byte[] value)
      • Field

        public Field()
    • Method Detail

      • getValue

        public <T> T getValue​(java.lang.Class<T> clazz)
                       throws ValueDeserializationException
        Obtains the fields value converted to the specified type.
        Type Parameters:
        T - the expected type
        Parameters:
        clazz - the type to convert the value's bytes to
        Returns:
        the bytes converted to value of type clazz
        Throws:
        ValueDeserializationException - if the value cannot be converted to the specified type
      • getLogger

        public org.slf4j.Logger getLogger()
      • getIndex

        public short getIndex()
        The field index
      • getOffset

        public long getOffset()
        The offset of the field's value when written to bytes
      • getValue

        public byte[] getValue()
        The field value as bytes
      • isOptional

        public boolean isOptional()
        Indicates if the field is written as an optional field
      • setIndex

        public void setIndex​(short index)
        The field index
      • setOffset

        public void setOffset​(long offset)
        The offset of the field's value when written to bytes
      • setValue

        public void setValue​(byte[] value)
        The field value as bytes
      • setOptional

        public void setOptional​(boolean optional)
        Indicates if the field is written as an optional field