config-persister-feature-adapter: use lambdas 68/57168/2
authorStephen Kitt <skitt@redhat.com>
Tue, 16 May 2017 15:48:50 +0000 (17:48 +0200)
committerRobert Varga <nite@hq.sk>
Tue, 16 May 2017 23:28:27 +0000 (23:28 +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: Ie1c0dda47a741196de89c95cec49fff572904153
Signed-off-by: Stephen Kitt <skitt@redhat.com>
opendaylight/config/config-persister-feature-adapter/src/main/java/org/opendaylight/controller/configpusherfeature/internal/FeatureServiceCustomizer.java

index 9a1764e..0320ea2 100644 (file)
@@ -14,7 +14,6 @@ import org.apache.karaf.features.Feature;
 import org.apache.karaf.features.FeaturesListener;
 import org.apache.karaf.features.FeaturesService;
 import org.opendaylight.controller.config.persist.api.ConfigPusher;
-import org.opendaylight.controller.config.persist.storage.file.xml.FeatureListProvider;
 import org.opendaylight.controller.config.persist.storage.file.xml.XmlFileStorageAdapter;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
@@ -41,12 +40,7 @@ public class FeatureServiceCustomizer implements ServiceTrackerCustomizer<Featur
                 installedFeatureIds.add(installedFeature.getId());
             }
 
-            currentPersister.get().setFeaturesService(new FeatureListProvider() {
-                @Override
-                public Set<String> listFeatures() {
-                    return installedFeatureIds;
-                }
-            });
+            currentPersister.get().setFeaturesService(() -> installedFeatureIds);
         }
         ConfigFeaturesListener configFeaturesListener = new ConfigFeaturesListener(configPusher, featureService);
         registration = bc.registerService(FeaturesListener.class.getCanonicalName(), configFeaturesListener, null);

©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.