Class Couple<T>


  • public final class Couple<T>
    extends java.lang.Object
    A couple of two items with same type. A value object.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      T a
      The first item.
      T b
      The second item.
    • Constructor Summary

      Constructors 
      Constructor Description
      Couple​(T[] ab)  
      Couple​(T a, T b)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object thatObject)  
      boolean equals​(Couple<T> that)  
      T get​(int index)
      Returns a if index 0 or b if index 1.
      T getA()
      Returns a, to allow use Couple in jsp.
      T getB()
      Returns b, to allow use Couple in jsp.
      int hashCode()  
      static <TT> Couple<TT> of​(TT a, TT b)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • a

        public final T a
        The first item.
      • b

        public final T b
        The second item.
    • Constructor Detail

      • Couple

        public Couple​(T a,
                      T b)
      • Couple

        public Couple​(@NotNull
                      T[] ab)
    • Method Detail

      • of

        public static <TT> Couple<TT> of​(TT a,
                                         TT b)
      • getA

        public final T getA()
        Returns a, to allow use Couple in jsp.
        Returns:
        a.
      • getB

        public final T getB()
        Returns b, to allow use Couple in jsp.
        Returns:
        b.
      • get

        public final T get​(int index)
        Returns a if index 0 or b if index 1.
        Parameters:
        index - 0 or 1
        Returns:
        a or b
      • equals

        public boolean equals​(Couple<T> that)
      • equals

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

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object