Package org.axonframework.modelling.saga
Interface AssociationValues
- All Superinterfaces:
Iterable<AssociationValue>
- All Known Implementing Classes:
AssociationValuesImpl
Interface describing a container of
Association Values for a single Saga instance.
This container tracks changes made to its contents between commits (see commit()).- Since:
- 0.7
- Author:
- Allard Buijze
-
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(AssociationValue associationValue) Adds the givenassociationValue, if it has not been previously added.Returns the Set of association values that have been added since the lastcommit().asSet()Returns this instance as a Set of Association Values.voidcommit()Resets the tracked changes.booleancontains(AssociationValue associationValue) Indicates whether this instance contains the givenassociationValue.booleanremove(AssociationValue associationValue) Removes the givenassociationValue, if it is contained by this instance.Returns the Set of association values that have been removed since the lastcommit().intsize()Returns the number of AssociationValue instances available in this containerMethods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
removedAssociations
Set<AssociationValue> removedAssociations()Returns the Set of association values that have been removed since the lastcommit(). If an association was added and then removed (or vice versa), without any calls tocommit()in between, it is not returned.- Returns:
- the Set of association values removed since the last
commit().
-
addedAssociations
Set<AssociationValue> addedAssociations()Returns the Set of association values that have been added since the lastcommit(). If an association was added and then removed (or vice versa), without any calls tocommit()in between, it is not returned.- Returns:
- the Set of association values added since the last
commit().
-
commit
void commit()Resets the tracked changes. -
size
int size()Returns the number of AssociationValue instances available in this container- Returns:
- the number of AssociationValue instances available
-
contains
Indicates whether this instance contains the givenassociationValue.- Parameters:
associationValue- the association value to verify- Returns:
trueif the association value is available in this instance, otherwisefalse
-
add
Adds the givenassociationValue, if it has not been previously added. When added (method returnstrue), the givenassociationValuewill be returned on the next call toaddedAssociations(), unless it has been removed after the last call toremovedAssociations().- Parameters:
associationValue- The association value to add- Returns:
trueif the value was added,falseif it was already contained in this instance
-
remove
Removes the givenassociationValue, if it is contained by this instance. When removed (method returnstrue), the givenassociationValuewill be returned on the next call toremovedAssociations(), unless it has been added after the last call toaddedAssociations().- Parameters:
associationValue- The association value to remove- Returns:
trueif the value was removed,falseif it was not contained in this instance
-
asSet
Set<AssociationValue> asSet()Returns this instance as a Set of Association Values. The returned set is a read-only view on this container. Any changes made to the container after this invocation may be reflected in the returned Set.- Returns:
- a read only view on the contents of this container
-