Package android.util

Class Pair<F,​S>

  • Type Parameters:
    F - The type of first value in the pair.
    S - The type of second value in the pair.

    public class Pair<F,​S>
    extends java.lang.Object
    Mock Pair implementation for testing on non android host.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      F first
      The first value in the pair.
      S second
      The second value in the pair.
    • Constructor Summary

      Constructors 
      Constructor Description
      Pair​(F first, S second)
      Creates a Mock pair.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static <A,​B>
      Pair<A,​B>
      create​(A first, B second)
      Creates a Mock pair.
      boolean equals​(java.lang.Object o)  
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • first

        public final F first
        The first value in the pair.
      • second

        public final S second
        The second value in the pair.
    • Constructor Detail

      • Pair

        public Pair​(F first,
                    S second)
        Creates a Mock pair.
        Parameters:
        first - The first value in the pair.
        second - The second value in the pair.
    • Method Detail

      • equals

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

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

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

        public static <A,​B> Pair<A,​B> create​(A first,
                                                         B second)
        Creates a Mock pair.
        Type Parameters:
        A - The first value in the pair.
        B - The second value in the pair.
        Parameters:
        first - The first value in the pair.
        second - The second value in the pair.
        Returns:
        an instance of mock pair with given values.