Package com.tableau.hyperapi
Class SqlType
- java.lang.Object
-
- com.tableau.hyperapi.SqlType
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static 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.intcompareTo(SqlType other)Compares this SQL type with the specified SQL type for order.static SqlTypedate()Returns the DATE SQL type.static SqlTypedoublePrecision()Returns the DOUBLE PRECISION SQL type.booleanequals(java.lang.Object that)Checks two SQL types for equality.static SqlTypegeography()Returns the GEOGRAPHY SQL type.intgetInternalOid()Returns the type oid.java.util.OptionalIntgetInternalTypeModifier()Returns the internal type modifier.java.util.OptionalIntgetMaxLength()Returns the maximum length of this type if it is CHAR or VARCHAR.java.util.OptionalIntgetPrecision()Returns the precision if this type is NUMERIC.java.util.OptionalIntgetScale()Returns the scale if this type is NUMERIC.TypeTaggetTag()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 SqlTypetext()Returns the TEXT SQL type.static SqlTypetime()Returns the TIME SQL type.static SqlTypetimestamp()Returns the TIMESTAMP SQL type.static SqlTypetimestampTz()Returns the TIMESTAMP_TZ SQL type.java.lang.StringtoString()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 Detail
-
bool
public static SqlType bool()
Returns the BOOL SQL type.- Returns:
- The BOOL SQL type.
-
bigInt
public static SqlType bigInt()
Returns the BIG_INT SQL type.- Returns:
- The BIG_INT SQL type.
-
smallInt
public static SqlType smallInt()
Returns the SMALL_INT SQL type.- Returns:
- The SMALL_INT SQL type.
-
integer
public static SqlType integer()
Returns the INT SQL type.- Returns:
- The INT SQL type.
-
numeric
public static SqlType numeric(int precision, int scale)
Returns the NUMERIC SQL type.- Parameters:
scale- The scale.precision- The precision.- Returns:
- The NUMERIC SQL type.
-
real
public static SqlType real()
Returns the REAL SQL type.- Returns:
- The REAL SQL type.
-
doublePrecision
public static SqlType doublePrecision()
Returns the DOUBLE PRECISION SQL type.- Returns:
- The DOUBLE PRECISION SQL type.
-
oid
public static SqlType oid()
Returns the OID SQL type.- Returns:
- The OID SQL type.
-
bytes
public static SqlType bytes()
Returns the BYTES SQL type.- Returns:
- The BYTES SQL type.
-
text
public static SqlType text()
Returns the TEXT SQL type.- Returns:
- The TEXT SQL type.
-
varchar
public static SqlType varchar(int maxLength)
Returns the VARCHAR SQL type.- Parameters:
maxLength- The maximum length of this VARCHAR type- Returns:
- The VARCHAR SQL type.
-
character
public static SqlType character(int maxLength)
Returns the CHAR SQL type.- Parameters:
maxLength- The maximum length.- Returns:
- The CHAR SQL type.
-
json
public static SqlType json()
Returns the JSON SQL type.- Returns:
- The JSON SQL type.
-
date
public static SqlType date()
Returns the DATE SQL type.- Returns:
- The DATE SQL type.
-
interval
public static SqlType interval()
Returns the INTERVAL SQL type.- Returns:
- The INTERVAL SQL type.
-
time
public static SqlType time()
Returns the TIME SQL type.- Returns:
- The TIME SQL type.
-
timestamp
public static SqlType timestamp()
Returns the TIMESTAMP SQL type.- Returns:
- The TIMESTAMP SQL type.
-
timestampTz
public static SqlType timestampTz()
Returns the TIMESTAMP_TZ SQL type.- Returns:
- The TIMESTAMP_TZ SQL type.
-
geography
public static SqlType geography()
Returns the GEOGRAPHY SQL type.- Returns:
- The GEOGRAPHY SQL type.
-
getTag
public TypeTag 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
public java.util.OptionalInt getInternalTypeModifier()
Returns the internal type modifier.This is an internal method and may go away in future API versions.
- Returns:
- The type modifier.
-
getPrecision
public java.util.OptionalInt getPrecision()
Returns the precision if this type is NUMERIC.- Returns:
- The precision if applicable.
-
getScale
public java.util.OptionalInt getScale()
Returns the scale if this type is NUMERIC.- Returns:
- The scale if applicable.
-
getMaxLength
public java.util.OptionalInt getMaxLength()
Returns the maximum length of this type if it is CHAR or VARCHAR.- Returns:
- The maximum length if applicable.
-
equals
public boolean equals(java.lang.Object that)
Checks two SQL types for equality.- Overrides:
equalsin classjava.lang.Object- Parameters:
that- The other SQL type.- Returns:
- Whether the two SQL types are equal.
-
hashCode
public int hashCode()
Computes a hash code.- Overrides:
hashCodein classjava.lang.Object
-
compareTo
public int compareTo(SqlType other)
Compares this SQL type with the specified SQL type for order.- Specified by:
compareToin interfacejava.lang.Comparable<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
public java.lang.String toString()
Return a string representation of this SQL type that can be used in SQL statements.- Overrides:
toStringin classjava.lang.Object- Returns:
- The string representation.
-
-