git.iko.soy/opencode-android
on master help sign in
54 lines 1.7 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 Tuple4<T0, T1, T2, T3> {
9 public final T0 field0;
10 public final T1 field1;
11 public final T2 field2;
12 public final T3 field3;
14 public Tuple4(T0 f0, T1 f1, T2 f2, T3 f3) {
15 Objects.requireNonNull(f0, "f0 must not be null");
16 Objects.requireNonNull(f1, "f1 must not be null");
17 Objects.requireNonNull(f2, "f2 must not be null");
18 Objects.requireNonNull(f3, "f3 must not be null");
19 this.field0 = f0;
20 this.field1 = f1;
21 this.field2 = f2;
22 this.field3 = f3;
23 }
25 public boolean equals(Object obj) {
26 if (this == obj) return true;
27 if (obj == null) return false;
28 if (getClass() != obj.getClass()) return false;
29 Tuple4<?,?,?,?> other = (Tuple4) obj;
30 if (!Objects.equals(this.field0, other.field0)) {
31 return false;
32 }
33 if (!Objects.equals(this.field1, other.field1)) {
34 return false;
35 }
36 if (!Objects.equals(this.field2, other.field2)) {
37 return false;
38 }
39 if (!Objects.equals(this.field3, other.field3)) {
40 return false;
41 }
42 return true;
43 }
45 public int hashCode() {
46 int value = 7;
47 value = 31 * value + (this.field0 != null ? this.field0.hashCode() : 0);
48 value = 31 * value + (this.field1 != null ? this.field1.hashCode() : 0);
49 value = 31 * value + (this.field2 != null ? this.field2.hashCode() : 0);
50 value = 31 * value + (this.field3 != null ? this.field3.hashCode() : 0);
51 return value;
52 }