T
- the type of nodes involved in this update operationpublic class NodeUpdateData<T> extends Object
A simple data class used by node models to store parameters of an update operation.
The Configuration
interface provides a method for setting the value
of a given key. The passed in value can be a single object or a collection of
values. This makes an update operation rather complicated because a
collection of query results selected by the passed in key has to be matched
to another collection of values - and both collections can have different
sizes. Therefore, an update operation may involve changing of existing nodes,
adding new nodes (if there are more values than currently existing nodes),
and removing nodes (if there are more existing nodes than provided values).
This class collects all this information making it possible to actually
perform the update based on a passed in instance.
Constructor and Description |
---|
NodeUpdateData(Map<QueryResult<T>,Object> changedValues,
Collection<Object> newValues,
Collection<QueryResult<T>> removedNodes,
String key)
Creates a new instance of
NodeUpdateData and initializes all its
properties. |
Modifier and Type | Method and Description |
---|---|
Map<QueryResult<T>,Object> |
getChangedValues()
Returns an unmodifiable map with the values to be changed.
|
String |
getKey()
Returns the key for this update operation.
|
Collection<Object> |
getNewValues()
Returns a collection with the values to be newly added.
|
Collection<QueryResult<T>> |
getRemovedNodes()
Adds a collection with the nodes to be removed.
|
public NodeUpdateData(Map<QueryResult<T>,Object> changedValues, Collection<Object> newValues, Collection<QueryResult<T>> removedNodes, String key)
NodeUpdateData
and initializes all its
properties. All passed in collections are optional and can be
null.changedValues
- the map defining the changed valuesnewValues
- the collection with the new valuesremovedNodes
- the collection with the nodes to be removedkey
- the key of the update operationpublic Map<QueryResult<T>,Object> getChangedValues()
public Collection<Object> getNewValues()
public Collection<QueryResult<T>> getRemovedNodes()
public String getKey()
Copyright © 2001–2020 The Apache Software Foundation. All rights reserved.