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

org.github.codefarmer.spring.promises.Tuple2 Maven / Gradle / Ivy

Go to download

Glue code allowing Spring Futures to be mapped, flatMapped, joined and other convenient things.

There is a newer version: 1.1
Show newest version
package org.github.codefarmer.spring.promises;

/**
 * Created by joelgluth on 20/01/2015.
 */
public class Tuple2 {

  final A a;
  final B b;

  public Tuple2(A a, B b) {
    this.a = a;
    this.b = b;
  }

  public A _1() {
    return a;
  }

  public B _2() {
    return b;
  }

  // generated by IntelliJ
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }

    Tuple2 tuple2 = (Tuple2) o;

    if (a != null ? !a.equals(tuple2.a) : tuple2.a != null) {
      return false;
    }
    if (b != null ? !b.equals(tuple2.b) : tuple2.b != null) {
      return false;
    }

    return true;
  }

  // generated by IntelliJ
  @Override
  public int hashCode() {
    int result = a != null ? a.hashCode() : 0;
    result = 31 * result + (b != null ? b.hashCode() : 0);
    return result;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy