blob: 7e78bfab64e1a1efc5d94a40c284ac539b13019d [file] [log] [blame]
slowrc86750e2017-08-22 17:26:47 -07001/*
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -08002 * Copyright 2017-present Open Networking Foundation
slowrc86750e2017-08-22 17:26:47 -07003 *
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
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -080017package org.onosproject.xran.impl.identifiers;
slowrc86750e2017-08-22 17:26:47 -070018
19import com.google.common.base.Objects;
20import javafx.util.Pair;
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -080021import org.onosproject.xran.asn1lib.api.CRNTI;
22import org.onosproject.xran.asn1lib.api.ECGI;
slowrc86750e2017-08-22 17:26:47 -070023
slowr577f3222017-08-28 10:49:08 -070024/**
25 * Class to maintain pair of ECGI and CRNTI.
26 */
slowrc86750e2017-08-22 17:26:47 -070027public class EcgiCrntiPair extends Pair<ECGI, CRNTI> {
28
29 /**
slowr577f3222017-08-28 10:49:08 -070030 * Creates a new pair.
slowrc86750e2017-08-22 17:26:47 -070031 *
32 * @param key The key for this pair
33 * @param value The value to use for this pair
34 */
35 public EcgiCrntiPair(ECGI key, CRNTI value) {
36 super(key, value);
37 }
38
slowr577f3222017-08-28 10:49:08 -070039 /**
40 * Return a new EcgiCrntiPair.
41 *
42 * @param key ECGI
43 * @param value CRNTI
44 * @return EcgiCrntiPair
45 */
slowrc86750e2017-08-22 17:26:47 -070046 public static EcgiCrntiPair valueOf(ECGI key, CRNTI value) {
47 return new EcgiCrntiPair(key, value);
48 }
49
50 @Override
51 public int hashCode() {
52 return Objects.hashCode(getKey(), getValue());
53 }
54
55 @Override
56 public boolean equals(Object o) {
57 if (o instanceof EcgiCrntiPair) {
58 return ((EcgiCrntiPair) o).getKey().equals(getKey()) &&
59 ((EcgiCrntiPair) o).getValue().equals(getValue());
60 }
61 return super.equals(o);
62 }
63}