Package com.tableau.hyperapi
Class DatabaseName
- java.lang.Object
-
- com.tableau.hyperapi.DatabaseName
-
- All Implemented Interfaces:
java.lang.Comparable<DatabaseName>
public final class DatabaseName extends java.lang.Object implements java.lang.Comparable<DatabaseName>
A database name.
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Comparator<DatabaseName>nullSafeDatabaseNameComparatorThe null safe comparator
-
Constructor Summary
Constructors Constructor Description DatabaseName(Name databaseName)Constructs a Database name from already properly escaped SQL NameDatabaseName(java.lang.String databaseName)Constructs a properly escaped Database Name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(DatabaseName other)Compares this name with the other database name for order.booleanequals(java.lang.Object that)Checks two names for equality.NamegetName()Gets the database nameinthashCode()Computes a hash code.java.lang.StringtoString()Gets a correctly escaped string representation of database name, which can be used in a SQL query to refer to the database entity
-
-
-
Field Detail
-
nullSafeDatabaseNameComparator
public static java.util.Comparator<DatabaseName> nullSafeDatabaseNameComparator
The null safe comparator
-
-
Constructor Detail
-
DatabaseName
public DatabaseName(java.lang.String databaseName)
Constructs a properly escaped Database Name.The name will be equivalent to calling Sql::escapeName().
- Parameters:
databaseName- An unescaped database name.
-
DatabaseName
public DatabaseName(Name databaseName)
Constructs a Database name from already properly escaped SQL Name- Parameters:
databaseName- The database name
-
-
Method Detail
-
toString
public java.lang.String toString()
Gets a correctly escaped string representation of database name, which can be used in a SQL query to refer to the database entity- Overrides:
toStringin classjava.lang.Object- Returns:
- The escaped database name.
-
getName
public Name getName()
Gets the database name- Returns:
- The name
-
equals
public boolean equals(java.lang.Object that)
Checks two names for equality.- Overrides:
equalsin classjava.lang.Object- Parameters:
that- The other name.- Returns:
- Whether the two names are equal.
-
compareTo
public int compareTo(DatabaseName other)
Compares this name with the other database name for order.- Specified by:
compareToin interfacejava.lang.Comparable<DatabaseName>- 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:
hashCodein classjava.lang.Object
-
-