import static java.util.Objects.requireNonNull;
import com.google.common.collect.ImmutableList;
-import java.net.URI;
import java.util.Optional;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.yangtools.yang.common.QNameModule;
-import org.opendaylight.yangtools.yang.common.Revision;
import org.opendaylight.yangtools.yang.model.api.AugmentationSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.NamespaceRevisionAware;
-import org.opendaylight.yangtools.yang.model.api.SchemaPath;
+import org.opendaylight.yangtools.yang.model.api.QNameModuleAware;
import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.AugmentEffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.AugmentStatement;
import org.opendaylight.yangtools.yang.parser.spi.source.StatementSourceReference;
final class AugmentEffectiveStatementImpl extends DefaultDataNodeContainer<SchemaNodeIdentifier, AugmentStatement>
- implements AugmentEffectiveStatement, AugmentationSchemaNode, NamespaceRevisionAware,
+ implements AugmentEffectiveStatement, AugmentationSchemaNode, QNameModuleAware,
DocumentedNodeMixin.WithStatus<SchemaNodeIdentifier, AugmentStatement>,
ActionNodeContainerMixin<SchemaNodeIdentifier, AugmentStatement>,
NotificationNodeContainerMixin<SchemaNodeIdentifier, AugmentStatement>,
WhenConditionMixin<SchemaNodeIdentifier, AugmentStatement> {
private final @Nullable AugmentationSchemaNode original;
+ private final @NonNull SchemaNodeIdentifier argument;
private final @NonNull QNameModule rootModuleQName;
private final int flags;
- AugmentEffectiveStatementImpl(final AugmentStatement declared, final int flags, final QNameModule rootModuleQName,
- final ImmutableList<? extends EffectiveStatement<?, ?>> substatements, final StatementSourceReference ref,
- final @Nullable AugmentationSchemaNode original) {
+ AugmentEffectiveStatementImpl(final AugmentStatement declared, final SchemaNodeIdentifier argument, final int flags,
+ final QNameModule rootModuleQName, final ImmutableList<? extends EffectiveStatement<?, ?>> substatements,
+ final StatementSourceReference ref, final @Nullable AugmentationSchemaNode original) {
super(declared, ref, substatements);
+ this.argument = requireNonNull(argument);
this.rootModuleQName = requireNonNull(rootModuleQName);
this.flags = flags;
this.original = original;
}
@Override
- public SchemaNodeIdentifier argument() {
- return getDeclared().argument();
+ public @NonNull SchemaNodeIdentifier argument() {
+ return argument;
}
@Override
return Optional.ofNullable(this.original);
}
- @Override
- public SchemaPath getTargetPath() {
- return argument().asSchemaPath();
- }
-
@Override
public int flags() {
return flags;
}
@Override
- public URI getNamespace() {
- return rootModuleQName.getNamespace();
+ public QNameModule getQNameModule() {
+ return rootModuleQName;
}
@Override
- public Optional<Revision> getRevision() {
- return rootModuleQName.getRevision();
+ public AugmentEffectiveStatement asEffectiveStatement() {
+ return this;
}
@Override
return AugmentEffectiveStatementImpl.class.getSimpleName() + "[" + "targetPath=" + getTargetPath() + ", when="
+ getWhenCondition() + "]";
}
-
}