blob: 31a1423f7055c7e65762a947948571cf3123f051 [file] [log] [blame]
chengfan7b2a60b2016-10-08 20:27:15 +08001/*
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
17package org.onosproject.protocol.restconf.server.utils.parser.api;
18
19/**
20 * Abstraction of an entity which represents a simple YANG node. This entity
21 * is usually described by a path segment in URI, or a field name in a JSON
22 * node.
23 */
24public class NormalizedYangNode {
25 private final String namespace;
26 private final String name;
27
28 /**
29 * Creates an instance of normalized YANG node using the supplied information.
30 *
31 * @param namespace namespace of a YANG node
32 * @param name name of a YANG node
33 */
34 public NormalizedYangNode(String namespace, String name) {
35 this.namespace = namespace;
36 this.name = name;
37 }
38
39 /**
40 * Returns the namespace info of a YANG node.
41 *
42 * @return namespace info
43 */
44 public String getNamespace() {
45 return namespace;
46 }
47
48 /**
49 * Returns the name of a YANG node.
50 *
51 * @return name
52 */
53 public String getName() {
54 return name;
55 }
56}