Package com.tableau.hyperapi
Class TableName
- java.lang.Object
-
- com.tableau.hyperapi.TableName
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Comparator<TableName>
nullSafeTableNameComparator
The null-safe table name comparator.
-
Constructor Summary
Constructors Constructor Description TableName(DatabaseName databaseName, Name schemaName, Name tableName)
Constructs a properly escaped fully qualified TableName.TableName(DatabaseName databaseName, Name schemaName, java.lang.String tableName)
Constructs a properly escaped fully qualified TableName.TableName(DatabaseName databaseName, java.lang.String schemaName, Name tableName)
Constructs a properly escaped fully qualified TableName.TableName(DatabaseName databaseName, java.lang.String schemaName, java.lang.String tableName)
Constructs a properly escaped fully qualified TableName.TableName(Name tableName)
Constructs a properly escaped non-qualified TableName from a NameTableName(Name schemaName, Name tableName)
Constructs a properly escaped qualified TableName.TableName(Name databaseName, Name schemaName, Name tableName)
Constructs a properly escaped fully qualified TableName.TableName(Name databaseName, Name schemaName, java.lang.String tableName)
Constructs a properly escaped fully qualified TableName.TableName(Name schemaName, java.lang.String tableName)
Constructs a properly escaped partly qualified TableName.TableName(Name databaseName, java.lang.String schemaName, Name tableName)
Constructs a properly escaped fully qualified TableName.TableName(Name databaseName, java.lang.String schemaName, java.lang.String tableName)
Constructs a properly escaped fully qualified TableName.TableName(SchemaName schemaName, Name tableName)
Constructs a properly escaped partly qualified TableName.TableName(SchemaName schemaName, java.lang.String tableName)
Constructs a properly escaped partly qualified TableName.TableName(java.lang.String tableName)
Constructs a properly escaped non-qualified TableName.TableName(java.lang.String schemaName, Name tableName)
Constructs a properly escaped partly qualified TableName.TableName(java.lang.String databaseName, Name schemaName, Name tableName)
Constructs a properly escaped fully qualified TableName.TableName(java.lang.String databaseName, Name schemaName, java.lang.String tableName)
Constructs a properly escaped fully qualified TableName.TableName(java.lang.String schemaName, java.lang.String tableName)
Constructs a properly escaped partly qualified TableName.TableName(java.lang.String databaseName, java.lang.String schemaName, Name tableName)
Constructs a properly escaped fully qualified TableName.TableName(java.lang.String databaseName, java.lang.String schemaName, java.lang.String tableName)
Constructs a properly escaped fully qualified TableName.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(TableName other)
Compares this name with the specified name for order.boolean
equals(java.lang.Object that)
Checks for equality.java.util.Optional<DatabaseName>
getDatabaseName()
Gets the optional Database name prefixName
getName()
Gets the Schema name without the optional Schema name prefixjava.util.Optional<SchemaName>
getSchemaName()
Gets the optional Schema name prefixint
hashCode()
Computes a hash code.boolean
isFullyQualified()
Returns whether the table name is qualified i.e Whether the table name has a schema name prefixjava.lang.String
toString()
Gets a correctly escaped string representation of this schema name, which can be used in a SQL query to refer to the schema
-
-
-
Field Detail
-
nullSafeTableNameComparator
public static java.util.Comparator<TableName> nullSafeTableNameComparator
The null-safe table name comparator.
-
-
Constructor Detail
-
TableName
public TableName(Name tableName)
Constructs a properly escaped non-qualified TableName from a Name- Parameters:
tableName
- A non-qualified escaped table name
-
TableName
public TableName(java.lang.String tableName)
Constructs a properly escaped non-qualified TableName.The name will be equivalent to calling Sql::escapeName().
- Parameters:
tableName
- A non-qualified unescaped table name.
-
TableName
public TableName(SchemaName schemaName, Name tableName)
Constructs a properly escaped partly qualified TableName.- Parameters:
schemaName
- The schema nametableName
- The table name.
-
TableName
public TableName(SchemaName schemaName, java.lang.String tableName)
Constructs a properly escaped partly qualified TableName.- Parameters:
schemaName
- The schema nametableName
- An unescaped table name.
-
TableName
public TableName(Name schemaName, Name tableName)
Constructs a properly escaped qualified TableName.- Parameters:
schemaName
- The schema nametableName
- The table name.
-
TableName
public TableName(Name schemaName, java.lang.String tableName)
Constructs a properly escaped partly qualified TableName.- Parameters:
schemaName
- The schema nametableName
- An unescaped table name.
-
TableName
public TableName(java.lang.String schemaName, java.lang.String tableName)
Constructs a properly escaped partly qualified TableName.- Parameters:
schemaName
- An unescaped schema nametableName
- An unescaped table name
-
TableName
public TableName(java.lang.String schemaName, Name tableName)
Constructs a properly escaped partly qualified TableName.- Parameters:
schemaName
- An unescaped schema nametableName
- The table name
-
TableName
public TableName(DatabaseName databaseName, Name schemaName, Name tableName)
Constructs a properly escaped fully qualified TableName.- Parameters:
databaseName
- The database nameschemaName
- The schema nametableName
- The table name.
-
TableName
public TableName(DatabaseName databaseName, Name schemaName, java.lang.String tableName)
Constructs a properly escaped fully qualified TableName.- Parameters:
databaseName
- The database nameschemaName
- An unescaped schema nametableName
- The table name.
-
TableName
public TableName(DatabaseName databaseName, java.lang.String schemaName, Name tableName)
Constructs a properly escaped fully qualified TableName.- Parameters:
databaseName
- The database nameschemaName
- An unescaped schema nametableName
- The table name.
-
TableName
public TableName(DatabaseName databaseName, java.lang.String schemaName, java.lang.String tableName)
Constructs a properly escaped fully qualified TableName.- Parameters:
databaseName
- The database nameschemaName
- An unescaped schema nametableName
- An unescaped table name.
-
TableName
public TableName(Name databaseName, Name schemaName, Name tableName)
Constructs a properly escaped fully qualified TableName.- Parameters:
databaseName
- The database nameschemaName
- The schema nametableName
- The table name.
-
TableName
public TableName(Name databaseName, Name schemaName, java.lang.String tableName)
Constructs a properly escaped fully qualified TableName.- Parameters:
databaseName
- The database nameschemaName
- The schema nametableName
- The table name.
-
TableName
public TableName(Name databaseName, java.lang.String schemaName, Name tableName)
Constructs a properly escaped fully qualified TableName.- Parameters:
databaseName
- The database nameschemaName
- The schema nametableName
- The table name.
-
TableName
public TableName(Name databaseName, java.lang.String schemaName, java.lang.String tableName)
Constructs a properly escaped fully qualified TableName.- Parameters:
databaseName
- The database nameschemaName
- The schema nametableName
- The table name.
-
TableName
public TableName(java.lang.String databaseName, Name schemaName, Name tableName)
Constructs a properly escaped fully qualified TableName.- Parameters:
databaseName
- An unescaped database nameschemaName
- An unescaped schema nametableName
- The table name.
-
TableName
public TableName(java.lang.String databaseName, Name schemaName, java.lang.String tableName)
Constructs a properly escaped fully qualified TableName.- Parameters:
databaseName
- An unescaped database nameschemaName
- The schema nametableName
- An unescaped table name.
-
TableName
public TableName(java.lang.String databaseName, java.lang.String schemaName, Name tableName)
Constructs a properly escaped fully qualified TableName.- Parameters:
databaseName
- An unescaped database nameschemaName
- An unescaped schema nametableName
- The table name.
-
TableName
public TableName(java.lang.String databaseName, java.lang.String schemaName, java.lang.String tableName)
Constructs a properly escaped fully qualified TableName.- Parameters:
databaseName
- An unescaped database nameschemaName
- An unescaped schema nametableName
- An unescaped table name.
-
-
Method Detail
-
toString
public java.lang.String toString()
Gets a correctly escaped string representation of this schema name, which can be used in a SQL query to refer to the schema- Overrides:
toString
in classjava.lang.Object
- Returns:
- The escaped schema name
-
getName
public Name getName()
Gets the Schema name without the optional Schema name prefix- Returns:
- The schema name
-
getSchemaName
public java.util.Optional<SchemaName> getSchemaName()
Gets the optional Schema name prefix- Returns:
- The optional schema name
-
getDatabaseName
public java.util.Optional<DatabaseName> getDatabaseName()
Gets the optional Database name prefix- Returns:
- The optional database name
-
isFullyQualified
public boolean isFullyQualified()
Returns whether the table name is qualified i.e Whether the table name has a schema name prefix- Returns:
- Whether the Table Name is fully qualified
-
equals
public boolean equals(java.lang.Object that)
Checks for equality.- Overrides:
equals
in classjava.lang.Object
- Parameters:
that
- The other name.- Returns:
- Whether the two names are equal.
-
compareTo
public int compareTo(TableName other)
Compares this name with the specified name for order.- Specified by:
compareTo
in interfacejava.lang.Comparable<TableName>
- Parameters:
other
- The other table name.- Returns:
- A negative integer, zero, or a positive integer as this name is less than, equal to, or greater than the other name.
-
hashCode
public int hashCode()
Computes a hash code.- Overrides:
hashCode
in classjava.lang.Object
-
-