org.axonframework.saga
Class AssociationValue

java.lang.Object
  extended by org.axonframework.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:
Serialized Form

Constructor Summary
AssociationValue(String key, String value)
          Creates a Association Value instance with the given key and value.
 
Method Summary
 boolean equals(Object o)
           
 String getKey()
          Returns the key of this association value.
 String getValue()
          Returns the value of this association.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 Detail

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


Copyright © 2010-2016. All Rights Reserved.