mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
review feedback
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
This commit is contained in:
parent
de9a5d5312
commit
34bc112011
@ -36,10 +36,10 @@ import org.mapdb.DBMaker;
|
||||
import org.openhab.core.OpenHAB;
|
||||
import org.openhab.core.common.ThreadPoolManager;
|
||||
import org.openhab.core.items.Item;
|
||||
import org.openhab.core.items.ManagedItemProvider.PersistedItem;
|
||||
import org.openhab.core.library.types.DateTimeType;
|
||||
import org.openhab.core.persistence.FilterCriteria;
|
||||
import org.openhab.core.persistence.HistoricItem;
|
||||
import org.openhab.core.persistence.PersistedItem;
|
||||
import org.openhab.core.persistence.PersistenceItemInfo;
|
||||
import org.openhab.core.persistence.PersistenceService;
|
||||
import org.openhab.core.persistence.QueryablePersistenceService;
|
||||
@ -165,7 +165,7 @@ public class MapDbPersistenceService implements QueryablePersistenceService {
|
||||
@Override
|
||||
public Set<PersistenceItemInfo> getItemInfo() {
|
||||
return map.values().stream().map(this::deserialize).flatMap(MapDbPersistenceService::streamOptional)
|
||||
.collect(Collectors.<PersistenceItemInfo> toUnmodifiableSet());
|
||||
.collect(Collectors.<PersistenceItemInfo>toUnmodifiableSet());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -217,7 +217,7 @@ public class MapDbPersistenceService implements QueryablePersistenceService {
|
||||
return null;
|
||||
}
|
||||
Optional<MapDbItem> item = deserialize(json);
|
||||
return item.isPresent() ? item.get() : null;
|
||||
return item.orElse(null);
|
||||
}
|
||||
|
||||
private String serialize(MapDbItem item) {
|
||||
|
Loading…
Reference in New Issue
Block a user