com.cryptape.cita.tuples.generated.Tuple2 Maven / Gradle / Ivy
package com.cryptape.cita.tuples.generated;
import com.cryptape.cita.tuples.Tuple;
/**
* Auto generated code.
* Do not modifiy!
*
Please use com.cryptape.cita.codegen.TupleGenerator in the
*/
public final class Tuple2 implements Tuple {
private static final int SIZE = 2;
private final T1 value1;
private final T2 value2;
public Tuple2(T1 value1, T2 value2) {
this.value1 = value1;
this.value2 = value2;
}
public T1 getValue1() {
return value1;
}
public T2 getValue2() {
return value2;
}
@Override
public int getSize() {
return SIZE;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Tuple2, ?> tuple2 = (Tuple2, ?>) o;
if (value1 != null ? !value1.equals(tuple2.value1) : tuple2.value1 != null) {
return false;
}
return value2 != null ? value2.equals(tuple2.value2) : tuple2.value2 == null;
}
@Override
public int hashCode() {
int result = value1.hashCode();
result = 31 * result + (value2 != null ? value2.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "Tuple2{" +
"value1=" + value1 +
", value2=" + value2 +
"}";
}
}