FieldType (Apache Geode 2.0.2)
Description: declaration: package: org.apache.geode.pdx, enum: FieldType

Package org.apache.geode.pdx

# 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

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class java.lang.Enum

  `Enum.EnumDesc<E extends Enum<E>>`

- ## Enum Constant Summary

  Enum Constants
  Enum Constant
  Description
  `ARRAY_OF_BYTE_ARRAYS`
  `BOOLEAN`
  `BOOLEAN_ARRAY`
  `BYTE`
  `BYTE_ARRAY`
  `CHAR`
  `CHAR_ARRAY`
  `DATE`
  `DOUBLE`
  `DOUBLE_ARRAY`
  `FLOAT`
  `FLOAT_ARRAY`
  `INT`
  `INT_ARRAY`
  `LONG`
  `LONG_ARRAY`
  `OBJECT`
  `OBJECT_ARRAY`
  `SHORT`
  `SHORT_ARRAY`
  `STRING`
  `STRING_ARRAY`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static FieldType`
  `get(Class<?> c)`
  Given a Class return the corresponding FieldType.
  `ByteBuffer`
  `getDefaultBytes()`
  `Object`
  `getDefaultValue()`
  `int`
  `getWidth()`
  `boolean`
  `isFixedWidth()`
  `String`
  `toString()`
  `static FieldType`
  `valueOf(String name)`
  Returns the enum constant of this class with the specified name.
  `static FieldType[]`
  `values()`
  Returns an array containing the constants of this enum class, in the order they are declared.

  ### Methods inherited from class java.lang.Enum

  `clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf`

  ### Methods inherited from class java.lang.Object

  `getClass, notify, notifyAll, wait, wait, wait`

- ## 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()