This is a common super-interface for ActionStatement and RpcStatement,
make sure we seal it to prevent misuse elsewhere.
Change-Id: I52b29e9f5b845ab19d045847183bf374f01f1fa8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
* is an identifier, followed by a block of substatements that holds
* detailed action information. The argument is the name of the action.
*/
-public interface ActionStatement extends OperationDeclaredStatement {
+public non-sealed interface ActionStatement extends OperationDeclaredStatement {
@Override
default StatementDefinition statementDefinition() {
return YangStmtMapping.ACTION;
* Common interface for action and rpc statements.
*/
@Beta
-public interface OperationDeclaredStatement extends DocumentedDeclaredStatement.WithStatus<QName>,
- IfFeatureAwareDeclaredStatement<QName> {
+public sealed interface OperationDeclaredStatement
+ extends DocumentedDeclaredStatement.WithStatus<QName>, IfFeatureAwareDeclaredStatement<QName>
+ permits ActionStatement, RpcStatement {
default @NonNull Optional<InputStatement> getInput() {
return findFirstDeclaredSubstatement(InputStatement.class);
}
/**
* Declared representation of a {@code rpc} statement.
*/
-public interface RpcStatement extends OperationDeclaredStatement {
+public non-sealed interface RpcStatement extends OperationDeclaredStatement {
@Override
default StatementDefinition statementDefinition() {
return YangStmtMapping.RPC;