blob: a2d9c648ce062e40910777261dbf61788c4574b7 [file] [log] [blame]
Charles Chan33f4a912018-04-19 23:35:30 -07001/*
2 * Copyright 2018-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.net.flowobjective;
18
19import org.onosproject.net.DeviceId;
20
21import java.util.Objects;
22
23/**
24 * Next objective queue key.
25 */
26public class NextObjQueueKey {
27 private DeviceId deviceId;
28 private int id;
29
30 public NextObjQueueKey(DeviceId deviceId, int id) {
31 this.deviceId = deviceId;
32 this.id = id;
33 }
34
35 @Override
36 public int hashCode() {
37 return Objects.hash(deviceId, id);
38 }
39
40 @Override
41 public boolean equals(Object other) {
42 if (this == other) {
43 return true;
44 }
45 if (!(other instanceof NextObjQueueKey)) {
46 return false;
47 }
48 NextObjQueueKey that = (NextObjQueueKey) other;
49 return Objects.equals(this.deviceId, that.deviceId) &&
50 Objects.equals(this.id, that.id);
51 }
52}