public final class DatabaseName extends java.lang.Object implements java.lang.Comparable<DatabaseName>
Modifier and Type | Field and Description |
---|---|
static java.util.Comparator<DatabaseName> |
nullSafeDatabaseNameComparator
The null safe comparator
|
Constructor and Description |
---|
DatabaseName(Name databaseName)
Constructs a Database name from already properly escaped SQL Name
|
DatabaseName(java.lang.String databaseName)
Constructs a properly escaped Database Name.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(DatabaseName other)
Compares this name with the other database name for order.
|
boolean |
equals(java.lang.Object that)
Checks two names for equality.
|
Name |
getName()
Gets the database name
|
int |
hashCode()
Computes a hash code.
|
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
|
public static java.util.Comparator<DatabaseName> nullSafeDatabaseNameComparator
public DatabaseName(java.lang.String databaseName)
The name will be equivalent to calling Sql::escapeName().
databaseName
- An unescaped database name.public DatabaseName(Name databaseName)
databaseName
- The database namepublic java.lang.String toString()
toString
in class java.lang.Object
public Name getName()
public boolean equals(java.lang.Object that)
equals
in class java.lang.Object
that
- The other name.public int compareTo(DatabaseName other)
compareTo
in interface java.lang.Comparable<DatabaseName>
other
- The other name.public int hashCode()
hashCode
in class java.lang.Object