/* * This file is part of Bitsquare. * * Bitsquare is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. * * Bitsquare is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public * License for more details. * * You should have received a copy of the GNU Affero General Public License * along with Bitsquare. If not, see <http://www.gnu.org/licenses/>. */ package io.bitsquare.common.util; import java.io.Serializable; public class Tuple3<A, B, C> implements Serializable { final public A first; final public B second; final public C third; public Tuple3(A first, B second, C third) { this.first = first; this.second = second; this.third = third; } @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Tuple3)) return false; Tuple3<?, ?, ?> tuple3 = (Tuple3<?, ?, ?>) o; if (first != null ? !first.equals(tuple3.first) : tuple3.first != null) return false; if (second != null ? !second.equals(tuple3.second) : tuple3.second != null) return false; return !(third != null ? !third.equals(tuple3.third) : tuple3.third != null); } @Override public int hashCode() { int result = first != null ? first.hashCode() : 0; result = 31 * result + (second != null ? second.hashCode() : 0); result = 31 * result + (third != null ? third.hashCode() : 0); return result; } }