026a0a04093681f3b537f9408e1e6f5591c0ab47
[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     @Nullable
55     <K, V, N extends IdentifierNamespace<? super K, ? extends V>> V get(@Nonnull Class<N> namespace,@Nonnull  K identifier);
56
57     /**
58      *
59      * Returns all local values from supplied namespace.
60      *
61      * @param <K>
62      *            Identifier type
63      * @param <V>
64      *            Value type
65      * @param <N>
66      *            Namespace identifier type
67      * @param namespace
68      *            Namespace type
69      * @return Value if present, null otherwise.
70      */
71     @Nullable
72     <K, V, N extends IdentifierNamespace<K, V>> Map<K, V> getAll(@Nonnull Class<N> namespace);
73
74     /**
75      *
76      * Returns iteration of all effective substatements.
77      *
78      * @return iteration of all effective substatements.
79      */
80     Collection<? extends EffectiveStatement<?, ?>> effectiveSubstatements();
81
82 }