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.parser.spi.meta;
10 import static java.util.Objects.requireNonNull;
13 import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
15 @SuppressWarnings("checkstyle:classTypeParameterName")
16 public abstract class DerivedNamespaceBehaviour<K, V, DK, N extends IdentifierNamespace<K, V>,
17 DN extends IdentifierNamespace<DK, ?>> extends NamespaceBehaviour<K, V, N> {
19 private final Class<DN> derivedFrom;
21 protected DerivedNamespaceBehaviour(final Class<N> identifier, final Class<DN> derivedFrom) {
23 this.derivedFrom = requireNonNull(derivedFrom);
26 public Class<DN> getDerivedFrom() {
31 public Map<K, V> getAllFrom(final NamespaceStorageNode storage) {
32 throw new UnsupportedOperationException("Virtual namespaces does not support provision of all items.");
36 public abstract V getFrom(NamespaceBehaviour.NamespaceStorageNode storage, K key);
39 public void addTo(final NamespaceStorageNode storage, final K key, final V value) {
43 public abstract DK getSignificantKey(K key);