3a28984882805ec8920d2421b3ac04c10a8579f7
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / meta / IdentifierNamespace.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 javax.annotation.Nonnull;
11 import javax.annotation.Nullable;
12 /**
13  *
14  * Model specific namespace which allows access to specific
15  *
16  * {@link IdentifierNamespace} serves as common superclass for YANG model
17  * namespaces, which are type-captured subclasses. This type capture
18  * of namespace allows for handy type-safe reading methods
19  * such as {@link EffectiveStatement#get(Class, Object)} and still
20  * allows introduction of new namespaces without need to change
21  * model APIs.
22  *
23  * @param <K> Identifier type
24  * @param <V> Value type
25  */
26 public interface IdentifierNamespace<K,V> {
27
28     /**
29      *
30      * Returns value associated with supplied identifier
31      *
32      * @param identifier Identifier of value
33      * @return value or null, if identifier is not present in namespace.
34      */
35     @Nullable V get(@Nonnull K identifier);
36
37 }