com.hazelcast.config
Class MapIndexConfig

java.lang.Object
  extended by com.hazelcast.config.MapIndexConfig
Direct Known Subclasses:
MapIndexConfigReadOnly

public class MapIndexConfig
extends Object

Contains the configuration for an index in a map. This class should be used in combination with the MapConfig. THe reason to create an map index, is to speed up searches for particular map entries.


Constructor Summary
MapIndexConfig()
          Creates a MapIndexConfig without an attribute and with ordered is false.
MapIndexConfig(MapIndexConfig config)
           
MapIndexConfig(String attribute, boolean ordered)
          Creates a MapIndexConfig with the given attribute and ordered setting.
 
Method Summary
 MapIndexConfigReadOnly getAsReadOnly()
           
 String getAttribute()
          Gets the attribute that is going to be indexed.
 boolean isOrdered()
          Checks if the index should be ordered.
 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MapIndexConfig

public MapIndexConfig()
Creates a MapIndexConfig without an attribute and with ordered is false.


MapIndexConfig

public MapIndexConfig(String attribute,
                      boolean ordered)
Creates a MapIndexConfig with the given attribute and ordered setting.

Parameters:
attribute - the attribute that is going to be indexed.
ordered - if the index is ordered.
See Also:
setOrdered(boolean), setAttribute(String)

MapIndexConfig

public MapIndexConfig(MapIndexConfig config)
Method Detail

getAsReadOnly

public MapIndexConfigReadOnly getAsReadOnly()

getAttribute

public String getAttribute()
Gets the attribute that is going to be indexed. If no attribute is set, null is returned.

Returns:
the attribute to be indexed.
See Also:
setAttribute(String)

setAttribute

public MapIndexConfig setAttribute(String attribute)
Sets the attribute that is going to be indexed.

Parameters:
attribute - the attribute that is going to be indexed.
Returns:
the updated MapIndexConfig.
Throws:
IllegalArgumentException - if attribute is null or an empty string.

isOrdered

public boolean isOrdered()
Checks if the index should be ordered.

Returns:
true if ordered, false otherwise.
See Also:
setOrdered(boolean)

setOrdered

public MapIndexConfig setOrdered(boolean ordered)
Configures the index to be ordered or not ordered. Some indices can be ordered, e.g. age. Sometimes you want to look for all people with an age equal or greater than X. In other cases an ordered index doesn't make sense, e.g. a phone number of a person.

Parameters:
ordered - if the index should be an ordered index.
Returns:
the updated MapIndexConfig.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.