All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sinch.sdk.core.utils.Pair Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
package com.sinch.sdk.core.utils;

/**
 * Utility class to manage a pair of information (tuple)
 *
 * @param  Type of the left value
 * @param  Type of the right value
 */
public class Pair {
  private final N left;
  private final V right;

  /**
   * Create a new pair
   *
   * @param left The left (key) value for this pair
   * @param right The right (value) value for this pair
   */
  public Pair(N left, V right) {
    this.left = left;
    this.right = right;
  }

  /**
   * Get the left value of this Pair
   *
   * @return Left value
   */
  public N getLeft() {
    return this.left;
  }

  /**
   * Get the right value of this Pair
   *
   * @return Right value
   */
  public V getRight() {
    return this.right;
  }

  @Override
  public String toString() {
    return "Pair{" + "left='" + left + '\'' + ", right='" + right + '\'' + '}';
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy