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.binding;
10 import java.util.ArrayList;
11 import java.util.Collections;
12 import java.util.List;
15 * Uniquely identifies instance of data tree.
19 public class InstanceIdentifier {
21 private final List<PathArgument> path;
22 private final Class<? extends DataObject> targetType;
24 public InstanceIdentifier(Class<? extends DataObject> type) {
25 path = Collections.emptyList();
26 this.targetType = type;
29 public InstanceIdentifier(List<PathArgument> path, Class<? extends DataObject> type) {
30 this.path = Collections.<PathArgument> unmodifiableList(new ArrayList<>(path));
31 this.targetType = type;
38 public List<PathArgument> getPath() {
42 public Class<?> getTargetType() {
43 return this.targetType;
47 * Path argument of instance identifier.
49 * Interface which implementations are used as path components of the
55 interface PathArgument {
59 public static class IdentifiableItem<I extends Identifiable<T>, T extends Identifier<I>> implements PathArgument {
62 private final Class<? extends I> type;
64 public IdentifiableItem(Class<I> type, T key) {
73 Class<? extends I> getType() {