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

com.wavefront.common.Pair Maven / Gradle / Ivy

There is a newer version: 2023-22.3
Show newest version
package com.wavefront.common;

public class Pair {
  public final T _1;
  public final V _2;

  public Pair(T t, V v) {
    this._1 = t;
    this._2 = v;
  }

  @Override
  public int hashCode() {
    return _1.hashCode() + 43 * _2.hashCode();
  }

  @Override
  public boolean equals(Object obj) {
    if (obj instanceof Pair) {
      Pair pair = (Pair) obj;
      return _1.equals(pair._1) && _2.equals(pair._2);
    }
    return false;
  }

  public static  Pair of(T t, V v) {
    return new Pair(t, v);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy