Class Pair<F,​S>

  • Type Parameters:
    F - the type of the first component of the pair
    S - the type of the second component of the pair

    public class Pair<F,​S>
    extends Object
    A strongly typed pair of items.
    • Field Detail

      • first

        public F first
        The first object in the pair
      • second

        public S second
        The second object in the pair
    • Constructor Detail

      • Pair

        public Pair()
        Constructs an uninitialised pair
      • Pair

        public Pair​(F firstObject,
                    S secondObject)
        Constructs a pair of the given objects
        Parameters:
        firstObject - the first object
        secondObject - the second object
    • Method Detail

      • toString

        public String toString()
        Overrides:
        toString in class Object
        Returns:
        a string representation of the object
        Since:
        4.3.3
      • getFirst

        public F getFirst()
        Return the first object in the pair Added to enable Velocity to resolve ${pair.first}
        Returns:
        the first object
        Since:
        17.11.0
      • getSecond

        public S getSecond()
        Return the second object in the pair Added to enable Velocity to resolve ${pair.second}
        Returns:
        the second object
        Since:
        17.11.0