slowr | c86750e | 2017-08-22 17:26:47 -0700 | [diff] [blame^] | 1 | /* |
| 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 | |
| 17 | package org.onosproject.xran.identifiers; |
| 18 | |
| 19 | import com.google.common.base.Objects; |
| 20 | import javafx.util.Pair; |
| 21 | import org.onosproject.xran.codecs.api.CRNTI; |
| 22 | import org.onosproject.xran.codecs.api.ECGI; |
| 23 | |
| 24 | public 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 | } |