Package com.tableau.hyperapi
Class Name
- java.lang.Object
-
- com.tableau.hyperapi.Name
-
-
Constructor Summary
Constructors Constructor Description Name(java.lang.String unescapedName)
Constructs a properly escaped SQL name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Name other)
Compares this name with the specified name for order.boolean
equals(java.lang.Object that)
Checks two names for equality.java.lang.String
getUnescaped()
Returns the original unescaped name.int
hashCode()
Computes a hash code.java.lang.String
toString()
Gets a correctly escaped string representation of this name, which can be used in a SQL query to refer to the named entity.
-
-
-
Method Detail
-
toString
public java.lang.String toString()
Gets a correctly escaped string representation of this name, which can be used in a SQL query to refer to the named entity.- Overrides:
toString
in classjava.lang.Object
- Returns:
- The escaped name.
-
getUnescaped
public java.lang.String getUnescaped()
Returns the original unescaped name.Don't use the result of this method in SQL, as it is prone to SQL injection. The method should be used for use-cases where the original name is more readable (e.g., logging).
- Returns:
- The original unescaped name; or empty if the name was created with `createUnescaped`.
-
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(Name other)
Compares this name with the specified name for order.- Specified by:
compareTo
in interfacejava.lang.Comparable<Name>
- 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
-
-