Yoonseon Han | e026a7f | 2017-08-23 06:05:25 +0900 | [diff] [blame] | 1 | /* |
| 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 Vachuska | 52f2cd1 | 2018-11-08 21:20:04 -0800 | [diff] [blame^] | 17 | package org.onosproject.incubator.net.virtual.store.impl.primitives; |
Yoonseon Han | e026a7f | 2017-08-23 06:05:25 +0900 | [diff] [blame] | 18 | |
| 19 | import org.onosproject.incubator.net.virtual.NetworkId; |
Ray Milkey | 7bf273c | 2017-09-27 16:15:15 -0700 | [diff] [blame] | 20 | import org.onosproject.net.flow.oldbatch.FlowRuleBatchOperation; |
Yoonseon Han | e026a7f | 2017-08-23 06:05:25 +0900 | [diff] [blame] | 21 | |
| 22 | import java.util.Objects; |
| 23 | |
| 24 | /** |
| 25 | * A wrapper class to encapsulate flow rule batch operation. |
| 26 | */ |
| 27 | public class VirtualFlowRuleBatchOperation { |
| 28 | NetworkId networkId; |
| 29 | FlowRuleBatchOperation operation; |
| 30 | |
| 31 | public VirtualFlowRuleBatchOperation(NetworkId networkId, |
| 32 | FlowRuleBatchOperation operation) { |
| 33 | this.networkId = networkId; |
| 34 | this.operation = operation; |
| 35 | } |
| 36 | |
| 37 | public NetworkId networkId() { |
| 38 | return networkId; |
| 39 | } |
| 40 | |
| 41 | public FlowRuleBatchOperation operation() { |
| 42 | return operation; |
| 43 | } |
| 44 | |
| 45 | @Override |
| 46 | public int hashCode() { |
| 47 | return Objects.hash(networkId, operation); |
| 48 | } |
| 49 | |
| 50 | @Override |
| 51 | public boolean equals(Object other) { |
| 52 | if (this == other) { |
| 53 | return true; |
| 54 | } |
| 55 | |
| 56 | if (other instanceof VirtualFlowRuleBatchOperation) { |
| 57 | VirtualFlowRuleBatchOperation that = (VirtualFlowRuleBatchOperation) other; |
| 58 | return this.networkId.equals(that.networkId) && |
| 59 | this.operation.equals(that.operation); |
| 60 | } else { |
| 61 | return false; |
| 62 | } |
| 63 | } |
| 64 | } |