Class JBBPAbstractField

java.lang.Object
com.igormaznitsa.jbbp.model.JBBPAbstractField
All Implemented Interfaces:
JBBPNamedField, Serializable
Direct Known Subclasses:
JBBPAbstractArrayField, JBBPFieldBit, JBBPFieldBoolean, JBBPFieldByte, JBBPFieldDouble, JBBPFieldFloat, JBBPFieldInt, JBBPFieldLong, JBBPFieldShort, JBBPFieldString, JBBPFieldStruct, JBBPFieldUByte, JBBPFieldUInt, JBBPFieldUShort

public abstract class JBBPAbstractField extends Object implements Serializable, JBBPNamedField
The Class is the ancestor for all fields and arrays of fields.
Since:
1.0
See Also:
  • Field Details

    • fieldNameInfo

      protected final JBBPNamedFieldInfo fieldNameInfo
      The Field contains the field name info
    • payload

      protected Serializable payload
      The Variable can hold some payload. It is not used by JBBP and can be used without restrictions. By default, it is null. The Field is not thread safe.
      Since:
      1.2.0
  • Constructor Details

    • JBBPAbstractField

      public JBBPAbstractField(JBBPNamedFieldInfo namedField)
      The Constructor.
      Parameters:
      namedField - the name field info for the field, it can be null.
  • Method Details

    • getPayload

      public Serializable getPayload()
      Get payload value saved by user. The Operation is not thread safe.
      Returns:
      payload value, can be null
      Since:
      1.2.0
    • setPayload

      public void setPayload(Serializable value)
      Set payload value. The Operation is not thread safe.
      Parameters:
      value - payload value, can be null.
      Since:
      1.2.0
    • getNameInfo

      public JBBPNamedFieldInfo getNameInfo()
      Get the field name info.
      Specified by:
      getNameInfo in interface JBBPNamedField
      Returns:
      the field name info if it is presented, otherwise null
    • getFieldPath

      public String getFieldPath()
      Get the field path.
      Returns:
      the field path or null if the field doesn't contain any field name info
    • getFieldName

      public String getFieldName()
      Get the field name.
      Returns:
      the field name or null if the field doesn't contain any field name info
    • getTypeAsString

      public abstract String getTypeAsString()
      Get the field type in string representation.
      Returns:
      the string representation of field type, like 'int', 'long', 'bool [123]'
      Since:
      1.2.0