Interface Associator

All Known Implementing Classes:
DefaultKeyAssociator, NaturalAssociator

public interface Associator
The Associator interface facilitates the creation of a very generic equivalence relation between different objects and allows to group them based on the equality of the "association key" object returned by the getAssociatedKey(java.lang.Object) method.
Author:
gg 2012.03.11
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Determine the host key (or base) object to which the specified object is associated.
  • Method Details

    • getAssociatedKey

      Object getAssociatedKey(Object o)
      Determine the host key (or base) object to which the specified object is associated.

      Note: It's expected that the returned object is suitable to be used as an immutable identity (e.g. a key in a Map).
      Note 2: Circular associations are not permitted.

      Parameters:
      o - the object to obtain an association for
      Returns:
      the host key that for this object, or null if this object has no association