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