Package 

Class Pair


  • 
    public class Pair<F, S>
    
                        

    Container to ease passing around a tuple of two objects. This object provides a sensible implementation of equals(), returning true if equals() is true on each of the contained objects.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final F first
      public final S second
    • Constructor Summary

      Constructors 
      Constructor Description
      Pair(F first, S second) Constructor for a Pair.
    • Method Summary

      Modifier and Type Method Description
      boolean equals(Object o) Checks the two objects for equality by delegating to their respective equals methods.
      int hashCode() Compute a hash code using the hash codes of the underlying objects
      String toString()
      static <A, B> Pair<A, B> create(A a, B b) Convenience method for creating an appropriately typed pair.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Pair

        Pair(F first, S second)
        Constructor for a Pair.
        Parameters:
        first - the first object in the Pair
        second - the second object in the pair
    • Method Detail

      • equals

         boolean equals(Object o)

        Checks the two objects for equality by delegating to their respective equals methods.

        Parameters:
        o - the Pair to which this one is to be checked for equality
      • hashCode

         int hashCode()

        Compute a hash code using the hash codes of the underlying objects

      • create

        @NonNull() static <A, B> Pair<A, B> create(A a, B b)

        Convenience method for creating an appropriately typed pair.

        Parameters:
        a - the first object in the Pair
        b - the second object in the pair