Class Pair<T1,T2>

java.lang.Object
org.identityconnectors.common.Pair<T1,T2>
All Implemented Interfaces:
Map.Entry<T1,T2>

public class Pair<T1,T2> extends Object implements Map.Entry<T1,T2>
An arbitrary pair of objects. Convenient implementation of Map.Entry.
  • Field Details

    • first

      public T1 first
    • second

      public T2 second
  • Constructor Details

    • Pair

      public Pair()
    • Pair

      public Pair(T1 f, T2 s)
  • Method Details

    • of

      public static <L, R> Pair<L,R> of(L left, R right)
      Obtains a mutable pair of two objects inferring the generic types.

      This factory allows the pair to be created using inference to obtain the generic types.

      Type Parameters:
      L - the left element type
      R - the right element type
      Parameters:
      left - the left element, may be null
      right - the right element, may be null
      Returns:
      a pair formed from the two parameters, not null
      Since:
      1.4
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Map.Entry<T1,T2>
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object object)
      Specified by:
      equals in interface Map.Entry<T1,T2>
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getKey

      public T1 getKey()
      Specified by:
      getKey in interface Map.Entry<T1,T2>
    • getValue

      public T2 getValue()
      Specified by:
      getValue in interface Map.Entry<T1,T2>
    • setValue

      public T2 setValue(T2 value)
      Specified by:
      setValue in interface Map.Entry<T1,T2>