config-persister-directory-xml: use lambdas 67/57167/2
authorStephen Kitt <skitt@redhat.com>
Tue, 16 May 2017 15:48:35 +0000 (17:48 +0200)
committerRobert Varga <nite@hq.sk>
Tue, 16 May 2017 23:29:22 +0000 (23:29 +0000)
This series of patches uses lambdas instead of anonymous classes for
functional interfaces when possible. Lambdas are replaced with method
references when appropriate.

Change-Id: I007db062e0b4cabcf56ddbe31039a548e6426017
Signed-off-by: Stephen Kitt <skitt@redhat.com>
opendaylight/config/config-persister-directory-xml-adapter/src/main/java/org/opendaylight/controller/config/persist/storage/directory/xml/XmlDirectoryPersister.java

index 383eb82..10fb270 100644 (file)
@@ -142,12 +142,9 @@ public class XmlDirectoryPersister implements Persister {
     private static FilenameFilter getFilter(final Set<String>fileExtensions) {
         checkArgument(fileExtensions.isEmpty() == false, "No file extension provided", fileExtensions);
 
-        return new FilenameFilter() {
-            @Override
-            public boolean accept(final File dir, final String name) {
-                String ext = Files.getFileExtension(name);
-                return fileExtensions.contains(ext);
-            }
+        return (dir, name) -> {
+            String ext = Files.getFileExtension(name);
+            return fileExtensions.contains(ext);
         };
     }
 

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.