Merge branch 'master' of ../controller
[yangtools.git] / yang / yang-parser-rfc7950 / src / main / java / org / opendaylight / yangtools / yang / parser / rfc7950 / stmt / config / EmptyConfigEffectiveStatement.java
1 /*
2  * Copyright (c) 2016 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.parser.rfc7950.stmt.config;
9
10 import com.google.common.collect.ImmutableList;
11 import java.util.Collection;
12 import java.util.Map;
13 import java.util.Optional;
14 import org.eclipse.jdt.annotation.NonNull;
15 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
16 import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
17 import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
18 import org.opendaylight.yangtools.yang.model.api.meta.StatementSource;
19 import org.opendaylight.yangtools.yang.model.api.stmt.ConfigEffectiveStatement;
20 import org.opendaylight.yangtools.yang.model.api.stmt.ConfigStatement;
21
22 abstract class EmptyConfigEffectiveStatement implements ConfigEffectiveStatement {
23     static final EmptyConfigEffectiveStatement FALSE = new EmptyConfigEffectiveStatement() {
24         @Override
25         public ConfigStatement getDeclared() {
26             return EmptyConfigStatement.FALSE;
27         }
28     };
29
30     static final EmptyConfigEffectiveStatement TRUE = new EmptyConfigEffectiveStatement() {
31         @Override
32         public ConfigStatement getDeclared() {
33             return EmptyConfigStatement.TRUE;
34         }
35     };
36
37     private EmptyConfigEffectiveStatement() {
38         // Hidden
39     }
40
41     @Override
42     public final StatementDefinition statementDefinition() {
43         return getDeclared().statementDefinition();
44     }
45
46     @Override
47     public final Boolean argument() {
48         return getDeclared().argument();
49     }
50
51     @Override
52     public final StatementSource getStatementSource() {
53         return getDeclared().getStatementSource();
54     }
55
56     @Override
57     public final <K, V, N extends IdentifierNamespace<K, V>> Optional<? extends V> get(final Class<N> namespace,
58             final K identifier) {
59         throw new UnsupportedOperationException("Not implemented yet.");
60     }
61
62     @Override
63     public final <K, V, N extends IdentifierNamespace<K, V>> Map<K, V> getAll(final Class<N> namespace) {
64         throw new UnsupportedOperationException("Not implemented yet.");
65     }
66
67     @Override
68     public final Collection<? extends EffectiveStatement<?, ?>> effectiveSubstatements() {
69         return ImmutableList.of();
70     }
71
72     @Override
73     public abstract @NonNull ConfigStatement getDeclared();
74 }