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 SqlTypebigInt()Returns the BIG_INT SQL type.static SqlTypebool()Returns the BOOL SQL type.static SqlTypebytes()Returns the BYTES SQL type.static SqlTypecharacter(int maxLength) Returns the CHAR SQL type.intCompares this SQL type with the specified SQL type for order.static SqlTypedate()Returns the DATE SQL type.static SqlTypeReturns the DOUBLE PRECISION SQL type.booleanChecks two SQL types for equality.static SqlTypeReturns the GEOGRAPHY SQL type.intReturns 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.inthashCode()Computes a hash code.static SqlTypeinteger()Returns the INT SQL type.static SqlTypeinterval()Returns the INTERVAL SQL type.static SqlTypejson()Returns the JSON SQL type.static SqlTypenumeric(int precision, int scale) Returns the NUMERIC SQL type.static SqlTypeoid()Returns the OID SQL type.static SqlTypereal()Returns the REAL SQL type.static SqlTypesmallInt()Returns the SMALL_INT SQL type.static SqlTypeReturns the TABGEOGRAPHY SQL type.static SqlTypetext()Returns the TEXT SQL type.static SqlTypetime()Returns the TIME SQL type.static SqlTypeReturns the TIMESTAMP SQL type.static SqlTypeReturns the TIMESTAMP_TZ SQL type.toString()Return a string representation of this SQL type that can be used in SQL statements.static SqlTypevarchar(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.
-
tabgeography
Returns the TABGEOGRAPHY SQL type.- Returns:
- The TABGEOGRAPHY SQL type.
-
geography
Returns the GEOGRAPHY SQL type. Deprecated: Will be removed as part of W-17701666.- 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:
compareToin 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.
-