Class ObjectPair

java.lang.Object
org.apache.sis.metadata.ObjectPair

final class ObjectPair extends Object
A pair of objects in process of being compared by the MetadataStandard.equals(…) method. We have to remember those pairs for avoiding infinite recursivity when comparing metadata objects having cyclic associations. The objects are compared using the identity comparison. Object order is not significant.
Since:
0.3
Version:
0.3
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) static final ThreadLocal<Set<ObjectPair>>
    The set of objects currently in process of being compared.
    private final Object
    The pair of objects in process of being compared.
    private final Object
    The pair of objects in process of being compared.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new pair of objects being compared.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(Object other)
    Compares the given object with this pair for equality.
    int
    Returns a hash code value for this pair of objects.
    Returns a string representation of the object pair for debugging purpose only.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • CURRENT

      static final ThreadLocal<Set<ObjectPair>> CURRENT
      The set of objects currently in process of being compared.
    • o1

      private final Object o1
      The pair of objects in process of being compared.
    • o2

      private final Object o2
      The pair of objects in process of being compared.
  • Constructor Details

    • ObjectPair

      ObjectPair(Object o1, Object o2)
      Creates a new pair of objects being compared.
  • Method Details

    • hashCode

      public int hashCode()
      Returns a hash code value for this pair of objects. The hash code value shall be insensitive to the objects order.
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object other)
      Compares the given object with this pair for equality. The comparison shall be insensitive to the objects order.
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Returns a string representation of the object pair for debugging purpose only.
      Overrides:
      toString in class Object