Populate data/ hierarchy
[yangtools.git] / yang / rfc6241-model-api / src / main / java / org / opendaylight / yangtools / rfc6241 / model / api / NetconfStatements.java
1 /*
2  * Copyright (c) 2019 PANTHEON.tech, s.r.o. 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.rfc6241.model.api;
9
10 import static java.util.Objects.requireNonNull;
11
12 import com.google.common.annotations.Beta;
13 import java.util.Optional;
14 import org.eclipse.jdt.annotation.NonNullByDefault;
15 import org.opendaylight.yangtools.yang.common.QName;
16 import org.opendaylight.yangtools.yang.model.api.meta.ArgumentDefinition;
17 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
18 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
19 import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
20
21 /**
22  * {@link StatementDefinition}s for statements defined by RFC6241.
23  *
24  * @author Robert Varga
25  */
26 @Beta
27 @NonNullByDefault
28 public enum NetconfStatements implements StatementDefinition {
29     GET_FILTER_ELEMENT_ATTRIBUTES(QName.create(NetconfConstants.RFC6241_MODULE, "get-filter-element-attributes"),
30         GetFilterElementAttributesStatement.class, GetFilterElementAttributesEffectiveStatement.class);
31
32     private final Class<? extends EffectiveStatement<?, ?>> effectiveRepresentation;
33     private final Class<? extends DeclaredStatement<?>> declaredRepresentation;
34     private final QName statementName;
35
36     NetconfStatements(final QName statementName, final Class<? extends DeclaredStatement<?>> declaredRepresentation,
37             final Class<? extends EffectiveStatement<?, ?>> effectiveRepresentation) {
38         this.statementName = statementName.intern();
39         this.declaredRepresentation = requireNonNull(declaredRepresentation);
40         this.effectiveRepresentation = requireNonNull(effectiveRepresentation);
41     }
42
43     @Override
44     public Optional<ArgumentDefinition> getArgumentDefinition() {
45         return Optional.empty();
46     }
47
48     @Override
49     public QName getStatementName() {
50         return statementName;
51     }
52
53     @Override
54     public Class<? extends EffectiveStatement<?, ?>> getEffectiveRepresentationClass() {
55         return effectiveRepresentation;
56     }
57
58     @Override
59     public Class<? extends DeclaredStatement<?>> getDeclaredRepresentationClass() {
60         return declaredRepresentation;
61     }
62 }