git.iko.soy/opencode-android
on master help sign in
40 lines 1.1 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 Tuple2<T0, T1> {
9 public final T0 field0;
10 public final T1 field1;
12 public Tuple2(T0 f0, T1 f1) {
13 Objects.requireNonNull(f0, "f0 must not be null");
14 Objects.requireNonNull(f1, "f1 must not be null");
15 this.field0 = f0;
16 this.field1 = f1;
17 }
19 public boolean equals(Object obj) {
20 if (this == obj) return true;
21 if (obj == null) return false;
22 if (getClass() != obj.getClass()) return false;
23 Tuple2<?,?> other = (Tuple2) obj;
24 if (!Objects.equals(this.field0, other.field0)) {
25 return false;
26 }
27 if (!Objects.equals(this.field1, other.field1)) {
28 return false;
29 }
30 return true;
31 }
33 public int hashCode() {
34 int value = 7;
35 value = 31 * value + (this.field0 != null ? this.field0.hashCode() : 0);
36 value = 31 * value + (this.field1 != null ? this.field1.hashCode() : 0);
37 return value;
38 }