Class AssociationValue

java.lang.Object
org.axonframework.modelling.saga.AssociationValue
All Implemented Interfaces:
Serializable

public class AssociationValue extends Object implements 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 Details

    • AssociationValue

      public AssociationValue(String key, String value)
      Creates a Association Value instance with the given key and value.
      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

      public String 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

      public String getValue()
      Returns the value of this association.
      Returns:
      the value of this association. Never null.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object