Class ObjIntPair<A>

    • Method Detail

      • of

        public static <A> ObjIntPair<A> of​(A first,
                                           int second)
        Obtains an instance from an Object and an int.
        Type Parameters:
        A - the first element type
        Parameters:
        first - the first element
        second - the second element
        Returns:
        a pair formed from the two parameters
      • ofPair

        public static <A> ObjIntPair<A> ofPair​(Pair<A,​Integer> pair)
        Obtains an instance from a Pair.
        Type Parameters:
        A - the first element type
        Parameters:
        pair - the pair to convert
        Returns:
        a pair formed by extracting values from the pair
      • size

        public int size()
        Gets the number of elements held by this pair.
        Specified by:
        size in interface Tuple
        Returns:
        size 2
      • elements

        public ImmutableList<Object> elements()
        Gets the elements from this pair as a list.

        The list returns each element in the pair in order.

        Specified by:
        elements in interface Tuple
        Returns:
        the elements as an immutable list
      • toPair

        public Pair<A,​Integer> toPair()
        Converts this pair to an object-based Pair.
        Returns:
        the object-based pair
      • compareTo

        public int compareTo​(ObjIntPair<A> other)
        Compares the pair based on the first element followed by the second element.

        The first element must be Comparable.

        Specified by:
        compareTo in interface Comparable<A>
        Parameters:
        other - the other pair
        Returns:
        negative if this is less, zero if equal, positive if greater
        Throws:
        ClassCastException - if the object is not comparable
      • toString

        public String toString()
        Gets the pair using a standard string format.

        The standard format is '[$first, $second]'. Spaces around the values are trimmed.

        Overrides:
        toString in class Object
        Returns:
        the pair as a string
      • meta

        public static ObjIntPair.Meta meta()
        The meta-bean for ObjIntPair.
        Returns:
        the meta-bean, not null
      • metaObjIntPair

        public static <R> ObjIntPair.Meta<R> metaObjIntPair​(Class<R> cls)
        The meta-bean for ObjIntPair.
        Type Parameters:
        R - the bean's generic type
        Parameters:
        cls - the bean's generic type
        Returns:
        the meta-bean, not null
      • metaBean

        public ObjIntPair.Meta<A> metaBean()
        Specified by:
        metaBean in interface org.joda.beans.Bean
      • getFirst

        public A getFirst()
        Gets the first element in this pair.
        Returns:
        the value of the property, not null
      • getSecond

        public int getSecond()
        Gets the second element in this pair.
        Returns:
        the value of the property
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object