blob: 2a008836f3b1ad7088e30862660abcc1e23c9d0c [file] [log] [blame]
Yoonseon Hane026a7f2017-08-23 06:05:25 +09001/*
2 * Copyright 2017-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
Thomas Vachuska52f2cd12018-11-08 21:20:04 -080017package org.onosproject.incubator.net.virtual.store.impl.primitives;
Yoonseon Hane026a7f2017-08-23 06:05:25 +090018
19import org.onosproject.incubator.net.virtual.NetworkId;
20import org.onosproject.net.flow.FlowEntry;
21
22import java.util.Objects;
23
24/**
25 * A wrapper class to encapsulate flow entry.
26 */
27public class VirtualFlowEntry {
28 NetworkId networkId;
29 FlowEntry flowEntry;
30
31 public VirtualFlowEntry(NetworkId networkId, FlowEntry flowEntry) {
32 this.networkId = networkId;
33 this.flowEntry = flowEntry;
34 }
35
36 public NetworkId networkId() {
37 return networkId;
38 }
39
40 public FlowEntry flowEntry() {
41 return flowEntry;
42 }
43
44 @Override
45 public int hashCode() {
46 return Objects.hash(networkId, flowEntry);
47 }
48
49 @Override
50 public boolean equals(Object other) {
51 if (this == other) {
52 return true;
53 }
54
55 if (other instanceof VirtualFlowEntry) {
56 VirtualFlowEntry that = (VirtualFlowEntry) other;
57 return this.networkId.equals(that.networkId) &&
58 this.flowEntry.equals(that.flowEntry);
59 } else {
60 return false;
61 }
62 }
63}