Class Pair<N,V>

java.lang.Object
com.sinch.sdk.core.utils.Pair<N,V>
Type Parameters:
N - Type of the left value
V - Type of the right value

public class Pair<N,V> extends Object
Utility class to manage a pair of information (tuple)
  • Constructor Summary

    Constructors
    Constructor
    Description
    Pair(N left, V right)
    Create a new pair
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the left value of this Pair
    Get the right value of this Pair
    static <K, V> Pair<K,V>
    of(K key, V value)
    Helper to create new instance of Pair
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Pair

      public Pair(N left, V right)
      Create a new pair
      Parameters:
      left - The left (key) value for this pair
      right - The right (value) value for this pair
  • Method Details

    • getLeft

      public N getLeft()
      Get the left value of this Pair
      Returns:
      Left value
    • getRight

      public V getRight()
      Get the right value of this Pair
      Returns:
      Right value
    • of

      public static <K, V> Pair<K,V> of(K key, V value)
      Helper to create new instance of Pair
      Type Parameters:
      K - Key type
      V - Value type
      Parameters:
      key - key value
      value - value of value
      Returns:
      Right value
    • toString

      public String toString()
      Overrides:
      toString in class Object