org.apache.cassandra.cql3

## Class ColumnIdentifier

- java.lang.Object
- - org.apache.cassandra.cql3.ColumnIdentifier

- All Implemented Interfaces:
    java.lang.Comparable<ColumnIdentifier>, IMeasurableMemory

      public class ColumnIdentifier
      extends java.lang.Object
      implements IMeasurableMemory, java.lang.Comparable<ColumnIdentifier>

  Represents an identifer for a CQL column definition. TODO : should support light-weight mode without text representation for when not interned

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `java.nio.ByteBuffer` | `bytes`
    `long` | `prefixComparison` since these objects are compared frequently, we stash an efficiently compared prefix of the bytes, in the expectation that the majority of comparisons can be answered by this value only

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ColumnIdentifier(java.nio.ByteBuffer bytes, AbstractType<?> type)`
    `ColumnIdentifier(java.lang.String rawText, boolean keepCase)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ColumnIdentifier` | `clone(AbstractAllocator allocator)`
    `int` | `compareTo(ColumnIdentifier that)`
    `boolean` | `equals(java.lang.Object o)`
    `static ColumnIdentifier` | `getInterned(AbstractType<?> type, java.nio.ByteBuffer bytes, java.lang.String text)`
    `static ColumnIdentifier` | `getInterned(java.nio.ByteBuffer bytes, AbstractType<?> type)`
    `static ColumnIdentifier` | `getInterned(java.lang.String rawText, boolean keepCase)`
    `int` | `hashCode()`
    `boolean` | `isInterned()`
    `static java.lang.String` | `maybeQuote(java.lang.String text)`
    `java.lang.String` | `toCQLString()` Returns a string representation of the identifier that is safe to use directly in CQL queries.
    `java.lang.String` | `toString()`
    `long` | `unsharedHeapSize()`
    `long` | `unsharedHeapSizeExcludingData()`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### bytes

          public final java.nio.ByteBuffer bytes

    - #### prefixComparison

          public final long prefixComparison

      since these objects are compared frequently, we stash an efficiently compared prefix of the bytes, in the expectation that the majority of comparisons can be answered by this value only

  - ### Constructor Detail

    - #### ColumnIdentifier

          public ColumnIdentifier(java.lang.String rawText,
                                  boolean keepCase)

    - #### ColumnIdentifier

          public ColumnIdentifier(java.nio.ByteBuffer bytes,
                                  AbstractType<?> type)

  - ### Method Detail

    - #### getInterned

          public static ColumnIdentifier getInterned(java.nio.ByteBuffer bytes,
                                                     AbstractType<?> type)

    - #### getInterned

          public static ColumnIdentifier getInterned(java.lang.String rawText,
                                                     boolean keepCase)

    - #### getInterned

          public static ColumnIdentifier getInterned(AbstractType<?> type,
                                                     java.nio.ByteBuffer bytes,
                                                     java.lang.String text)

    - #### isInterned

          public boolean isInterned()

    - #### hashCode

          public final int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### equals

          public final boolean equals(java.lang.Object o)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### toCQLString

          public java.lang.String toCQLString()

      Returns a string representation of the identifier that is safe to use directly in CQL queries. If necessary, the string will be double-quoted, and any quotes inside the string will be escaped.

    - #### unsharedHeapSize

          public long unsharedHeapSize()

      Specified by:
        `unsharedHeapSize` in interface `IMeasurableMemory`
      Returns:
        the amount of on-heap memory retained by the object that might be reclaimed if the object were reclaimed, i.e. it should try to exclude globally cached data where possible, or counting portions of arrays that are referenced by the object but used by other objects only (e.g. slabbed byte-buffers), etc.

    - #### unsharedHeapSizeExcludingData

          public long unsharedHeapSizeExcludingData()

    - #### clone

          public ColumnIdentifier clone(AbstractAllocator allocator)

    - #### compareTo

          public int compareTo(ColumnIdentifier that)

      Specified by:
        `compareTo` in interface `java.lang.Comparable<ColumnIdentifier>`

    - #### maybeQuote

          public static java.lang.String maybeQuote(java.lang.String text)

Copyright © 2018 The Apache Software Foundation