package org.opendaylight.yangtools.yang.data.impl.schema.builder.impl;
import java.util.Map;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode;
super(node);
}
- public static DataContainerNodeBuilder<AugmentationIdentifier, AugmentationNode> create() {
+ public static @NonNull DataContainerNodeBuilder<AugmentationIdentifier, AugmentationNode> create() {
return new ImmutableAugmentationNodeBuilder();
}
- public static DataContainerNodeBuilder<AugmentationIdentifier, AugmentationNode> create(final int sizeHint) {
+ public static @NonNull DataContainerNodeBuilder<AugmentationIdentifier, AugmentationNode> create(
+ final int sizeHint) {
return new ImmutableAugmentationNodeBuilder(sizeHint);
}
- public static DataContainerNodeBuilder<AugmentationIdentifier, AugmentationNode> create(
+ public static @NonNull DataContainerNodeBuilder<AugmentationIdentifier, AugmentationNode> create(
final AugmentationNode node) {
if (!(node instanceof ImmutableAugmentationNode)) {
throw new UnsupportedOperationException(String.format("Cannot initialize from class %s", node.getClass()));
@Override
public DataContainerNodeBuilder<AugmentationIdentifier, AugmentationNode> withChild(
- final DataContainerChild<?, ?> child) {
+ final DataContainerChild child) {
// Check nested augments
DataValidationException.checkLegalData(!(child instanceof AugmentationNode),
"Unable to add: %s, as a child for: %s, Nested augmentations are not permitted", child.getNodeType(),
}
private static final class ImmutableAugmentationNode
- extends AbstractImmutableDataContainerNode<AugmentationIdentifier> implements AugmentationNode {
+ extends AbstractImmutableDataContainerNode<AugmentationIdentifier, AugmentationNode>
+ implements AugmentationNode {
ImmutableAugmentationNode(final AugmentationIdentifier nodeIdentifier,
- final Map<PathArgument, DataContainerChild<? extends PathArgument, ?>> children) {
+ final Map<PathArgument, Object> children) {
super(children, nodeIdentifier);
}
+
+ @Override
+ protected Class<AugmentationNode> implementedType() {
+ return AugmentationNode.class;
+ }
}
}