org.axonframework.saga.annotation
Class AssociationValuesImpl

java.lang.Object
  extended by org.axonframework.saga.annotation.AssociationValuesImpl
All Implemented Interfaces:
Serializable, Iterable<AssociationValue>, AssociationValues

public class AssociationValuesImpl
extends Object
implements AssociationValues, Serializable

Default implementation of the AssociationValues interface. This implementation is fully serializable.

Since:
0.7
Author:
Allard Buijze
See Also:
Serialized Form

Constructor Summary
AssociationValuesImpl()
           
 
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 AssociationValues.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.
 Iterator<AssociationValue> iterator()
           
 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 AssociationValues.commit().
 int size()
          Returns the number of AssociationValue instances available in this container
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssociationValuesImpl

public AssociationValuesImpl()
Method Detail

size

public int size()
Description copied from interface: AssociationValues
Returns the number of AssociationValue instances available in this container

Specified by:
size in interface AssociationValues
Returns:
the number of AssociationValue instances available

contains

public boolean contains(AssociationValue associationValue)
Description copied from interface: AssociationValues
Indicates whether this instance contains the given associationValue.

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

iterator

public Iterator<AssociationValue> iterator()
Specified by:
iterator in interface Iterable<AssociationValue>

add

public boolean add(AssociationValue associationValue)
Description copied from interface: AssociationValues
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 AssociationValues.addedAssociations(), unless it has been removed after the last call to AssociationValues.removedAssociations().

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

remove

public boolean remove(AssociationValue associationValue)
Description copied from interface: AssociationValues
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 AssociationValues.removedAssociations(), unless it has been added after the last call to AssociationValues.addedAssociations().

Specified by:
remove in interface AssociationValues
Parameters:
associationValue - The association value to remove
Returns:
true if the value was removed, false if it was not contained in this instance

asSet

public Set<AssociationValue> asSet()
Description copied from interface: AssociationValues
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.

Specified by:
asSet in interface AssociationValues
Returns:
a read only view on the contents of this container

removedAssociations

public Set<AssociationValue> removedAssociations()
Description copied from interface: AssociationValues
Returns the Set of association values that have been removed since the last AssociationValues.commit().

If an association was added and then removed (or vice versa), without any calls to AssociationValues.commit() in between, it is not returned.

Specified by:
removedAssociations in interface AssociationValues
Returns:
the Set of association values removed since the last AssociationValues.commit().

addedAssociations

public Set<AssociationValue> addedAssociations()
Description copied from interface: AssociationValues
Returns the Set of association values that have been added since the last AssociationValues.commit().

If an association was added and then removed (or vice versa), without any calls to AssociationValues.commit() in between, it is not returned.

Specified by:
addedAssociations in interface AssociationValues
Returns:
the Set of association values added since the last AssociationValues.commit().

commit

public void commit()
Description copied from interface: AssociationValues
Resets the tracked changes.

Specified by:
commit in interface AssociationValues


Copyright © 2010-2016. All Rights Reserved.