import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import java.net.URI;
-import java.util.Collection;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import javax.annotation.Nonnull;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.QNameModule;
+import org.opendaylight.yangtools.yang.model.api.ActionDefinition;
import org.opendaylight.yangtools.yang.model.api.AugmentationSchema;
import org.opendaylight.yangtools.yang.model.api.NamespaceRevisionAware;
import org.opendaylight.yangtools.yang.model.api.NotificationDefinition;
import org.opendaylight.yangtools.yang.model.api.stmt.AugmentStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
+import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContextUtils;
public final class AugmentEffectiveStatementImpl extends
AbstractEffectiveDocumentedDataNodeContainer<SchemaNodeIdentifier, AugmentStatement> implements
private final URI namespace;
private final Date revision;
private final int order;
+ private final Set<ActionDefinition> actions;
private final Set<NotificationDefinition> notifications;
private final List<UnknownSchemaNode> unknownNodes;
private final RevisionAwareXPath whenCondition;
this.targetPath = ctx.getStatementArgument().asSchemaPath();
- final QNameModule rootModuleQName = Utils.getRootModuleQName(ctx);
+ final QNameModule rootModuleQName = StmtContextUtils.getRootModuleQName(ctx);
this.namespace = rootModuleQName.getNamespace();
this.revision = rootModuleQName.getRevision();
this.copyOf = ctx.getOriginalCtx() == null ? null : (AugmentationSchema) ctx.getOriginalCtx().buildEffective();
final WhenEffectiveStatementImpl whenStmt = firstEffective(WhenEffectiveStatementImpl.class);
- this.whenCondition = (whenStmt == null) ? null : whenStmt.argument();
+ this.whenCondition = whenStmt == null ? null : whenStmt.argument();
// initSubstatementCollections
- final Collection<? extends EffectiveStatement<?, ?>> effectiveSubstatements = effectiveSubstatements();
+ final ImmutableSet.Builder<ActionDefinition> actionsBuilder = ImmutableSet.builder();
final ImmutableSet.Builder<NotificationDefinition> notificationsBuilder = ImmutableSet.builder();
final ImmutableList.Builder<UnknownSchemaNode> listBuilder = new ImmutableList.Builder<>();
- for (final EffectiveStatement<?, ?> effectiveStatement : effectiveSubstatements) {
- if (effectiveStatement instanceof NotificationDefinition) {
+ for (final EffectiveStatement<?, ?> effectiveStatement : effectiveSubstatements()) {
+ if (effectiveStatement instanceof ActionDefinition) {
+ actionsBuilder.add((ActionDefinition) effectiveStatement);
+ } else if (effectiveStatement instanceof NotificationDefinition) {
notificationsBuilder.add((NotificationDefinition) effectiveStatement);
} else if (effectiveStatement instanceof UnknownSchemaNode) {
listBuilder.add((UnknownSchemaNode) effectiveStatement);
}
}
+
+ this.actions = actionsBuilder.build();
this.notifications = notificationsBuilder.build();
this.unknownNodes = listBuilder.build();
}
return namespace;
}
+ @Override
+ public Set<ActionDefinition> getActions() {
+ return actions;
+ }
+
@Override
public Set<NotificationDefinition> getNotifications() {
return notifications;