Class Pair<T1,​T2>

  • Type Parameters:
    T1 - the first element of the Pair
    T2 - the second element of the Pair
    Direct Known Subclasses:
    OperationId

    @NotThreadSafe
    public class Pair<T1,​T2>
    extends java.lang.Object
    A pair representation defined by two elements (of type First and type Second).
    • Constructor Summary

      Constructors 
      Constructor Description
      Pair()
      Default constructor for deserialization.
      Pair​(T1 first, T2 second)
      Constructs and initializes a Pair specified by the two input elements.
    • Constructor Detail

      • Pair

        public Pair​(T1 first,
                    T2 second)
        Constructs and initializes a Pair specified by the two input elements.
        Parameters:
        first - the first element of the pair (of type First)
        second - the second element of the pair (of type Second)
      • Pair

        public Pair()
        Default constructor for deserialization.
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • getFirst

        public T1 getFirst()
        Returns:
        the first element of the pair
      • getSecond

        public T2 getSecond()
        Returns:
        the second element of the pair
      • hashCode

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

        public void setFirst​(T1 first)
        Set the first value.
        Parameters:
        first - the value to be set
      • setSecond

        public void setSecond​(T2 second)
        Set the second value.
        Parameters:
        second - the value to be set
      • toString

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