public class IndexConfig extends Object implements IdentifiedDataSerializable
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.
|
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 |
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 int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
public int getClassId()
IdentifiedDataSerializable
getClassId
in interface IdentifiedDataSerializable
public void writeData(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
out
- 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
DataSerializable
readData
in interface DataSerializable
in
- inputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
input stream has been closed.Copyright © 2019 Hazelcast, Inc.. All rights reserved.