- @Override
- public Optional<ModificationApplyOperation> getChild(final PathArgument child) {
- throw new IllegalArgumentException();
+ public static SchemaAwareApplyOperation from(final DataNodeContainer resolvedTree,
+ final AugmentationTarget augSchemas, final AugmentationIdentifier identifier) {
+ AugmentationSchema augSchema = null;
+ allAugments : for (AugmentationSchema potential : augSchemas.getAvailableAugmentations()) {
+ boolean containsAll = true;
+ for(DataSchemaNode child : potential.getChildNodes()) {
+ if(identifier.getPossibleChildNames().contains(child.getQName())) {
+ augSchema = potential;
+ break allAugments;
+ }
+ }
+ }
+ if(augSchema != null) {
+ return new AugmentationModificationStrategy(augSchema,resolvedTree);
+ }
+ return null;