Class Pair<F,S>

java.lang.Object
manifold.rt.api.util.Pair<F,S>
Type Parameters:
F - type of first value
S - type of second value

public class Pair<F,S> extends Object
A simple class to type-safely model a pair of values.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Enables the: first and second syntax for Pair, which is particularly useful with the Map#mapOf extension method.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Pair.And
    and is a "binding" constant that enables clean syntax for creating pairs:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Pair(F first, S second)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
     
     
    int
     
    static <T,V> Pair<T,V>
    make(T f, V s)
     
     

    Methods inherited from class Object

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

    • and

      public static final Pair.And and
      and is a "binding" constant that enables clean syntax for creating pairs:
      Pair<String,Integer> pair = "Moe" and 88;

      Use with Map#mapOf extension method via manifold-collections dependency.
      Map<String,Integer> map = Map.mapOf("Moe" and 77, "Larry" and 88, "Curly" and 99);
  • Constructor Details

    • Pair

      public Pair(F first, S second)
  • Method Details

    • getFirst

      public F getFirst()
    • getSecond

      public S getSecond()
    • make

      public static <T,V> Pair<T,V> make(T f, V s)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object