blob: 634778810d85dd014f972d929bdbfdf94df9089d [file] [log] [blame]
slowrc86750e2017-08-22 17:26:47 -07001/*
2 * Copyright 2015-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.xran.identifiers;
18
19import com.google.common.base.Objects;
20import javafx.util.Pair;
21import org.onosproject.xran.codecs.api.CRNTI;
22import org.onosproject.xran.codecs.api.ECGI;
23
24public class EcgiCrntiPair extends Pair<ECGI, CRNTI> {
25
26 /**
27 * Creates a new pair
28 *
29 * @param key The key for this pair
30 * @param value The value to use for this pair
31 */
32 public EcgiCrntiPair(ECGI key, CRNTI value) {
33 super(key, value);
34 }
35
36 public static EcgiCrntiPair valueOf(ECGI key, CRNTI value) {
37 return new EcgiCrntiPair(key, value);
38 }
39
40 @Override
41 public int hashCode() {
42 return Objects.hashCode(getKey(), getValue());
43 }
44
45 @Override
46 public boolean equals(Object o) {
47 if (o instanceof EcgiCrntiPair) {
48 return ((EcgiCrntiPair) o).getKey().equals(getKey()) &&
49 ((EcgiCrntiPair) o).getValue().equals(getValue());
50 }
51 return super.equals(o);
52 }
53}