org.axonframework.saga
Interface AssociationValues

All Superinterfaces:
Iterable<AssociationValue>
All Known Implementing Classes:
AssociationValuesImpl

public interface AssociationValues
extends Iterable<AssociationValue>

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
 boolean add(AssociationValue associationValue)
          Adds the given associationValue, if it has not been previously added.
 Set<AssociationValue> addedAssociations()
          Returns the Set of association values that have been added since the last commit().
 Set<AssociationValue> asSet()
          Returns this instance as a Set of Association Values.
 void commit()
          Resets the tracked changes.
 boolean contains(AssociationValue associationValue)
          Indicates whether this instance contains the given associationValue.
 boolean remove(AssociationValue associationValue)
          Removes the given associationValue, if it is contained by this instance.
 Set<AssociationValue> removedAssociations()
          Returns the Set of association values that have been removed since the last commit().
 int size()
          Returns the number of AssociationValue instances available in this container
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

removedAssociations

Set<AssociationValue> removedAssociations()
Returns the Set of association values that have been removed since the last commit().

If an association was added and then removed (or vice versa), without any calls to commit() 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 last commit().

If an association was added and then removed (or vice versa), without any calls to commit() 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

boolean contains(AssociationValue associationValue)
Indicates whether this instance contains the given associationValue.

Parameters:
associationValue - the association value to verify
Returns:
true if the association value is available in this instance, otherwise false

add

boolean add(AssociationValue associationValue)
Adds the given associationValue, if it has not been previously added.

When added (method returns true), the given associationValue will be returned on the next call to addedAssociations(), unless it has been removed after the last call to removedAssociations().

Parameters:
associationValue - The association value to add
Returns:
true if the value was added, false if it was already contained in this instance

remove

boolean remove(AssociationValue associationValue)
Removes the given associationValue, if it is contained by this instance.

When removed (method returns true), the given associationValue will be returned on the next call to removedAssociations(), unless it has been added after the last call to addedAssociations().

Parameters:
associationValue - The association value to remove
Returns:
true if the value was removed, false if 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


Copyright © 2010-2016. All Rights Reserved.