Package org.apache.cassandra.cql3
Class ColumnIdentifier
java.lang.Object
org.apache.cassandra.cql3.ColumnIdentifier
- All Implemented Interfaces:
Comparable<ColumnIdentifier>,IMeasurableMemory
public class ColumnIdentifier
extends Object
implements IMeasurableMemory, 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
FieldsModifier and TypeFieldDescriptionfinal ByteBufferfinal longsince 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
ConstructorsConstructorDescriptionColumnIdentifier(String rawText, boolean keepCase) ColumnIdentifier(ByteBuffer bytes, String text) ColumnIdentifier(ByteBuffer bytes, AbstractType<?> type) -
Method Summary
Modifier and TypeMethodDescriptionclone(ByteBufferCloner cloner) intcompareTo(ColumnIdentifier that) final booleanstatic ColumnIdentifiergetInterned(String rawText, boolean keepCase) static ColumnIdentifiergetInterned(ByteBuffer bytes, AbstractType<?> type) static ColumnIdentifiergetInterned(AbstractType<?> type, ByteBuffer bytes, String text) final inthashCode()booleanstatic StringmaybeQuote(String text) Returns a string representation of the identifier that is safe to use directly in CQL queries.toString()longlong
-
Field Details
-
bytes
-
prefixComparison
public final long prefixComparisonsince 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 Details
-
ColumnIdentifier
-
ColumnIdentifier
-
ColumnIdentifier
-
-
Method Details
-
getInterned
-
getInterned
-
getInterned
-
isInterned
public boolean isInterned() -
hashCode
public final int hashCode() -
equals
-
toString
-
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. -
clone
-
compareTo
- Specified by:
compareToin interfaceComparable<ColumnIdentifier>
-
maybeQuote
-