Class ColumnIdentifier

  • All Implemented Interfaces:
    Cloneable

    public class ColumnIdentifier
    extends Object
    implements Cloneable
    Represents Column Identifier
    Since:
    0.9.0
    • Constructor Detail

      • ColumnIdentifier

        public ColumnIdentifier​(String name)
        Creates a ColumnIdentifier object for the giving column name. Identifier Requirement can be found from https://docs.snowflake.com/en/sql-reference/identifiers-syntax.html
        Parameters:
        name - The column name
        Since:
        0.9.0
    • Method Detail

      • name

        public String name()
        Returns the name of column. Name format: 1. if the name quoted. a. starts with _A-Z and follows by _A-Z0-9$: remove quotes b. starts with $ and follows by digits: remove quotes c. otherwise, do nothing 2. if not quoted. a. starts with _a-zA-Z and follows by _a-zA-Z0-9$, upper case all letters. b. starts with $ and follows by digits, do nothing c. otherwise, quote name

        More details can be found from https://docs.snowflake.com/en/sql-reference/identifiers-syntax.html

        Returns:
        A String value representing the name
        Since:
        0.9.0
      • quotedName

        public String quotedName()
        Returns the quoted name of this column Name Format: 1. if quoted, do nothing 2. if not quoted. a. starts with _a-zA-Z and follows by _a-zA-Z0-9$, upper case all letters and then quote b. otherwise, quote name

        It is same as [[name]], but quotes always added. It is always safe to do String comparisons between quoted column names

        Returns:
        A String value representing the quoted name
        Since:
        0.9.0
      • equals

        public boolean equals​(Object other)
        Compares this ColumnIdentifier with the giving one
        Overrides:
        equals in class Object
        Returns:
        true if these two are equivalent, otherwise, returns false.
        Since:
        0.9.0
      • hashCode

        public int hashCode()
        Calculates the hash code of this ColumnIdentifier.
        Overrides:
        hashCode in class Object
        Returns:
        An int number representing the hash code value
        Since:
        0.9.0
      • toString

        public String toString()
        Generates a String value to represent this Column Identifier.
        Overrides:
        toString in class Object
        Returns:
        A String value
        Since:
        0.9.0
      • clone

        public ColumnIdentifier clone()
        Creates a clone of this ColumnIdentifier object.
        Overrides:
        clone in class Object
        Returns:
        A new ColumnIdentifier object
        Since:
        1.2.0