git.iko.soy/opencode-android
on master help sign in
46 lines 1.4 kB history raw
1// Copyright (c) Facebook, Inc. and its affiliates
2// SPDX-License-Identifier: MIT OR Apache-2.0
4package com.novi.serde;
6import java.util.Objects;
8public final class Tuple3<T0, T1, T2> {
9 public final T0 field0;
10 public final T1 field1;
11 public final T2 field2;
13 public Tuple3(T0 f0, T1 f1, T2 f2) {
14 Objects.requireNonNull(f0, "f0 must not be null");
15 Objects.requireNonNull(f1, "f1 must not be null");
16 Objects.requireNonNull(f2, "f2 must not be null");
17 this.field0 = f0;
18 this.field1 = f1;
19 this.field2 = f2;
20 }
22 public boolean equals(Object obj) {
23 if (this == obj) return true;
24 if (obj == null) return false;
25 if (getClass() != obj.getClass()) return false;
26 Tuple3<?,?,?> other = (Tuple3) obj;
27 if (!Objects.equals(this.field0, other.field0)) {
28 return false;
29 }
30 if (!Objects.equals(this.field1, other.field1)) {
31 return false;
32 }
33 if (!Objects.equals(this.field2, other.field2)) {
34 return false;
35 }
36 return true;
37 }
39 public int hashCode() {
40 int value = 7;
41 value = 31 * value + (this.field0 != null ? this.field0.hashCode() : 0);
42 value = 31 * value + (this.field1 != null ? this.field1.hashCode() : 0);
43 value = 31 * value + (this.field2 != null ? this.field2.hashCode() : 0);
44 return value;
45 }