Enum BooleanType

java.lang.Object
java.lang.Enum<BooleanType>
org.apache.drill.common.types.BooleanType
All Implemented Interfaces:
Serializable, Comparable<BooleanType>

public enum BooleanType extends Enum<BooleanType>
Enum that contains two boolean types: TRUE and FALSE. Each has numeric representation and list of allowed literals. List of literals if formed according to {@link <a href="https://www.postgresql.org/docs/9.6/static/datatype-boolean.html">Postgre Documentation}
  • Enum Constant Details

  • Method Details

    • values

      public static BooleanType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static BooleanType valueOf(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:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getNumericValue

      public int getNumericValue()
    • getLiterals

      public String[] getLiterals()
    • get

      public static BooleanType get(String literal)
      Finds boolean by passed literal. Leading or trailing whitespace is ignored, and case does not matter.
      Parameters:
      literal - boolean string representation
      Returns:
      boolean type
      Throws:
      IllegalArgumentException - if boolean type is not found
    • fromString

      public static boolean fromString(String value)
      Runtime form of Boolean conversion: allows any of the valid "true" values; assumes all other values are false. Does case-insensitive comparisons. If the string must be trimmed, the caller should do it.
      Parameters:
      value - non-null string value
      Returns:
      true (if one of the TRUE literals), else false