Use Optional.isEmpty()
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / rests / utils / RestconfInvokeOperationsUtil.java
index 8bef7a3f46c83fdd37fa70b266c7ef9d14024721..9eee1b462ee821bf104db9c94bd7ccaa82b75729 100644 (file)
@@ -136,7 +136,7 @@ public final class RestconfInvokeOperationsUtil {
     public static DOMActionResult invokeActionViaMountPoint(final DOMMountPoint mountPoint, final ContainerNode data,
             final Absolute schemaPath, final YangInstanceIdentifier yangIId) {
         final Optional<DOMActionService> mountPointService = mountPoint.getService(DOMActionService.class);
-        if (!mountPointService.isPresent()) {
+        if (mountPointService.isEmpty()) {
             throw new RestconfDocumentedException("DomAction service is missing.");
         }
         return prepareActionResult(mountPointService.get().invokeAction(schemaPath, prepareDataTreeId(yangIId), data));