2b1e7e052eae72e2976c6632cd2f384aa024e9ef
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / meta / EffectiveStatement.java
1 /*
2  * Copyright (c) 2015 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.meta;
9
10 import java.util.Collection;
11 import java.util.Map;
12 import javax.annotation.Nonnull;
13 import javax.annotation.Nullable;
14
15 /**
16  * Effective model statement which should be used to derive application behaviour.
17  *
18  * @param <A>
19  *            Argument type ({@link Void} if statement does not have argument.)
20  * @param <S>
21  *            Class representing declared version of this statement.
22  */
23 public interface EffectiveStatement<A, S extends DeclaredStatement<A>> extends ModelStatement<A> {
24
25     /**
26      * Returns statement, which was explicit declaration of this effective
27      * statement.
28      *
29      *
30      * @return statement, which was explicit declaration of this effective
31      *         statement or null if statement was inferred from context.
32      */
33     @Nullable
34     S getDeclared();
35
36     /**
37      *
38      * Returns value associated with supplied identifier
39      *
40      * @param <K>
41      *            Identifier type
42      * @param <V>
43      *            Value type
44      * @param <N>
45      *            Namespace identifier type
46      * @param namespace
47      *            Namespace type
48      * @param identifier
49      *            Identifier of element.
50      * @return Value if present, null otherwise.
51      *
52      *
53      */
54     //<K, V, N extends IdentifierNamespace<? super K, ? extends V>> V
55     @Nullable
56     <K,V,N extends IdentifierNamespace<K, V>> V get(@Nonnull Class<N> namespace,@Nonnull  K identifier);
57
58     /**
59      *
60      * Returns all local values from supplied namespace.
61      *
62      * @param <K>
63      *            Identifier type
64      * @param <V>
65      *            Value type
66      * @param <N>
67      *            Namespace identifier type
68      * @param namespace
69      *            Namespace type
70      * @return Value if present, null otherwise.
71      */
72     @Nullable
73     <K, V, N extends IdentifierNamespace<K, V>> Map<K, V> getAll(@Nonnull Class<N> namespace);
74
75     /**
76      *
77      * Returns iteration of all effective substatements.
78      *
79      * @return iteration of all effective substatements.
80      */
81     Collection<? extends EffectiveStatement<?, ?>> effectiveSubstatements();
82
83 }