2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.yang.model.util;
10 import org.opendaylight.controller.yang.model.api.RevisionAwareXPath;
13 * The <code>default</code> implementation of Instance Rewision Aware XPath interface.
15 * @see RevisionAwareXPath
17 public class RevisionAwareXPathImpl implements RevisionAwareXPath {
19 private final String xpath;
20 private final boolean absolute;
22 public RevisionAwareXPathImpl(String xpath, boolean absolute) {
24 this.absolute = absolute;
28 public boolean isAbsolute() {
33 public int hashCode() {
36 result = prime * result + ((xpath == null) ? 0 : xpath.hashCode());
37 result = prime * result + (absolute ? 1231 : 1237);
42 public boolean equals(Object obj) {
49 if (getClass() != obj.getClass()) {
52 RevisionAwareXPathImpl other = (RevisionAwareXPathImpl) obj;
54 if (other.xpath != null) {
57 } else if (!xpath.equals(other.xpath)) {
60 if (absolute != other.absolute) {
67 public String toString() {