java.lang.Object
com.aquima.interactions.foundation.utility.Pair<T>

public class Pair<T> extends Object
Pairs two items and acts like one. It supports equals and hashcode for both. This results in a pair which can be used as key in a Map. Pair( "a", "b" ) is smaller then Pair("a","c"); Pair( "c", "b" ) is larger then Pair("a","z");
Since:
5.0
Author:
F. van der Meer
  • Constructor Details

    • Pair

      public Pair(T first, T second)
      Constructs a paired object.
      Parameters:
      first - The first argument retrievable by executing getFirst() function.
      second - The second argument retrievable by executing getSecond() function.
  • Method Details

    • getFirst

      public T getFirst()
      Returns the first argument as the pair was constructed with.
      Returns:
      The object.
    • getSecond

      public T getSecond()
      Returns the second argument as the pair was constructed with.
      Returns:
      The object.
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object