Package com.tableau.hyperapi

# Class DatabaseName

java.lang.Object
com.tableau.hyperapi.DatabaseName

All Implemented Interfaces:
  `Comparable<DatabaseName>`

public final class DatabaseName extends Object implements Comparable<DatabaseName>
A database name.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static Comparator<DatabaseName>`
  `nullSafeDatabaseNameComparator`
  The null safe comparator

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DatabaseName(Name databaseName)`
  Constructs a Database name from already properly escaped SQL Name
  `DatabaseName(String databaseName)`
  Constructs a properly escaped Database Name.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `compareTo(DatabaseName other)`
  Compares this name with the other database name for order.
  `boolean`
  `equals(Object that)`
  Checks two names for equality.
  `Name`
  `getName()`
  Gets the database name
  `int`
  `hashCode()`
  Computes a hash code.
  `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

  ### Methods inherited from class java.lang.Object

  `getClass, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### nullSafeDatabaseNameComparator

    public static Comparator<DatabaseName> nullSafeDatabaseNameComparator
    The null safe comparator

- ## Constructor Details

  - ### DatabaseName

    public DatabaseName(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 Details

  - ### toString

    public 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:
      `toString` in class `Object`
    Returns:
      The escaped database name.

  - ### getName

    public Name getName()
    Gets the database name
    Returns:
      The name

  - ### equals

    public boolean equals(Object that)
    Checks two names for equality.
    Overrides:
      `equals` in class `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:
      `compareTo` in interface `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:
      `hashCode` in class `Object`