janani b | 05614f1 | 2016-10-04 12:55:43 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Foundation |
janani b | 05614f1 | 2016-10-04 12:55:43 +0530 | [diff] [blame] | 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 | |
| 17 | package org.onosproject.yms.app.ytb; |
| 18 | |
| 19 | import org.onosproject.yangutils.datamodel.YangNode; |
| 20 | import org.onosproject.yms.app.utils.TraversalType; |
| 21 | |
| 22 | /** |
| 23 | * Represents YTB Traversal info which is needed every time the traversal of |
| 24 | * a YANG node happens. This contains YANG node and its corresponding traversal |
| 25 | * type information. |
| 26 | */ |
| 27 | public class YtbTraversalInfo { |
| 28 | |
| 29 | /** |
| 30 | * YANG node of the current traversal. |
| 31 | */ |
| 32 | private YangNode yangNode; |
| 33 | |
| 34 | /** |
| 35 | * Traverse type of the current traversal. |
| 36 | */ |
| 37 | private TraversalType traverseType; |
| 38 | |
| 39 | /** |
| 40 | * Creates YTB traversal info by taking the traversal type and the YANG |
| 41 | * node. |
| 42 | * |
| 43 | * @param yangNode YANG node |
| 44 | * @param traverseType traversal type |
| 45 | */ |
| 46 | public YtbTraversalInfo(YangNode yangNode, TraversalType traverseType) { |
| 47 | this.yangNode = yangNode; |
| 48 | this.traverseType = traverseType; |
| 49 | } |
| 50 | |
| 51 | /** |
| 52 | * Returns the YANG node of the current traversal. |
| 53 | * |
| 54 | * @return YANG node |
| 55 | */ |
| 56 | public YangNode getYangNode() { |
| 57 | return yangNode; |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Returns the traversal type of the current traversal. |
| 62 | * |
| 63 | * @return traversal type |
| 64 | */ |
| 65 | public TraversalType getTraverseType() { |
| 66 | return traverseType; |
| 67 | } |
| 68 | } |