diff options
Diffstat (limited to 'bundle2installable/src/java/com/android/tools/appbundle/bundle2installable/util/Pair.java')
-rw-r--r-- | bundle2installable/src/java/com/android/tools/appbundle/bundle2installable/util/Pair.java | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/bundle2installable/src/java/com/android/tools/appbundle/bundle2installable/util/Pair.java b/bundle2installable/src/java/com/android/tools/appbundle/bundle2installable/util/Pair.java deleted file mode 100644 index 26b7e72..0000000 --- a/bundle2installable/src/java/com/android/tools/appbundle/bundle2installable/util/Pair.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License - */ - -package com.android.tools.appbundle.bundle2installable.util; - -/** - * Pair of two elements. - */ -public final class Pair<A, B> { - - private final A mFirst; - private final B mSecond; - - private Pair(A first, B second) { - mFirst = first; - mSecond = second; - } - - public static <A, B> Pair<A, B> of(A first, B second) { - return new Pair<A, B>(first, second); - } - - public A getFirst() { - return mFirst; - } - - public B getSecond() { - return mSecond; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((mFirst == null) ? 0 : mFirst.hashCode()); - result = prime * result + ((mSecond == null) ? 0 : mSecond.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - @SuppressWarnings("rawtypes") - Pair other = (Pair) obj; - if (mFirst == null) { - if (other.mFirst != null) { - return false; - } - } else if (!mFirst.equals(other.mFirst)) { - return false; - } - if (mSecond == null) { - if (other.mSecond != null) { - return false; - } - } else if (!mSecond.equals(other.mSecond)) { - return false; - } - return true; - } -} |