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 com.google.common.base.Preconditions;
12 import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
14 public abstract class DerivedNamespaceBehaviour<K, V, N extends IdentifierNamespace<K, V>, T extends IdentifierNamespace<?, ?>>
15 extends NamespaceBehaviour<K, V, N> {
17 private Class<T> derivedFrom;
19 protected DerivedNamespaceBehaviour(Class<N> identifier, Class<T> derivedFrom) {
21 this.derivedFrom = Preconditions.checkNotNull(derivedFrom);
24 public Class<T> getDerivedFrom() {
29 public Map<K, V> getAllFrom(NamespaceStorageNode storage) {
30 throw new UnsupportedOperationException("Virtual namespaces does not support provision of all items.");
34 public abstract V getFrom(NamespaceBehaviour.NamespaceStorageNode storage, K key);
37 public void addTo(NamespaceStorageNode storage, K key, V value) {