public class IndexMetadata extends Object
Modifier and Type | Class and Description |
---|---|
static class |
IndexMetadata.IndexType |
static class |
IndexMetadata.TargetType |
Modifier and Type | Field and Description |
---|---|
static String |
CUSTOM_INDEX_OPTION_NAME |
static String |
INDEX_ENTRIES_OPTION_NAME
The name of the option used to specify that the index is on the collection (map) entries.
|
static String |
INDEX_KEYS_OPTION_NAME
The name of the option used to specify that the index is on the collection keys.
|
static com.google.common.base.Function<IndexMetadata,String> |
INDEX_NAME |
static String |
INDEX_VALUES_OPTION_NAME
The name of the option used to specify that the index is on the collection values.
|
Modifier and Type | Method and Description |
---|---|
String |
asCQLQuery()
Returns a CQL query representing this index.
|
boolean |
equals(Object obj) |
ColumnMetadata |
getColumn(String name)
Returns metadata on a column of this index.
|
List<ColumnMetadata> |
getColumns()
Returns a list containing all the columns of this index.
|
String |
getIndexClassName()
The name of the class used to implement the custom index, if it is one.
|
IndexMetadata.IndexType |
getIndexType()
Returns the index type.
|
String |
getName()
Returns the index name.
|
String |
getOption(String name)
Return the value for the given option name.
|
TableMetadata |
getTable()
Returns the metadata of the table this column is part of.
|
IndexMetadata.TargetType |
getTargetType()
Returns the index target type.
|
int |
hashCode() |
boolean |
isCustomIndex()
Returns whether this index is a custom one.
|
boolean |
isEntries()
Return whether this index is a 'ENTRIES' index on a map, e.g.,
CREATE INDEX ON mytable (ENTRIES(mymap))
|
boolean |
isFull()
Return whether this index is a 'FULL' index on a frozen collection, e.g.,
CREATE INDEX ON mytable (FULL(mymap))
|
boolean |
isKeys()
Return whether this index is a 'KEYS' index on a map, e.g.,
CREATE INDEX ON mytable (KEYS(mymap))
|
boolean |
isValues()
Return whether this index is a 'VALUES' index on a map, e.g.,
CREATE INDEX ON mytable (VALUES(mymap))
|
public static final com.google.common.base.Function<IndexMetadata,String> INDEX_NAME
public static final String CUSTOM_INDEX_OPTION_NAME
public static final String INDEX_KEYS_OPTION_NAME
public static final String INDEX_VALUES_OPTION_NAME
public static final String INDEX_ENTRIES_OPTION_NAME
public TableMetadata getTable()
TableMetadata
for the table this column is part of.public String getName()
public ColumnMetadata getColumn(String name)
name
- the name of the column to retrieve (name
will be
interpreted as a case-insensitive identifier unless enclosed in double-quotes,
see Metadata.quote(java.lang.String)
).null
otherwise.public List<ColumnMetadata> getColumns()
public IndexMetadata.IndexType getIndexType()
public IndexMetadata.TargetType getTargetType()
IndexMetadata.TargetType.COLUMN
.public boolean isCustomIndex()
If it is indeed a custom index, getIndexClassName()
will
return the name of the class used in Cassandra to implement that
index.
true
if this metadata represents a custom index.public String getIndexClassName()
isCustomIndex() == true
, null
otherwise.public boolean isKeys()
true
if this is a 'KEYS' index on a map.public boolean isValues()
true
if this is an 'VALUES' index on a map.public boolean isEntries()
true
if this is an 'ENTRIES' index on a map.public boolean isFull()
true
if this is a 'FULL' index on a frozen collection.public String getOption(String name)
name
- Option namepublic String asCQLQuery()
Copyright © 2012–2015. All rights reserved.