2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
\r
4 * This program and the accompanying materials are made available under the
\r
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
\r
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
\r
8 package org.opendaylight.controller.yang.model.api;
\r
10 import java.util.ArrayList;
\r
11 import java.util.Collections;
\r
12 import java.util.List;
\r
14 import org.opendaylight.controller.yang.common.QName;
\r
16 public class SchemaPath {
\r
18 final List<QName> path;
\r
19 final boolean absolute;
\r
21 public SchemaPath(final List<QName> path, boolean absolute) {
\r
22 this.path = Collections.unmodifiableList(new ArrayList<QName>(path));
\r
23 this.absolute = absolute;
\r
26 public List<QName> getPath() {
\r
30 public boolean isAbsolute() {
\r
35 public int hashCode() {
\r
36 final int prime = 31;
\r
38 result = prime * result + (absolute ? 1231 : 1237);
\r
39 result = prime * result + ((path == null) ? 0 : path.hashCode());
\r
44 public boolean equals(Object obj) {
\r
51 if (getClass() != obj.getClass()) {
\r
54 SchemaPath other = (SchemaPath) obj;
\r
55 if (absolute != other.absolute) {
\r
59 if (other.path != null) {
\r
62 } else if (!path.equals(other.path)) {
\r
69 public String toString() {
\r
70 StringBuilder builder = new StringBuilder();
\r
71 builder.append("SchemaPath [path=");
\r
72 builder.append(path);
\r
73 builder.append(", absolute=");
\r
74 builder.append(absolute);
\r
75 builder.append("]");
\r
76 return builder.toString();
\r