Class Pair<F,​S>

  • Type Parameters:
    F - the first type, which you want to defined
    S - the second type which you want to defined

    public class Pair<F,​S>
    extends java.lang.Object
    This class can capture 2 references of 2 types and set or clear the data using setFirst() / getFirst() and setSecond() / getSecond(). It can be used to return multiple objects of a method, or to easily capture multiple objects without creating their own class.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected F first
      The reference of the first value and the type of F
      protected S second
      The reference of the second value and the type of S
    • Constructor Summary

      Constructors 
      Constructor Description
      Pair()  
      Pair​(F first, S second)  
    • Field Detail

      • first

        protected F first
        The reference of the first value and the type of F
        See Also:
        Pair
      • second

        protected S second
        The reference of the second value and the type of S
        See Also:
        Pair
    • Constructor Detail

      • Pair

        public Pair​(F first,
                    S second)
      • Pair

        public Pair()
    • Method Detail

      • getFirst

        public F getFirst()
      • setFirst

        public void setFirst​(F first)
      • getSecond

        public S getSecond()
      • setSecond

        public void setSecond​(S second)