2 * Copyright (c) 2017 Pantheon Technologies, s.r.o. 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 com.google.common.annotations.Beta;
11 import com.google.common.collect.ForwardingObject;
12 import java.util.Collection;
14 import java.util.Optional;
17 * Utility forwarding implementation of {@link EffectiveStatement} contract. This class is useful for implementing
20 * @author Robert Varga
22 * @param <A> Argument type
23 * @param <D> Declared Statement representation
24 * @param <E> Effective Statement representation
27 public abstract class ForwardingEffectiveStatement<A, D extends DeclaredStatement<A>,
28 E extends EffectiveStatement<A, D>> extends ForwardingObject implements EffectiveStatement<A, D> {
31 protected abstract E delegate();
35 public D getDeclared() {
36 return delegate().getDeclared();
40 public <K, V, N extends IdentifierNamespace<K, V>> Optional<? extends V> get(final Class<N> namespace,
42 return delegate().get(namespace, identifier);
46 public <K, V, N extends IdentifierNamespace<K, V>> Map<K, V> getAll(final Class<N> namespace) {
47 return delegate().getAll(namespace);
51 public Collection<? extends EffectiveStatement<?, ?>> effectiveSubstatements() {
52 return delegate().effectiveSubstatements();
56 public StatementDefinition statementDefinition() {
57 return delegate().statementDefinition();
62 return delegate().argument();
66 public StatementSource getStatementSource() {
67 return delegate().getStatementSource();