Class Pair<F,​S>

  • Type Parameters:
    F - first object type
    S - second object type

    public class Pair<F,​S>
    extends java.lang.Object
    A pair of objects: first and second.
    • Field Summary

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

      Constructors 
      Modifier Constructor Description
      protected Pair​(F first, S second)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object other)  
      int hashCode()  
      static <F,​S>
      Pair<F,​S>
      of​(F first, S second)
      Creates a pair object
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • first

        public final F first
      • second

        public final S second
    • Constructor Detail

      • Pair

        protected Pair​(F first,
                       S second)
    • Method Detail

      • of

        public static <F,​S> Pair<F,​S> of​(F first,
                                                     S second)
        Creates a pair object
        Parameters:
        first - must be non-null
        second - must be non-null
        Returns:
        The pair object.
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object