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 static java.util.Objects.requireNonNull;
12 import java.util.Objects;
13 import org.eclipse.jdt.annotation.NonNull;
14 import org.opendaylight.yangtools.yang.model.api.RevisionAwareXPath;
17 * The <code>helper</code> implementation of Instance Revision Aware XPath interface.
19 * @see RevisionAwareXPath
21 public class RevisionAwareXPathImpl implements RevisionAwareXPath {
22 private final @NonNull String xpath;
23 private final boolean absolute;
25 public RevisionAwareXPathImpl(final String xpath, final boolean absolute) {
26 this.xpath = requireNonNull(xpath);
27 this.absolute = absolute;
31 public boolean isAbsolute() {
36 public int hashCode() {
39 result = prime * result + Objects.hashCode(xpath);
40 result = prime * result + Boolean.hashCode(absolute);
45 public boolean equals(final Object obj) {
52 if (getClass() != obj.getClass()) {
55 RevisionAwareXPathImpl other = (RevisionAwareXPathImpl) obj;
56 return absolute == other.absolute && Objects.equals(xpath, other.xpath);
60 public String getOriginalString() {