Enum Class FieldType

java.lang.Object
java.lang.Enum<FieldType>
org.springframework.data.mongodb.core.mapping.FieldType
All Implemented Interfaces:
Serializable, Comparable<FieldType>, Constable

public enum FieldType extends Enum<FieldType>
Enumeration of field value types that can be used to represent a Document field value. This enumeration contains a subset of BsonType that is supported by the mapping and conversion components.
Bson types are identified by a byte value. This enumeration typically returns the according bson type value except for IMPLICIT which is a marker to derive the field type from a property.
Since:
2.2
Author:
Mark Paluch, Christoph Strobl
See Also:
  • BsonType
  • Enum Constant Details

    • IMPLICIT

      public static final FieldType IMPLICIT
      Implicit type that is derived from the property value.
    • DOUBLE

      public static final FieldType DOUBLE
    • STRING

      public static final FieldType STRING
    • ARRAY

      public static final FieldType ARRAY
    • BINARY

      public static final FieldType BINARY
    • OBJECT_ID

      public static final FieldType OBJECT_ID
    • BOOLEAN

      public static final FieldType BOOLEAN
    • DATE_TIME

      public static final FieldType DATE_TIME
    • PATTERN

      public static final FieldType PATTERN
    • SCRIPT

      public static final FieldType SCRIPT
    • INT32

      public static final FieldType INT32
    • TIMESTAMP

      public static final FieldType TIMESTAMP
    • INT64

      public static final FieldType INT64
    • DECIMAL128

      public static final FieldType DECIMAL128
  • 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
    • getBsonType

      public int getBsonType()
      Returns the BSON type identifier. Can be -1 if FieldType maps to a synthetic Bson type.
      Returns:
      the BSON type identifier. Can be -1 if FieldType maps to a synthetic Bson type.
    • getJavaClass

      public Class<?> getJavaClass()
      Returns the Java class used to represent the type.
      Returns:
      the Java class used to represent the type.