pierventre | 30368ab | 2021-02-24 23:23:22 +0100 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2021-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 | package org.onosproject.segmentrouting.policy.api; |
| 17 | |
| 18 | import java.util.List; |
| 19 | |
| 20 | /** |
| 21 | * Traffic match data retrieved from the system. |
| 22 | */ |
| 23 | public final class TrafficMatchData { |
| 24 | // We want to provide access to the traffic match data as well as |
| 25 | // the traffic match operations in the system and their status |
| 26 | private final TrafficMatchState trafficMatchState; |
| 27 | private final TrafficMatch trafficMatch; |
| 28 | private final List<String> operations; |
| 29 | |
| 30 | |
| 31 | public TrafficMatchData(TrafficMatchState tState, TrafficMatch tMatch, List<String> ops) { |
| 32 | trafficMatch = tMatch; |
| 33 | trafficMatchState = tState; |
| 34 | operations = ops; |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * Returns the current state of the traffic match. |
| 39 | * |
| 40 | * @return the traffic match state |
| 41 | */ |
| 42 | public TrafficMatchState trafficMatchState() { |
| 43 | return trafficMatchState; |
| 44 | } |
| 45 | |
| 46 | |
| 47 | /** |
| 48 | * Returns the traffic match associated. |
| 49 | * |
| 50 | * @return the traffic match |
| 51 | */ |
| 52 | public TrafficMatch trafficMatch() { |
| 53 | return trafficMatch; |
| 54 | } |
| 55 | |
| 56 | /** |
| 57 | * Returns the operations in the system in form of strings. |
| 58 | * |
| 59 | * @return the operations |
| 60 | */ |
| 61 | public List<String> operations() { |
| 62 | return operations; |
| 63 | } |
| 64 | } |