Package org.apache.drill.common.types
Enum BooleanType
- All Implemented Interfaces:
Serializable
,Comparable<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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
fromString
(String value) Runtime form of Boolean conversion: allows any of the valid "true" values; assumes all other values are false.static BooleanType
Finds boolean by passed literal.String[]
int
static BooleanType
Returns the enum constant of this type with the specified name.static BooleanType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
TRUE
-
FALSE
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
getNumericValue
public int getNumericValue() -
getLiterals
-
get
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
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
-