Enum LogicalType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<LogicalType>

    public enum LogicalType
    extends java.lang.Enum<LogicalType>
    Set of logical types (or type categories, classes of classes), used for defining applicability of configuration like coercion configuration. Used instead to allow easier targeting of types than having to enumerate physical types (Class or JavaType).
    Since:
    2.12
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      Array
      Array types of other values.
      Binary
      Binary data such as byte[] and ByteBuffer.
      Boolean
      Boolean, boolean, AtomicBoolean.
      Collection
      Collection values (and "Collection-like" for JVM languages and datatype libraries with semantically similar types)
      DateTime
      Date/time datatypes such as Date, Calendar.
      Enum
      Various Enum types.
      Float
      Basic floating-point numbers types like short, int, long and matching wrapper types, BigInteger.
      Integer
      Basic integral numbers types like short, int, long and matching wrapper types, BigInteger.
      Map
      Map values (and "Map-like" for JVM languages and datatype libraries with semantically similar types)
      OtherScalar
      Scalar types other than ones listed above: includes types like URL and UUID.
      POJO
      Types that are handled by default "set of key/value pairs" serialization, also known as "Beans".
      Textual
      Purely textual types, String and similar (but not types that are generally expressed as Strings in input).
      Untyped
      "Non-type", Type used to contained untyped, free-form content: maybe a "Tree" (sometimes called "AST"), or buffer of some kind, or even just nominal type of Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static LogicalType fromClass​(java.lang.Class<?> raw, LogicalType defaultIfNotRecognized)
      Helper method to use for figuring out logical type from physical type, in cases where caller wants a guess.
      static LogicalType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static LogicalType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • Array

        public static final LogicalType Array
        Array types of other values.

        Note: excludes binary type byte[].

      • Collection

        public static final LogicalType Collection
        Collection values (and "Collection-like" for JVM languages and datatype libraries with semantically similar types)
      • Map

        public static final LogicalType Map
        Map values (and "Map-like" for JVM languages and datatype libraries with semantically similar types)
      • POJO

        public static final LogicalType POJO
        Types that are handled by default "set of key/value pairs" serialization, also known as "Beans".

        In addition to user-defined types, also includes JDK types like:

        • Throwable
      • Untyped

        public static final LogicalType Untyped
        "Non-type", Type used to contained untyped, free-form content: maybe a "Tree" (sometimes called "AST"), or buffer of some kind, or even just nominal type of Object
      • Integer

        public static final LogicalType Integer
        Basic integral numbers types like short, int, long and matching wrapper types, BigInteger.
      • Float

        public static final LogicalType Float
        Basic floating-point numbers types like short, int, long and matching wrapper types, BigInteger.
      • Boolean

        public static final LogicalType Boolean
        Boolean, boolean, AtomicBoolean.
      • Enum

        public static final LogicalType Enum
        Various Enum types.
      • Textual

        public static final LogicalType Textual
        Purely textual types, String and similar (but not types that are generally expressed as Strings in input).
      • Binary

        public static final LogicalType Binary
        Binary data such as byte[] and ByteBuffer.
      • DateTime

        public static final LogicalType DateTime
        Date/time datatypes such as Date, Calendar.
      • OtherScalar

        public static final LogicalType OtherScalar
        Scalar types other than ones listed above: includes types like URL and UUID.
    • Method Detail

      • values

        public static LogicalType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (LogicalType c : LogicalType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static LogicalType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • fromClass

        public static LogicalType fromClass​(java.lang.Class<?> raw,
                                            LogicalType defaultIfNotRecognized)
        Helper method to use for figuring out logical type from physical type, in cases where caller wants a guess. Note that introspection is not exhaustive and mostly covers basic Collection, Map and Enum cases; but not more specific types (for example datatype-provided extension types).
        Parameters:
        raw - Type-erased class to classify
        defaultIfNotRecognized - if no type recognized, value to return (for example, null)