2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.yangtools.yang.model.api.meta;
10 import javax.annotation.Nonnull;
11 import javax.annotation.Nullable;
14 * Model specific namespace which allows access to specific
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
23 * @param <K> Identifier type
24 * @param <V> Value type
26 public interface IdentifierNamespace<K,V> {
28 * Returns value associated with supplied identifier.
30 * @param identifier Identifier of value
31 * @return value or null, if identifier is not present in namespace.
33 @Nullable V get(@Nonnull K identifier);