/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2015, 2016 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
import com.google.common.collect.Collections2;
import java.util.Collection;
import java.util.Collections;
+import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
}
@Override
+ @Nonnull
public Collection<DataTreeCandidateNode> getChildNodes() {
switch (mod.getModificationType()) {
+ case APPEARED:
+ case DISAPPEARED:
case SUBTREE_MODIFIED:
return Collections2.transform(mod.getChildren(), new Function<ModifiedNode, DataTreeCandidateNode>() {
@Override
}
@Override
+ @Nonnull
public ModificationType getModificationType() {
return Verify.verifyNotNull(mod.getModificationType(), "Node %s does not have resolved modification type", mod);
}
private static Optional<NormalizedNode<?, ?>> optionalData(final TreeNode meta) {
if (meta != null) {
- return Optional.<NormalizedNode<?,?>>of(meta.getData());
+ return Optional.of(meta.getData());
} else {
return Optional.absent();
}
}
@Override
+ @Nonnull
public final Optional<NormalizedNode<?, ?>> getDataAfter() {
return optionalData(newMeta);
}
@Override
+ @Nonnull
public final Optional<NormalizedNode<?, ?>> getDataBefore() {
return optionalData(oldMeta);
}
@Override
public final DataTreeCandidateNode getModifiedChild(final PathArgument identifier) {
switch (mod.getModificationType()) {
+ case APPEARED:
+ case DISAPPEARED:
case SUBTREE_MODIFIED:
final Optional<ModifiedNode> childMod = mod.getChild(identifier);
if (childMod.isPresent()) {
}
@Override
+ @Nonnull
public PathArgument getIdentifier() {
return getMod().getIdentifier();
}
}
-}
\ No newline at end of file
+
+ @Override
+ public String toString() {
+ return this.getClass().getSimpleName() + "{mod = " + this.mod + ", oldMeta = " + this.oldMeta + ", newMeta = " +
+ this.newMeta + "}";
+ }
+}