1 package com.github.davidmoten.rx.util; 2 3 public class Pair<T, S> { 4 5 private final T a; 6 private final S b; 7 8 public Pair(T a, S b) { 9 this.a = a; 10 this.b = b; 11 } 12 13 public static <T, S> Pair<T, S> create(T t, S s) { 14 return new Pair<T, S>(t, s); 15 } 16 17 public T a() { 18 return a; 19 } 20 21 public S b() { 22 return b; 23 } 24 25 public T left() { 26 return a; 27 } 28 29 public S right() { 30 return b; 31 } 32 33 @Override 34 public String toString() { 35 StringBuilder builder = new StringBuilder(); 36 builder.append("Pair [left="); 37 builder.append(a); 38 builder.append(", right="); 39 builder.append(b); 40 builder.append("]"); 41 return builder.toString(); 42 } 43 }