import java.util.Map;
import java.util.Set;
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.yang.model.api.DocumentedNode.WithStatus;
/**
* Contains the methods for getting data and checking properties of the YANG <code>uses</code> substatement.
*/
public interface UsesNode extends WhenConditionAware, WithStatus, CopyableNode {
-
/**
* Returns the schema path to used grouping.
*
* @return schema path to 'grouping' on which this 'uses' statement points
*/
- @Nonnull SchemaPath getGroupingPath();
+ @NonNull SchemaPath getGroupingPath();
/**
* Returns augmentations which were specified in this uses node.
*
* @return Set of augment statements defined under this uses node
*/
- @Nonnull Set<AugmentationSchemaNode> getAugmentations();
+ @NonNull Set<AugmentationSchemaNode> getAugmentations();
/**
- * Some of the properties of each node in the grouping can be refined with
- * the "refine" statement.
+ * Some of the properties of each node in the grouping can be refined with the "refine" statement.
*
- * @return Map, where key is schema path of refined node and value is
- * refined node
+ * @return Map, where key is schema path of refined node and value is refined node
*/
- @Nonnull Map<SchemaPath, SchemaNode> getRefines();
+ @NonNull Map<SchemaPath, SchemaNode> getRefines();
}
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
-import javax.annotation.Nonnull;
import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.model.api.AugmentationSchemaNode;
import org.opendaylight.yangtools.yang.model.api.RevisionAwareXPath;
final class UsesEffectiveStatementImpl extends AbstractEffectiveDocumentedNode<QName, UsesStatement>
implements UsesEffectiveStatement, UsesNode {
- private final SchemaPath groupingPath;
+ private final @NonNull SchemaPath groupingPath;
private final boolean addedByUses;
- private final Map<SchemaPath, SchemaNode> refines;
- private final Set<AugmentationSchemaNode> augmentations;
+ private final @NonNull Map<SchemaPath, SchemaNode> refines;
+ private final @NonNull Set<AugmentationSchemaNode> augmentations;
private final @NonNull List<UnknownSchemaNode> unknownNodes;
- private final RevisionAwareXPath whenCondition;
+ private final @Nullable RevisionAwareXPath whenCondition;
UsesEffectiveStatementImpl(final StmtContext<QName, UsesStatement, EffectiveStatement<QName, UsesStatement>> ctx) {
super(ctx);
whenCondition = findFirstEffectiveSubstatementArgument(WhenEffectiveStatement.class).orElse(null);
}
- @Nonnull
@Override
public SchemaPath getGroupingPath() {
return groupingPath;
}
- @Nonnull
@Override
public Set<AugmentationSchemaNode> getAugmentations() {
return augmentations;
return addedByUses;
}
- @Nonnull
@Override
public Map<SchemaPath, SchemaNode> getRefines() {
return refines;
}
- @Nonnull
@Override
public List<UnknownSchemaNode> getUnknownSchemaNodes() {
return unknownNodes;
}
- @Nonnull
@Override
public Optional<RevisionAwareXPath> getWhenCondition() {
return Optional.ofNullable(whenCondition);