Package org.axonframework.modelling.saga
Class AssociationValue
java.lang.Object
org.axonframework.modelling.saga.AssociationValue
- All Implemented Interfaces:
Serializable
A combination of key and value by which a Saga can be found. Sagas are triggered by events that have a property that
the saga is associated with. A single Association Value can lead to multiple Sagas, and a single Saga can be
associated with multiple Association Values.
Two association values are considered equal when both their key and value are equal. For example, a Saga managing
Orders could have a AssociationValue with key "orderId" and the order identifier as value.
- Since:
- 0.7
- Author:
- Allard Buijze
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAssociationValue(String key, String value) Creates a Association Value instance with the givenkeyandvalue. -
Method Summary
-
Constructor Details
-
AssociationValue
Creates a Association Value instance with the givenkeyandvalue.- Parameters:
key- The key of the Association Value. Usually indicates where the value comes from.value- The value corresponding to the key of the association. It is highly recommended to only use serializable values.
-
-
Method Details
-
getKey
Returns the key of this association value. The key usually indicates where the property's value comes from.- Returns:
- the key of this association value
-
getValue
Returns the value of this association.- Returns:
- the value of this association. Never
null.
-
equals
-
hashCode
public int hashCode()
-