public class IndexConfig extends Object implements IdentifiedDataSerializable, com.hazelcast.nio.serialization.impl.Versioned
Index could be created on one or more attributes.
IndexType,
MapConfig.setIndexConfigs(List)| Modifier and Type | Field and Description |
|---|---|
static IndexType |
DEFAULT_TYPE
Default index type.
|
| Constructor and Description |
|---|
IndexConfig() |
IndexConfig(IndexConfig other) |
IndexConfig(IndexType type)
Creates an index configuration of the given type.
|
IndexConfig(IndexType type,
String... attributes)
Creates an index configuration of the given type with provided attributes.
|
| Modifier and Type | Method and Description |
|---|---|
IndexConfig |
addAttribute(String attribute)
Adds an index attribute with the given.
|
void |
addAttributeInternal(String attribute) |
boolean |
equals(Object o) |
List<String> |
getAttributes()
Gets index attributes.
|
BitmapIndexOptions |
getBitmapIndexOptions()
Provides access to index options specific to bitmap indexes.
|
BTreeIndexConfig |
getBTreeIndexConfig()
Provides access to index options specific to B-Tree indexes.
|
int |
getClassId()
Returns type identifier for this class.
|
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
String |
getName()
Gets name of the index.
|
IndexType |
getType()
Gets type of the index.
|
int |
hashCode() |
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
IndexConfig |
setAttributes(List<String> attributes)
Sets index attributes.
|
IndexConfig |
setBitmapIndexOptions(BitmapIndexOptions bitmapIndexOptions)
Sets bitmap index options of this index config to the given ones.
|
IndexConfig |
setBTreeIndexConfig(BTreeIndexConfig bTreeIndexConfig)
Sets B-Tree config of this index to the specified configuration.
|
IndexConfig |
setName(String name)
Sets name of the index.
|
IndexConfig |
setType(IndexType type)
Sets type of the index.
|
String |
toString() |
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
public static final IndexType DEFAULT_TYPE
public IndexConfig()
public IndexConfig(IndexType type)
type - Index type.public IndexConfig(IndexType type, String... attributes)
type - Index type.attributes - Attributes to be indexed.public IndexConfig(IndexConfig other)
public String getName()
null if index name should be generated automatically.public IndexConfig setName(String name)
name - Name of the index or null if index name should be generated automatically.public IndexType getType()
Defaults to IndexType.SORTED.
public IndexConfig setType(IndexType type)
Defaults to IndexType.SORTED.
type - Type of the index.public IndexConfig addAttribute(String attribute)
attribute - Attribute name.public void addAttributeInternal(String attribute)
public IndexConfig setAttributes(List<String> attributes)
attributes - Index attributes.public BitmapIndexOptions getBitmapIndexOptions()
public IndexConfig setBitmapIndexOptions(BitmapIndexOptions bitmapIndexOptions)
bitmapIndexOptions - the bitmap index options to set.public BTreeIndexConfig getBTreeIndexConfig()
public IndexConfig setBTreeIndexConfig(BTreeIndexConfig bTreeIndexConfig)
bTreeIndexConfig - new b-tree index configuration to set.public int getFactoryId()
IdentifiedDataSerializablegetFactoryId in interface IdentifiedDataSerializablepublic int getClassId()
IdentifiedDataSerializablegetClassId in interface IdentifiedDataSerializablepublic void writeData(ObjectDataOutput out) throws IOException
DataSerializablewriteData in interface DataSerializableout - outputIOException - if an I/O error occurs. In particular,
an IOException may be thrown if the
output stream has been closed.public void readData(ObjectDataInput in) throws IOException
DataSerializablereadData in interface DataSerializablein - inputIOException - if an I/O error occurs. In particular,
an IOException may be thrown if the
input stream has been closed.Copyright © 2022 Hazelcast, Inc.. All rights reserved.