public class MapIndexConfig extends Object implements IdentifiedDataSerializable
MapConfig
. The reason to create an map index is to speed up searches for
particular map entries.Constructor and Description |
---|
MapIndexConfig()
Creates a MapIndexConfig without an attribute and with ordered set to
false . |
MapIndexConfig(MapIndexConfig config) |
MapIndexConfig(String attribute,
boolean ordered)
Creates a MapIndexConfig with the given attribute and ordered setting.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
MapIndexConfigReadOnly |
getAsReadOnly()
Deprecated.
this method will be removed in 4.0; it is meant for internal usage only
|
String |
getAttribute()
Gets the attribute that is going to be indexed.
|
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
int |
getId()
Returns type identifier for this class.
|
int |
hashCode() |
boolean |
isOrdered()
Checks if the index should be ordered.
|
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
MapIndexConfig |
setAttribute(String attribute)
Sets the attribute that is going to be indexed.
|
MapIndexConfig |
setOrdered(boolean ordered)
Configures the index to be ordered or not ordered.
|
String |
toString() |
static String |
validateIndexAttribute(String attribute)
Validates index attribute content.
|
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
public MapIndexConfig()
false
.public MapIndexConfig(String attribute, boolean ordered)
attribute
- the attribute that is going to be indexedordered
- true
if the index is ordered, false
otherwisesetOrdered(boolean)
,
setAttribute(String)
public MapIndexConfig(MapIndexConfig config)
public MapIndexConfigReadOnly getAsReadOnly()
public String getAttribute()
null
is returned.setAttribute(String)
public MapIndexConfig setAttribute(String attribute)
attribute
- the attribute that is going to be indexedIllegalArgumentException
- if attribute is null or an empty stringpublic boolean isOrdered()
true
if ordered, false
otherwisesetOrdered(boolean)
public MapIndexConfig setOrdered(boolean ordered)
ordered
- if the index should be an ordered indexpublic static String validateIndexAttribute(String attribute)
attribute
- attribute to validatepublic int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
public int getId()
IdentifiedDataSerializable
getId
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 © 2020 Hazelcast, Inc.. All Rights Reserved.