Interface Uniquifier<T>

Type Parameters:
T - the type of object being validated
All Known Implementing Classes:
DefaultUniquifier

public interface Uniquifier<T>
Converts values into some other object that has the desired uniqueness.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    getUniqued(T value)
    Get an object representing the unique value of the given instance.
  • Method Details

    • getUniqued

      Object getUniqued(T value)
      Get an object representing the unique value of the given instance. In other words, if and only two values are "the same", this method should return object(s) that match (according to equals() and Object.hashCode()).

      This method may return a value of null to indicate that value does not in fact need to be unique.

      Parameters:
      value - the value to be uniquified
      Returns:
      unique representative, or null to except value from the uniqueness requirement
      Throws:
      ClassCastException - if value is not of a supported type