Class Couple<T>


  • public final class Couple<T>
    extends Object
    A couple of two items with same type. A value object.
    • 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​(Object thatObject)
        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object