*/
package org.opendaylight.yangtools.yang.data.util;
-
import com.google.common.collect.FluentIterable;
import com.google.common.collect.ImmutableSet;
import java.util.Collections;
@Override
public T getIdentifier() {
return identifier;
- };
+ }
protected DataSchemaContextNode(final T identifier, final SchemaNode schema) {
- super();
this.identifier = identifier;
if (schema instanceof DataSchemaNode) {
this.dataSchemaNode = (DataSchemaNode) schema;
return Collections.singleton(identifier.getNodeType());
}
- public abstract @Nullable DataSchemaContextNode<?> getChild(final PathArgument child);
+ @Nullable public abstract DataSchemaContextNode<?> getChild(PathArgument child);
- public abstract @Nullable DataSchemaContextNode<?> getChild(QName child);
+ @Nullable public abstract DataSchemaContextNode<?> getChild(QName child);
public abstract boolean isLeaf();
- public @Nullable DataSchemaNode getDataSchemaNode() {
+ @Nullable public DataSchemaNode getDataSchemaNode() {
return dataSchemaNode;
}
- static final DataSchemaNode findChildSchemaNode(final DataNodeContainer parent, final QName child) {
+ static DataSchemaNode findChildSchemaNode(final DataNodeContainer parent, final QName child) {
DataSchemaNode potential = parent.getDataChildByName(child);
if (potential == null) {
Iterable<ChoiceSchemaNode> choices = FluentIterable.from(
static DataSchemaContextNode<?> fromSchemaAndQNameChecked(final DataNodeContainer schema, final QName child) {
DataSchemaNode result = findChildSchemaNode(schema, child);
// We try to look up if this node was added by augmentation
- if ((schema instanceof DataSchemaNode) && result.isAugmenting()) {
+ if (result != null && (schema instanceof DataSchemaNode) && result.isAugmenting()) {
return fromAugmentation(schema, (AugmentationTarget) schema, result);
}
return fromDataSchemaNode(result);
/**
* Returns a DataContextNodeOperation for provided child node
*
+ * <p>
* If supplied child is added by Augmentation this operation returns a
* DataContextNodeOperation for augmentation, otherwise returns a
* DataContextNodeOperation for child as call for
* {@link #fromDataSchemaNode(DataSchemaNode)}.
- *
- *
- * @param parent
- * @param parentAug
- * @param child
- * @return
*/
- static @Nullable DataSchemaContextNode<?> fromAugmentation(final DataNodeContainer parent,
+ @Nullable static DataSchemaContextNode<?> fromAugmentation(final DataNodeContainer parent,
final AugmentationTarget parentAug, final DataSchemaNode child) {
AugmentationSchema augmentation = null;
for (AugmentationSchema aug : parentAug.getAvailableAugmentations()) {
return fromDataSchemaNode(child);
}
- public static @Nullable DataSchemaContextNode<?> fromDataSchemaNode(final DataSchemaNode potential) {
+ @Nullable public static DataSchemaContextNode<?> fromDataSchemaNode(final DataSchemaNode potential) {
if (potential instanceof ContainerSchemaNode) {
return new ContainerContextNode((ContainerSchemaNode) potential);
} else if (potential instanceof ListSchemaNode) {