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 intcompareTo(Name other)Compares this name with the specified name for order.booleanequals(java.lang.Object that)Checks two names for equality.java.lang.StringgetUnescaped()Returns the original unescaped name.inthashCode()Computes a hash code.java.lang.StringtoString()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:
toStringin 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:
equalsin 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:
compareToin 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:
hashCodein classjava.lang.Object
-
-