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.rfc6536.model.api;
10 import static java.util.Objects.requireNonNull;
12 import java.util.Optional;
13 import org.eclipse.jdt.annotation.NonNullByDefault;
14 import org.opendaylight.yangtools.yang.common.QName;
15 import org.opendaylight.yangtools.yang.model.api.meta.ArgumentDefinition;
16 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
17 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
18 import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
21 * {@link StatementDefinition}s for statements defined by RFC6536.
23 * @author Robert Varga
26 public enum NACMStatements implements StatementDefinition {
27 DEFAULT_DENY_ALL(QName.create(NACMConstants.RFC6536_MODULE, "default-deny-all"), DefaultDenyAllStatement.class,
28 DefaultDenyAllEffectiveStatement.class),
29 DEFAULT_DENY_WRITE(QName.create(NACMConstants.RFC6536_MODULE, "default-deny-write"),
30 DefaultDenyWriteStatement.class, DefaultDenyWriteEffectiveStatement.class);
32 private final Class<? extends EffectiveStatement<?, ?>> effectiveRepresentation;
33 private final Class<? extends DeclaredStatement<?>> declaredRepresentation;
34 private final QName statementName;
36 NACMStatements(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);
44 public Optional<ArgumentDefinition> getArgumentDefinition() {
45 return Optional.empty();
49 public QName getStatementName() {
54 public Class<? extends EffectiveStatement<?, ?>> getEffectiveRepresentationClass() {
55 return effectiveRepresentation;
59 public Class<? extends DeclaredStatement<?>> getDeclaredRepresentationClass() {
60 return declaredRepresentation;