import com.google.common.collect.Iterables;
import java.util.Arrays;
import java.util.Iterator;
-import java.util.List;
import java.util.NoSuchElementException;
+import java.util.Objects;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
import org.opendaylight.yangtools.concepts.Immutable;
return ret;
}
- /**
- * Returns the complete path to schema node.
- *
- * @return list of <code>QNameWithPredicate</code> instances which
- * represents complete path to schema node
- *
- * @deprecated Use {@link #getPathFromRoot()} instead.
- */
- @Deprecated
- public List<QNameWithPredicate> getPath() {
- return getLegacyPath();
- }
-
- protected LeafRefPath(final LeafRefPath parent,
- final QNameWithPredicate qname) {
+ protected LeafRefPath(final LeafRefPath parent, final QNameWithPredicate qname) {
this.parent = parent;
this.qname = qname;
- int h = parent == null ? 0 : parent.hashCode();
+ int h = Objects.hashCode(parent);
if (qname != null) {
h = h * 31 + qname.hashCode();
}
return false;
}
final LeafRefPath other = (LeafRefPath) obj;
-
- if (qname != null) {
- if (!qname.equals(other.qname)) {
- return false;
- }
- } else {
- if (other.qname != null) {
- return false;
- }
- }
-
- if (parent == null) {
- return other.parent == null;
- }
- return parent.equals(other.parent);
+ return Objects.equals(qname, other.qname) && Objects.equals(parent, other.parent);
}
@Override