Use Optional.isEmpty()
[yangtools.git] / data / yang-data-tree-ri / src / main / java / org / opendaylight / yangtools / yang / data / tree / impl / AutomaticLifecycleMixin.java
index 1eb0c1f4be54ee49dee4d4d664562bd9b8cba76f..89467acdbb69ae6e5ff9fe5f83994f9749584912 100644 (file)
@@ -54,7 +54,7 @@ final class AutomaticLifecycleMixin {
             }
             // Delete with children, implies it really is an empty write
             ret = Optional.of(writeDelegate.applyWrite(modification, emptyNode, storeMeta, version));
-        } else if (modification.getOperation() == LogicalOperation.TOUCH && !storeMeta.isPresent()) {
+        } else if (modification.getOperation() == LogicalOperation.TOUCH && storeMeta.isEmpty()) {
             ret = applyTouch(delegate, emptyNode, modification, storeMeta, version);
         } else {
             // No special handling required here, run normal apply operation
@@ -85,7 +85,7 @@ final class AutomaticLifecycleMixin {
 
         // We are pulling the 'disappear' trick, but what we report can be three different things
         final ModificationType finalType;
-        if (!storeMeta.isPresent()) {
+        if (storeMeta.isEmpty()) {
             // ... there was nothing in the datastore, no change
             finalType = ModificationType.UNMODIFIED;
         } else if (modification.getModificationType() == ModificationType.WRITE) {