Package com.tableau.hyperapi
Class SqlType
java.lang.Object
com.tableau.hyperapi.SqlType
- All Implemented Interfaces:
Comparable<SqlType>
A SQL type.
-
Method Summary
Modifier and TypeMethodDescriptionstatic SqlType
bigInt()
Returns the BIG_INT SQL type.static SqlType
bool()
Returns the BOOL SQL type.static SqlType
bytes()
Returns the BYTES SQL type.static SqlType
character
(int maxLength) Returns the CHAR SQL type.int
Compares this SQL type with the specified SQL type for order.static SqlType
date()
Returns the DATE SQL type.static SqlType
Returns the DOUBLE PRECISION SQL type.boolean
Checks two SQL types for equality.static SqlType
Returns the GEOGRAPHY SQL type.int
Returns the type oid.Returns the internal type modifier.Returns the maximum length of this type if it is CHAR or VARCHAR.Returns the precision if this type is NUMERIC.getScale()
Returns the scale if this type is NUMERIC.getTag()
Returns the type tag.int
hashCode()
Computes a hash code.static SqlType
integer()
Returns the INT SQL type.static SqlType
interval()
Returns the INTERVAL SQL type.static SqlType
json()
Returns the JSON SQL type.static SqlType
numeric
(int precision, int scale) Returns the NUMERIC SQL type.static SqlType
oid()
Returns the OID SQL type.static SqlType
real()
Returns the REAL SQL type.static SqlType
smallInt()
Returns the SMALL_INT SQL type.static SqlType
text()
Returns the TEXT SQL type.static SqlType
time()
Returns the TIME SQL type.static SqlType
Returns the TIMESTAMP SQL type.static SqlType
Returns the TIMESTAMP_TZ SQL type.toString()
Return a string representation of this SQL type that can be used in SQL statements.static SqlType
varchar
(int maxLength) Returns the VARCHAR SQL type.
-
Method Details
-
bool
Returns the BOOL SQL type.- Returns:
- The BOOL SQL type.
-
bigInt
Returns the BIG_INT SQL type.- Returns:
- The BIG_INT SQL type.
-
smallInt
Returns the SMALL_INT SQL type.- Returns:
- The SMALL_INT SQL type.
-
integer
Returns the INT SQL type.- Returns:
- The INT SQL type.
-
numeric
Returns the NUMERIC SQL type.- Parameters:
precision
- The precision.scale
- The scale.- Returns:
- The NUMERIC SQL type.
-
real
Returns the REAL SQL type.- Returns:
- The REAL SQL type.
-
doublePrecision
Returns the DOUBLE PRECISION SQL type.- Returns:
- The DOUBLE PRECISION SQL type.
-
oid
Returns the OID SQL type.- Returns:
- The OID SQL type.
-
bytes
Returns the BYTES SQL type.- Returns:
- The BYTES SQL type.
-
text
Returns the TEXT SQL type.- Returns:
- The TEXT SQL type.
-
varchar
Returns the VARCHAR SQL type.- Parameters:
maxLength
- The maximum length of this VARCHAR type- Returns:
- The VARCHAR SQL type.
-
character
Returns the CHAR SQL type.- Parameters:
maxLength
- The maximum length.- Returns:
- The CHAR SQL type.
-
json
Returns the JSON SQL type.- Returns:
- The JSON SQL type.
-
date
Returns the DATE SQL type.- Returns:
- The DATE SQL type.
-
interval
Returns the INTERVAL SQL type.- Returns:
- The INTERVAL SQL type.
-
time
Returns the TIME SQL type.- Returns:
- The TIME SQL type.
-
timestamp
Returns the TIMESTAMP SQL type.- Returns:
- The TIMESTAMP SQL type.
-
timestampTz
Returns the TIMESTAMP_TZ SQL type.- Returns:
- The TIMESTAMP_TZ SQL type.
-
geography
Returns the GEOGRAPHY SQL type.- Returns:
- The GEOGRAPHY SQL type.
-
getTag
Returns the type tag.- Returns:
- The type tag.
-
getInternalOid
public int getInternalOid()Returns the type oid.This is an internal method and may go away in future API versions.
- Returns:
- The type oid.
-
getInternalTypeModifier
Returns the internal type modifier.This is an internal method and may go away in future API versions.
- Returns:
- The type modifier.
-
getPrecision
Returns the precision if this type is NUMERIC.- Returns:
- The precision if applicable.
-
getScale
Returns the scale if this type is NUMERIC.- Returns:
- The scale if applicable.
-
getMaxLength
Returns the maximum length of this type if it is CHAR or VARCHAR.- Returns:
- The maximum length if applicable.
-
equals
Checks two SQL types for equality. -
hashCode
public int hashCode()Computes a hash code. -
compareTo
Compares this SQL type with the specified SQL type for order.- Specified by:
compareTo
in interfaceComparable<SqlType>
- Parameters:
other
- The other SQL type.- Returns:
- A negative integer, zero, or a positive integer as this SQL type is less than, equal to, or greater than the other SQL type.
-
toString
Return a string representation of this SQL type that can be used in SQL statements.
-