import static com.google.common.base.Preconditions.checkState;
import java.util.Optional;
-import javax.annotation.Nonnull;
import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateTip;
*
* @return Current tip root node, may not be null.
*/
- @Nonnull protected abstract TreeNode getTipRoot();
+ protected abstract @NonNull TreeNode getTipRoot();
- @NonNull abstract YangInstanceIdentifier getRootPath();
+ abstract @NonNull YangInstanceIdentifier getRootPath();
@Override
public final void validate(final DataTreeModification modification) throws DataValidationFailedException {
final TreeNode currentRoot = getTipRoot();
if (root.getOperation() == LogicalOperation.NONE) {
- return new NoopDataTreeCandidate(YangInstanceIdentifier.EMPTY, root, currentRoot);
+ return new NoopDataTreeCandidate(YangInstanceIdentifier.empty(), root, currentRoot);
}
- final Optional<TreeNode> newRoot = m.getStrategy().apply(m.getRootModification(), Optional.of(currentRoot),
- m.getVersion());
+ final Optional<? extends TreeNode> newRoot = m.getStrategy().apply(m.getRootModification(),
+ Optional.of(currentRoot), m.getVersion());
checkState(newRoot.isPresent(), "Apply strategy failed to produce root node for modification %s", modification);
- return new InMemoryDataTreeCandidate(YangInstanceIdentifier.EMPTY, root, currentRoot, newRoot.get());
+ return new InMemoryDataTreeCandidate(YangInstanceIdentifier.empty(), root, currentRoot, newRoot.get());
}
private static InMemoryDataTreeModification checkedCast(final DataTreeModification mod) {