Shankara-Huawei | 15c8ed8 | 2016-06-20 19:29:59 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016-present Open Networking Laboratory |
| 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.yangutils.datamodel; |
| 17 | |
| 18 | import java.io.Serializable; |
| 19 | import java.util.List; |
| 20 | |
| 21 | /** |
| 22 | * Representation of data model node to maintain absolute path defined in YANG path-arg. |
| 23 | */ |
| 24 | public class YangAtomicPath implements Serializable { |
| 25 | |
| 26 | private static final long serialVersionUID = 806201688L; |
| 27 | |
| 28 | // YANG node identifier. |
| 29 | private YangNodeIdentifier nodeIdentifier; |
| 30 | |
| 31 | // List of path predicates expression. |
| 32 | private List<YangPathPredicate> pathPredicatesList; |
| 33 | |
| 34 | /** |
Bharat saraswal | d50c638 | 2016-07-14 21:57:13 +0530 | [diff] [blame^] | 35 | * Resolved node for the absolute path. |
| 36 | */ |
| 37 | private YangNode resolvedNode; |
| 38 | |
| 39 | /** |
Shankara-Huawei | 15c8ed8 | 2016-06-20 19:29:59 +0530 | [diff] [blame] | 40 | * Returns the node identifier. |
| 41 | * |
| 42 | * @return the node identifier |
| 43 | */ |
| 44 | public YangNodeIdentifier getNodeIdentifier() { |
| 45 | return nodeIdentifier; |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Sets the node identifier. |
| 50 | * |
| 51 | * @param nodeIdentifier Sets the node identifier |
| 52 | */ |
| 53 | public void setNodeIdentifier(YangNodeIdentifier nodeIdentifier) { |
| 54 | this.nodeIdentifier = nodeIdentifier; |
| 55 | } |
| 56 | |
| 57 | /** |
| 58 | * Returns the path predicate expression. |
| 59 | * |
| 60 | * @return the path predicate expression |
| 61 | */ |
| 62 | public List<YangPathPredicate> getPathPredicatesList() { |
| 63 | return pathPredicatesList; |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * Sets the path predicate expression. |
| 68 | * |
| 69 | * @param pathPredicatesList Sets the path predicate expression |
| 70 | */ |
| 71 | public void setPathPredicatesList(List<YangPathPredicate> pathPredicatesList) { |
| 72 | this.pathPredicatesList = pathPredicatesList; |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * Adds predicate expression in data holder. |
| 77 | * |
| 78 | * @param predicatesExp the predicate expression to be added |
| 79 | */ |
| 80 | public void addLeavesPredicate(YangPathPredicate predicatesExp) { |
| 81 | getPathPredicatesList().add(predicatesExp); |
| 82 | } |
Bharat saraswal | d50c638 | 2016-07-14 21:57:13 +0530 | [diff] [blame^] | 83 | |
| 84 | |
| 85 | /** |
| 86 | * Returns resolved node. |
| 87 | * |
| 88 | * @return resolved node |
| 89 | */ |
| 90 | public YangNode getResolvedNode() { |
| 91 | return resolvedNode; |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * Sets resolved node. |
| 96 | * |
| 97 | * @param resolvedNode resolved node |
| 98 | */ |
| 99 | public void setResolvedNode(YangNode resolvedNode) { |
| 100 | this.resolvedNode = resolvedNode; |
| 101 | } |
Shankara-Huawei | 15c8ed8 | 2016-06-20 19:29:59 +0530 | [diff] [blame] | 102 | } |