Merge branch 'master' of ../controller
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / IdentitySchemaNode.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.yang.model.api;
9
10 import java.util.Set;
11 import org.eclipse.jdt.annotation.NonNull;
12
13 /**
14  * Interface describing YANG 'identity' statement.
15  *
16  * <p>
17  * The 'identity' statement is used to define a new globally unique, abstract, and untyped identity. Its only purpose
18  * is to denote its name, semantics, and existence. The built-in datatype "identityref" can be used to reference
19  * identities within a data model.
20  */
21 public interface IdentitySchemaNode extends SchemaNode {
22     /**
23      * Return base identities of this identity. The semantics of differ between RFC6020 and RFC7950 here. YANG 1.0
24      * uses single inheritance, where there can be 0..1 base identities. YANG 1.1 uses multiple inheritance, where
25      * there can be 0..N base identities.
26      *
27      * <p>
28      * Callers should be prepared to handle multiple base identities.
29      *
30      * @return set of existing identities from which the new identity is derived or an empty Set if the identity is
31      *         a root identity.
32      */
33     @NonNull Set<IdentitySchemaNode> getBaseIdentities();
34
35     /**
36      * Get identities derived from this identity.
37      *
38      * @return collection of identities derived from this identity
39      */
40     @NonNull Set<IdentitySchemaNode> getDerivedIdentities();
41 }