Optional<Thing> legacyThingOptional = clip2BridgeHandler.getLegacyThing(idv1);
if (legacyThingOptional.isPresent()) {
Thing legacyThing = legacyThingOptional.get();
- thingId = legacyThing.getUID().getId();
String legacyLabel = legacyThing.getLabel();
thingLabel = Objects.nonNull(legacyLabel) ? legacyLabel : thingLabel;
}
if (legacyThingOptional.isPresent()) {
Thing legacyThing = legacyThingOptional.get();
legacyThingUID = legacyThing.getUID().getAsString();
- thingId = legacyThing.getUID().getId();
String legacyLabel = legacyThing.getLabel();
thingLabel = Objects.nonNull(legacyLabel) ? legacyLabel : thingLabel;
}
}
ThingUID legacyBridgeUID = legacyBridge.get().getUID();
- return thingRegistry.getAll().stream() //
+ return thingRegistry.getAll().stream()
.filter(thing -> legacyBridgeUID.equals(thing.getBridgeUID())
- && V1_THING_TYPE_UIDS.contains(thing.getThingTypeUID())) //
- .filter(thing -> {
- Object id = thing.getConfiguration().get(config);
- return (id instanceof String) && targetIdV1.endsWith("/" + (String) id);
- }).findFirst();
+ && V1_THING_TYPE_UIDS.contains(thing.getThingTypeUID())
+ && thing.getConfiguration().get(config) instanceof String id && targetIdV1.endsWith("/" + id))
+ .findFirst();
}
/**