2 * Copyright (c) 2020 PANTHEON.tech, 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.parser.rfc7950.stmt.key;
10 import java.util.Collection;
11 import org.opendaylight.yangtools.yang.model.api.stmt.KeyEffectiveStatement;
12 import org.opendaylight.yangtools.yang.model.api.stmt.KeyStatement;
13 import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier;
14 import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractDeclaredEffectiveStatement;
16 abstract class AbstractKeyEffectiveStatement
17 extends AbstractDeclaredEffectiveStatement.Default<Collection<SchemaNodeIdentifier>, KeyStatement>
18 implements KeyEffectiveStatement {
19 abstract static class Foreign extends AbstractKeyEffectiveStatement {
20 // Polymorphic, with single value or a collection
21 private final Object argument;
23 Foreign(final KeyStatement declared, final Collection<SchemaNodeIdentifier> argument) {
25 this.argument = KeyStatementSupport.maskCollection(argument);
29 public final Collection<SchemaNodeIdentifier> argument() {
30 return KeyStatementSupport.unmaskCollection(argument);
34 abstract static class Local extends AbstractKeyEffectiveStatement {
35 Local(final KeyStatement declared) {
40 public final Collection<SchemaNodeIdentifier> argument() {
41 return getDeclared().argument();
45 AbstractKeyEffectiveStatement(final KeyStatement declared) {