blob: fb047108582cdf4759ac908dbb29673c7e1fe4b7 [file] [log] [blame]
chengfan0c32d712016-10-11 21:03:23 +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
19import java.util.Objects;
20
21/**
22 * A test class which represents YANG data node identifier which is a
23 * combination of name and namespace.
24 */
25public class TestYangSchemaId {
26 private String name;
27 private String namespace;
28
29 /**
30 * Returns the name of the node.
31 *
32 * @return name of the node
33 */
34 public String getName() {
35 return this.name;
36 }
37
38 /**
39 * Sets name of the node.
40 *
41 * @param name name of the node
42 */
43 public void setName(String name) {
44 this.name = name;
45 }
46
47 /**
48 * Returns namespace of the node.
49 *
50 * @return namespace of the node
51 */
52 public String getNameSpace() {
53 return this.namespace;
54 }
55
56 /**
57 * Sets namespace of the node.
58 *
59 * @param namespace namespace of the node
60 */
61 public void setNameSpace(String namespace) {
62 this.namespace = namespace;
63 }
64
65 @Override
66 public boolean equals(Object obj) {
67 if (this == obj) {
68 return true;
69 } else if (!(obj instanceof TestYangSchemaId)) {
70 return false;
71 } else {
72 TestYangSchemaId other = (TestYangSchemaId) obj;
73 return Objects.equals(this.name, other.name) &&
74 Objects.equals(this.namespace, other.namespace);
75 }
76 }
77
78 @Override
79 public int hashCode() {
80 return Objects.hash(this.name, this.namespace);
81 }
82}