Package org.apache.ignite.configuration
Interface NamedListChange<VIEWT,CHANGET extends VIEWT>
- Type Parameters:
VIEWT- Type for the reading named list elements of this particular list.CHANGET- Type for changing named list elements of this particular list.
- All Superinterfaces:
Iterable<VIEWT>,NamedListView<VIEWT>
Closure parameter for
ConfigurationTree.change(Consumer) method. Contains methods to modify named lists.-
Method Summary
Modifier and TypeMethodDescriptionCreates a new value at the given position in the named list configuration.Creates a new value in the named list configuration.createAfter(String precedingKey, String key, Consumer<CHANGET> valConsumer) Create a new value after a given precedingKey key in the named list configuration.createOrUpdate(String key, Consumer<CHANGET> valConsumer) Updates a value in the named list configuration.Removes the value from the named list configuration.Renames the existing value in the named list configuration.Updates a value in the named list configuration.Methods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.apache.ignite.configuration.NamedListView
get, get, get, isEmpty, iterator, namedListKeys, size, stream
-
Method Details
-
create
Creates a new value in the named list configuration.- Parameters:
key- Key for the value to be created.valConsumer- Closure to modify the value associated with the key. Closure parameter must not be leaked outside the scope of the closure.- Returns:
thisfor chaining.- Throws:
NullPointerException- If one of the parameters is null.IllegalArgumentException- If an element with the given name already exists.
-
create
Creates a new value at the given position in the named list configuration.- Parameters:
index- Index of the inserted element.key- Key for the value to be created.valConsumer- Closure to modify the value associated with the key. Closure parameter must not be leaked outside the scope of the closure.- Returns:
thisfor chaining.- Throws:
NullPointerException- If one of the parameters is null.IndexOutOfBoundsException- If index is negative of exceeds the size of the list.IllegalArgumentException- If an element with the given name already exists.
-
createAfter
NamedListChange<VIEWT,CHANGET> createAfter(String precedingKey, String key, Consumer<CHANGET> valConsumer) Create a new value after a given precedingKey key in the named list configuration.- Parameters:
precedingKey- Name of the preceding element.key- Key for the value to be created.valConsumer- Closure to modify the value associated with the key. Closure parameter must not be leaked outside the scope of the closure.- Returns:
thisfor chaining.- Throws:
NullPointerException- If one of parameters is null.IllegalArgumentException- If element with given name already exists or ifprecedingKeyelement doesn't exist.
-
createOrUpdate
Updates a value in the named list configuration. If the value cannot be found, creates a new one instead.- Parameters:
key- Key for the value to be updated.valConsumer- Closure to modify the value associated with the key. Closure parameter must not be leaked outside the scope of the closure.- Returns:
thisfor chaining.- Throws:
NullPointerException- If one of parameters is null.IllegalArgumentException- Ifdelete(String)has been invoked with the same key previously.
-
update
Updates a value in the named list configuration.- Parameters:
key- Key for the value to be updated.valConsumer- Closure to modify the value associated with the key. Closure parameter must not be leaked outside the scope of the closure.- Returns:
thisfor chaining.- Throws:
NullPointerException- If one of parameters is null.IllegalArgumentException- If the given key does not exist or ifdelete(String)has been invoked with the same key previously.
-
rename
Renames the existing value in the named list configuration. Does nothing ifoldKeyandnewKeyare the same. Element with keyoldKeymust exist and keynewKeymust not. Error will occur ifnewKeyhas just been deleted on the sameNamedListChangeinstance (to distinguish betweenConfigurationNamedListListener.onRename(ConfigurationNotificationEvent)andConfigurationNamedListListener.onUpdate(ConfigurationNotificationEvent)onnewKey).- Parameters:
oldKey- Key for the value to be updated.newKey- New key for the same value.- Returns:
thisfor chaining.- Throws:
NullPointerException- If one of parameters is null.IllegalArgumentException- If an element with namenewKeyalready exists, or an element with nameoldKeydoesn't exist, ordelete(String)has previously been invoked with either thenewKeyor theoldKey.
-
delete
Removes the value from the named list configuration.- Parameters:
key- Key for the value to be removed.- Returns:
thisfor chaining.- Throws:
NullPointerException- If key is null.IllegalArgumentException- IfcreateOrUpdate(String, Consumer)has been invoked with the same key previously.
-