blob: 8ec1bce3be7cbcd44c9cd007655c0a1d1bf0b958 [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;
20import org.onosproject.net.flow.criteria.Criterion;
21
22import java.util.Objects;
23
24/**
25 * Filtering objective queue key.
26 */
27public class FilteringObjQueueKey {
28 private DeviceId deviceId;
29 private int priority;
30 private Criterion key;
31
32 public FilteringObjQueueKey(DeviceId deviceId, int priority, Criterion key) {
33 this.deviceId = deviceId;
34 this.priority = priority;
35 this.key = key;
36 }
37
38 @Override
39 public int hashCode() {
40 return Objects.hash(deviceId, priority, key);
41 }
42
43 @Override
44 public boolean equals(Object other) {
45 if (this == other) {
46 return true;
47 }
48 if (!(other instanceof FilteringObjQueueKey)) {
49 return false;
50 }
51 FilteringObjQueueKey that = (FilteringObjQueueKey) other;
52 return Objects.equals(this.deviceId, that.deviceId) &&
53 Objects.equals(this.priority, that.priority) &&
54 Objects.equals(this.key, that.key);
55 }
56}