Package com.tableau.hyperapi
Class SchemaName
- java.lang.Object
-
- com.tableau.hyperapi.SchemaName
-
- All Implemented Interfaces:
java.lang.Comparable<SchemaName>
public final class SchemaName extends java.lang.Object implements java.lang.Comparable<SchemaName>
A schema name.
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Comparator<SchemaName>
nullSafeSchemaNameComparator
The null-safe Schema name comparator
-
Constructor Summary
Constructors Constructor Description SchemaName(DatabaseName databaseName, Name schemaName)
Constructs a properly escaped qualified SchemaName.SchemaName(DatabaseName databaseName, java.lang.String schemaName)
Constructs a properly escaped qualified SchemaName.SchemaName(Name schemaName)
Constructs a properly escaped non-qualified SchemaName from a NameSchemaName(Name databaseName, Name schemaName)
Constructs a properly escaped qualified SchemaName.SchemaName(Name databaseName, java.lang.String schemaName)
Constructs a properly escaped qualified SchemaName.SchemaName(java.lang.String schemaName)
Constructs a properly escaped non-qualified SchemaName.SchemaName(java.lang.String databaseName, Name schemaName)
Constructs a properly escaped qualified SchemaName.SchemaName(java.lang.String databaseName, java.lang.String schemaName)
Constructs a properly escaped qualified SchemaName.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(SchemaName other)
Compares this name with the other schema name for order.boolean
equals(java.lang.Object that)
Checks two names for equality.java.util.Optional<DatabaseName>
getDatabaseName()
Gets the optional Database name prefixName
getName()
Gets the Schema name without the optional Database name prefixint
hashCode()
Computes a hash code.boolean
isFullyQualified()
Returns whether the schema name is qualified i.e Whether the schema name has a database 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
-
nullSafeSchemaNameComparator
public static java.util.Comparator<SchemaName> nullSafeSchemaNameComparator
The null-safe Schema name comparator
-
-
Constructor Detail
-
SchemaName
public SchemaName(Name schemaName)
Constructs a properly escaped non-qualified SchemaName from a Name- Parameters:
schemaName
- A non-qualified escaped schema name
-
SchemaName
public SchemaName(java.lang.String schemaName)
Constructs a properly escaped non-qualified SchemaName.The name will be equivalent to calling Sql::escapeName().
- Parameters:
schemaName
- A non-qualified unescaped schema name.
-
SchemaName
public SchemaName(DatabaseName databaseName, Name schemaName)
Constructs a properly escaped qualified SchemaName.- Parameters:
databaseName
- The database NameschemaName
- The schema name.
-
SchemaName
public SchemaName(Name databaseName, Name schemaName)
Constructs a properly escaped qualified SchemaName.- Parameters:
databaseName
- The database NameschemaName
- The schema name.
-
SchemaName
public SchemaName(java.lang.String databaseName, Name schemaName)
Constructs a properly escaped qualified SchemaName.- Parameters:
databaseName
- An unescaped database NameschemaName
- The schema name.
-
SchemaName
public SchemaName(DatabaseName databaseName, java.lang.String schemaName)
Constructs a properly escaped qualified SchemaName.- Parameters:
databaseName
- The database NameschemaName
- An unescaped schema name.
-
SchemaName
public SchemaName(Name databaseName, java.lang.String schemaName)
Constructs a properly escaped qualified SchemaName.- Parameters:
databaseName
- The database NameschemaName
- An unescaped schema name.
-
SchemaName
public SchemaName(java.lang.String databaseName, java.lang.String schemaName)
Constructs a properly escaped qualified SchemaName.- Parameters:
databaseName
- An unescaped databaseNameschemaName
- An unescaped schema 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 Database name prefix- Returns:
- The 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 schema name is qualified i.e Whether the schema name has a database name prefix- Returns:
- Whether the schema name fully qualified
-
equals
public boolean equals(java.lang.Object that)
Checks two names for equality.- Overrides:
equals
in classjava.lang.Object
- Parameters:
that
- The other name.- Returns:
- Whether the two names are equal.
-
compareTo
public int compareTo(SchemaName other)
Compares this name with the other schema name for order.- Specified by:
compareTo
in interfacejava.lang.Comparable<SchemaName>
- Parameters:
other
- The other 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
-
-