java.lang.Object
org.springframework.data.cassandra.core.cql.CqlIdentifier
All Implemented Interfaces:
Serializable, Comparable<CqlIdentifier>

@Deprecated(forRemoval=true) public final class CqlIdentifier extends Object implements Comparable<CqlIdentifier>, Serializable
Deprecated, for removal: This API element is subject to removal in a future version.
since 3.0, use CqlIdentifier instead.
This encapsulates the logic for CQL quoted and unquoted identifiers.

CQL identifiers, when unquoted, are converted to lower case. When quoted, they are returned as-is with no lower casing and encased in double quotes. To render, use any of the methods toCql(), toCql(StringBuilder), or toString().

Author:
John McPeek, Matthew T. Adams, Mark Paluch, John Blum
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Pattern
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    static final String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    static final Pattern
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    static final String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Unquoted identifiers sort before quoted ones.
    cqlId(CharSequence identifier)
    Deprecated, for removal: This API element is subject to removal in a future version.
    since 2.0, use of(CharSequence)
    cqlId(CharSequence identifier, boolean forceQuote)
    Deprecated, for removal: This API element is subject to removal in a future version.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Compares this CqlIdentifier to the given object.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the identifier without encasing quotes, regardless of the value of isQuoted().
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Whether or not this identifier is quoted.
    static boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns true if the given CharSequence is an identifier with quotes.
    static boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns true if the given CharSequence is a legal unquoted identifier.
    of(CharSequence identifier)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Factory method for CqlIdentifier.
    of(CharSequence identifier, boolean forceQuote)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Factory method for CqlIdentifier.
    quoted(CharSequence identifier)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Factory method for a force-quoted CqlIdentifier.
    Deprecated, for removal: This API element is subject to removal in a future version.
    since 2.0, use quoted(CharSequence).
    static boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns true if the given CharSequence requires quoting.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Renders this identifier appropriately.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Appends the rendering of this identifier to the given StringBuilder, then returns that StringBuilder.
    com.datastax.oss.driver.api.core.CqlIdentifier
    Deprecated, for removal: This API element is subject to removal in a future version.
    Create a Cassandra driver CqlIdentifier from this CqlIdentifier.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Alias for toCql().

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • UNQUOTED_REGEX

      public static final String UNQUOTED_REGEX
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • UNQUOTED

      public static final Pattern UNQUOTED
      Deprecated, for removal: This API element is subject to removal in a future version.
    • QUOTED_REGEX

      public static final String QUOTED_REGEX
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • QUOTED

      public static final Pattern QUOTED
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • cqlId

      @Deprecated(forRemoval=true) public static CqlIdentifier cqlId(CharSequence identifier)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 2.0, use of(CharSequence)
      Factory method for CqlIdentifier. Convenient if imported statically.
      See Also:
      • CqlIdentifier(CharSequence)
    • cqlId

      @Deprecated(forRemoval=true) public static CqlIdentifier cqlId(CharSequence identifier, boolean forceQuote)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Factory method for CqlIdentifier. Convenient if imported statically.
      See Also:
      • CqlIdentifier(CharSequence, boolean)
    • of

      public static CqlIdentifier of(CharSequence identifier)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Factory method for CqlIdentifier.
      Since:
      2.0
    • of

      public static CqlIdentifier of(CharSequence identifier, boolean forceQuote)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Factory method for CqlIdentifier.
      Since:
      2.0
    • quotedCqlId

      @Deprecated(forRemoval=true) public static CqlIdentifier quotedCqlId(CharSequence identifier)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 2.0, use quoted(CharSequence).
      Factory method for a force-quoted CqlIdentifier. Convenient if imported statically.
      See Also:
      • CqlIdentifier(CharSequence, boolean)
    • quoted

      public static CqlIdentifier quoted(CharSequence identifier)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Factory method for a force-quoted CqlIdentifier.
      Since:
      2.0.
    • isUnquotedIdentifier

      public static boolean isUnquotedIdentifier(CharSequence chars)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns true if the given CharSequence is a legal unquoted identifier.
    • isQuotedIdentifier

      public static boolean isQuotedIdentifier(CharSequence chars)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns true if the given CharSequence is an identifier with quotes.
    • requiresQuoting

      public static boolean requiresQuoting(CharSequence chars)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns true if the given CharSequence requires quoting.
      Since:
      2.2
    • getUnquoted

      public String getUnquoted()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the identifier without encasing quotes, regardless of the value of isQuoted(). For example, if isQuoted() is true, then this value will be the same as toCql() and toString().

      This is needed, for example, to get the correct TableMetadata from KeyspaceMetadata.getTable(String): the given string must not be quoted.

    • toCql

      public String toCql()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Renders this identifier appropriately.
    • toCql

      public StringBuilder toCql(StringBuilder builder)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Appends the rendering of this identifier to the given StringBuilder, then returns that StringBuilder. If null is given, a new StringBuilder is created, appended to, and returned.
    • isQuoted

      public boolean isQuoted()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Whether or not this identifier is quoted.
    • compareTo

      public int compareTo(CqlIdentifier identifier)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Unquoted identifiers sort before quoted ones. Otherwise, they compare according to their identifiers.
      Specified by:
      compareTo in interface Comparable<CqlIdentifier>
    • equals

      public boolean equals(@Nullable Object o)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Compares this CqlIdentifier to the given object. Note that if a CharSequence is given, a new CqlIdentifier is created from it and compared, such that a CharSequence can be effectively equal to a CqlIdentifier.
      Overrides:
      equals in class Object
      See Also:
    • hashCode

      public int hashCode()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Alias for toCql().
      Overrides:
      toString in class Object
    • toCqlIdentifier

      public com.datastax.oss.driver.api.core.CqlIdentifier toCqlIdentifier()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a Cassandra driver CqlIdentifier from this CqlIdentifier.
      Returns:
      the CqlIdentifier from this CqlIdentifier.
      Since:
      3.0