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 | |
| 20 | /** |
| 21 | * Representation of data model node to maintain path predicate in YANG absolute-path or relative-path. |
| 22 | */ |
| 23 | public class YangPathPredicate<T> implements Serializable { |
| 24 | |
| 25 | private static final long serialVersionUID = 806201689L; |
| 26 | |
| 27 | // YANG node identifier. |
| 28 | private YangNodeIdentifier nodeIdentifier; |
| 29 | |
| 30 | // Left axis node will represent the nodeidentifier before equality sign in path predicate. |
| 31 | private T leftAxisNode; |
| 32 | |
| 33 | // YANG path operator. |
| 34 | private YangPathOperator pathOperator; |
| 35 | |
| 36 | // YANG relative path. |
| 37 | private YangRelativePath rightRelativePath; |
| 38 | |
| 39 | // Right axis node will represent the nodeidentifier after equality sign in path predicate. |
| 40 | private T rightAxisNode; |
| 41 | |
| 42 | /** |
| 43 | * Returns the path expression operator. |
| 44 | * |
| 45 | * @return the path expression operator |
| 46 | */ |
| 47 | public YangPathOperator getPathOperator() { |
| 48 | return pathOperator; |
| 49 | } |
| 50 | |
| 51 | /** |
| 52 | * Sets the path expression operator. |
| 53 | * |
| 54 | * @param pathOperator Sets the path expression operator |
| 55 | */ |
| 56 | public void setPathOperator(YangPathOperator pathOperator) { |
| 57 | this.pathOperator = pathOperator; |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Returns the right relative path expression. |
| 62 | * |
| 63 | * @return the right relative path expression |
| 64 | */ |
| 65 | public YangRelativePath getRightRelativePath() { |
| 66 | return rightRelativePath; |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * Sets the right relative path expression. |
| 71 | * |
| 72 | * @param rightRelativePath Sets the right relative path expression |
| 73 | */ |
| 74 | public void setRightRelativePath(YangRelativePath rightRelativePath) { |
| 75 | this.rightRelativePath = rightRelativePath; |
| 76 | } |
| 77 | |
| 78 | /** |
| 79 | * Returns the nodeidentifier. |
| 80 | * |
| 81 | * @return the nodeidentifier |
| 82 | */ |
| 83 | public YangNodeIdentifier getNodeIdentifier() { |
| 84 | return nodeIdentifier; |
| 85 | } |
| 86 | |
| 87 | /** |
| 88 | * Sets the YANG node identifier. |
| 89 | * |
| 90 | * @param nodeIdentifier Sets the node identifier |
| 91 | * |
| 92 | */ |
| 93 | public void setNodeIdentifier(YangNodeIdentifier nodeIdentifier) { |
| 94 | this.nodeIdentifier = nodeIdentifier; |
| 95 | } |
| 96 | |
| 97 | /** |
| 98 | * Returns the left axis node. |
| 99 | * |
| 100 | * @return the left axis node |
| 101 | */ |
| 102 | public T getLeftAxisNode() { |
| 103 | return leftAxisNode; |
| 104 | } |
| 105 | |
| 106 | /** |
| 107 | * Sets the left axis node. |
| 108 | * |
| 109 | * @param leftAxisNode Sets the left axis node |
| 110 | */ |
| 111 | public void setLeftAxisNode(T leftAxisNode) { |
| 112 | this.leftAxisNode = leftAxisNode; |
| 113 | } |
| 114 | |
| 115 | /** |
| 116 | * Returns the right axis node. |
| 117 | * |
| 118 | * @return the right axis node |
| 119 | */ |
| 120 | public T getRightAxisNode() { |
| 121 | return rightAxisNode; |
| 122 | } |
| 123 | |
| 124 | /** |
| 125 | * Sets the right axis node. |
| 126 | * |
| 127 | * @param rightAxisNode Sets the right axis node |
| 128 | */ |
| 129 | public void setRightAxisNode(T rightAxisNode) { |
| 130 | this.rightAxisNode = rightAxisNode; |
| 131 | } |
| 132 | } |