static <T extends DataObject> DataTreeModification<T> create( BindingToNormalizedNodeCodec codec, DOMDataTreeCandidate candidate) { final Entry<InstanceIdentifier<?>, BindingCodecTreeNode<?>> codecCtx = codec.getSubtreeCodec(candidate.getRootPath().getRootIdentifier()); final DataTreeIdentifier<?> path = DataTreeIdentifier.create(candidate.getRootPath().getDatastoreType(), codecCtx.getKey()); final DataObjectModification<?> modification = LazyDataObjectModification.create(codecCtx.getValue(), candidate.getRootNode()); return new LazyDataTreeModification(path, modification); }
@SuppressWarnings({"unchecked", "rawtypes"}) static <T extends DataObject> DataTreeModification<T> create( final BindingToNormalizedNodeCodec codec, final DataTreeCandidate domChange, final LogicalDatastoreType datastoreType) { final Entry<InstanceIdentifier<?>, BindingCodecTreeNode<?>> codecCtx = codec.getSubtreeCodec(domChange.getRootPath()); final DataTreeIdentifier<?> path = DataTreeIdentifier.create(datastoreType, codecCtx.getKey()); final DataObjectModification<?> modification = LazyDataObjectModification.create(codecCtx.getValue(), domChange.getRootNode()); return new LazyDataTreeModification(path, modification); }