Enum Class FieldType

java.lang.Object
java.lang.Enum<FieldType>
org.apache.geode.pdx.FieldType
All Implemented Interfaces:
Serializable, Comparable<FieldType>, Constable

public enum FieldType extends Enum<FieldType>
Every field of a pdx must have one of these types. The type of that field can never change. If you do want to be able to change a field's class then its field type needs to be OBJECT. Some field types are always serialized with a certain number of bytes; these are called "fixed-width". Others are serialized with a variable number of bytes; these are called "variable-width".
Since:
GemFire 6.6.2
  • Enum Constant Details

    • BOOLEAN

      public static final FieldType BOOLEAN
    • BYTE

      public static final FieldType BYTE
    • CHAR

      public static final FieldType CHAR
    • SHORT

      public static final FieldType SHORT
    • INT

      public static final FieldType INT
    • LONG

      public static final FieldType LONG
    • FLOAT

      public static final FieldType FLOAT
    • DOUBLE

      public static final FieldType DOUBLE
    • DATE

      public static final FieldType DATE
    • STRING

      public static final FieldType STRING
    • OBJECT

      public static final FieldType OBJECT
    • BOOLEAN_ARRAY

      public static final FieldType BOOLEAN_ARRAY
    • CHAR_ARRAY

      public static final FieldType CHAR_ARRAY
    • BYTE_ARRAY

      public static final FieldType BYTE_ARRAY
    • SHORT_ARRAY

      public static final FieldType SHORT_ARRAY
    • INT_ARRAY

      public static final FieldType INT_ARRAY
    • LONG_ARRAY

      public static final FieldType LONG_ARRAY
    • FLOAT_ARRAY

      public static final FieldType FLOAT_ARRAY
    • DOUBLE_ARRAY

      public static final FieldType DOUBLE_ARRAY
    • STRING_ARRAY

      public static final FieldType STRING_ARRAY
    • OBJECT_ARRAY

      public static final FieldType OBJECT_ARRAY
    • ARRAY_OF_BYTE_ARRAYS

      public static final FieldType ARRAY_OF_BYTE_ARRAYS
  • Method Details

    • values

      public static FieldType[] 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 FieldType 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
    • isFixedWidth

      public boolean isFixedWidth()
      Returns:
      true if the type is "fixed-width"; false if it is "variable-width".
    • getWidth

      public int getWidth()
      Returns:
      the number of bytes used to serialize fixed-width fields; -1 is returned for variable-width fields.
    • toString

      public String toString()
      Overrides:
      toString in class Enum<FieldType>
    • getDefaultBytes

      public ByteBuffer getDefaultBytes()
      Returns:
      a ByteBuffer that contains the serialized encoding of this type's default value.
    • get

      public static FieldType get(Class<?> c)
      Given a Class return the corresponding FieldType.
      Parameters:
      c - a Class
      Returns:
      the FieldType corresponding to the given Class
    • getDefaultValue

      public Object getDefaultValue()