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.yangtools.yang.model.util;
10 import java.util.Objects;
11 import org.opendaylight.yangtools.yang.model.api.RevisionAwareXPath;
14 * The <code>helper</code> implementation of Instance Rewision Aware XPath
17 * @see RevisionAwareXPath
19 public class RevisionAwareXPathImpl implements RevisionAwareXPath {
21 private final String xpath;
22 private final boolean absolute;
24 public RevisionAwareXPathImpl(final String xpath, final boolean absolute) {
26 this.absolute = absolute;
30 public boolean isAbsolute() {
35 public int hashCode() {
38 result = prime * result + Objects.hashCode(xpath);
39 result = prime * result + Boolean.hashCode(absolute);
44 public boolean equals(final Object obj) {
51 if (getClass() != obj.getClass()) {
54 RevisionAwareXPathImpl other = (RevisionAwareXPathImpl) obj;
55 return absolute == other.absolute && Objects.equals(xpath, other.xpath);
59 public String toString() {