Class Pair<F,​S>

  • Type Parameters:
    F - The type of the first item
    S - The type of the second item
    All Implemented Interfaces:
    java.io.Serializable

    @Deprecated
    public class Pair<F,​S>
    extends java.lang.Object
    implements java.io.Serializable
    Deprecated.
    Instead of this, please create a dedicated class with well-named, non-generic (potentially primitive) properties and getters.
    Represents a pair of items
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Pair​(F first, S second)
      Deprecated.
      Use the static factory method create(Object, Object) instead of this where possible.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static <F,​S>
      int
      calculateHashCode​(F first, S second)
      Deprecated.
       
      static <F,​S>
      Pair<F,​S>
      create​(F first, S second)
      Deprecated.
      Static factory method that, unlike the constructor, performs generic inference saving some typing.
      boolean equals​(java.lang.Object obj)
      Deprecated.
       
      F getFirst()
      Deprecated.
       
      S getSecond()
      Deprecated.
       
      int hashCode()
      Deprecated.
       
      java.lang.String toString()
      Deprecated.
       
      • Methods inherited from class java.lang.Object

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

      • Pair

        public Pair​(F first,
                    S second)
        Deprecated.
        Use the static factory method create(Object, Object) instead of this where possible.
        Parameters:
        first -
        second -
    • Method Detail

      • create

        public static final <F,​S> Pair<F,​S> create​(F first,
                                                               S second)
        Deprecated.
        Static factory method that, unlike the constructor, performs generic inference saving some typing. Use in the following way (for a pair of Strings):

        Pair pair = Pair.create("first", "second");

        Type Parameters:
        F - The type of the first thing.
        S - The type of the second thing
        Parameters:
        first - The first thing
        second - The second thing
        Returns:
        The pair (first,second)
      • getFirst

        public final F getFirst()
        Deprecated.
      • getSecond

        public final S getSecond()
        Deprecated.
      • hashCode

        public final int hashCode()
        Deprecated.
        Overrides:
        hashCode in class java.lang.Object
      • calculateHashCode

        public static <F,​S> int calculateHashCode​(F first,
                                                        S second)
        Deprecated.
      • equals

        public final boolean equals​(java.lang.Object obj)
        Deprecated.
        Overrides:
        equals in class java.lang.Object
      • toString

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