2 * Copyright (c) 2014 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.binding;
10 public class KeyedInstanceIdentifier<T extends Identifiable<K> & DataObject, K extends Identifier<T>> extends InstanceIdentifier<T> {
13 KeyedInstanceIdentifier(final Class<T> type, final Iterable<PathArgument> pathArguments, final boolean wildcarded, final int hash, final K key) {
14 super(type, pathArguments, wildcarded, hash);
18 public final K getKey() {
23 public final InstanceIdentifierBuilder<T> builder() {
24 return new InstanceIdentifierBuilderImpl<T>(new InstanceIdentifier.IdentifiableItem<T, K>(getTargetType(), key), getPathArguments(), hashCode(), isWildcarded());
28 protected boolean fastNonEqual(final InstanceIdentifier<?> other) {
29 final KeyedInstanceIdentifier<?, ?> kii = (KeyedInstanceIdentifier<?, ?>) other;
32 * We could do an equals() here, but that may actually be expensive.
33 * equals() in superclass falls back to a full compare, which will
34 * end up running that equals anyway, so do not bother here.
36 return (key == null) != (kii.key == null);