Skip to content

Commit

Permalink
[dsmr] Make eclipse happy again.
Browse files Browse the repository at this point in the history
Don't ask...

Signed-off-by: Hilbrand Bouwkamp <[email protected]>
  • Loading branch information
Hilbrand committed Jan 7, 2021
1 parent a237634 commit de3f721
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@
*/
package org.openhab.binding.dsmr.internal.discovery;

import java.util.*;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;

import org.eclipse.jdt.annotation.NonNullByDefault;
Expand Down Expand Up @@ -143,10 +147,9 @@ private void validateConfiguredMeters(List<Thing> things, Set<DSMRMeterType> con
.map(Thing::getHandler)
.filter(DSMRMeterHandler.class::isInstance)
.map(DSMRMeterHandler.class::cast)
.map(h -> h == null ? null : h.getMeterDescriptor())
.map(d -> Optional.ofNullable(d == null ? null : d.getMeterType()))
.filter(Optional::isPresent)
.map(Optional::get)
.map(DSMRMeterHandler::getMeterDescriptor)
.filter(Objects::nonNull)
.map(d -> d.getMeterType())
.collect(Collectors.toSet());
// @formatter:on
// Create list of all configured meters that are not in the detected list. If not empty meters might not be
Expand Down

0 comments on commit de3f721

Please sign in to comment.