mirror of
https://github.com/danieldemus/openhab-core.git
synced 2026-07-29 12:34:22 +02:00
Code cleanup: Use Java 17 features (#3580)
* Code cleanup: Use Java 17 features Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
+3
-6
@@ -116,20 +116,17 @@ public class BundleInfoReader {
|
||||
return;
|
||||
}
|
||||
for (Object type : types) {
|
||||
if (type instanceof ThingTypeXmlResult) {
|
||||
ThingTypeXmlResult result = (ThingTypeXmlResult) type;
|
||||
if (type instanceof ThingTypeXmlResult result) {
|
||||
bundleInfo.getThingTypesXml().add(result);
|
||||
if (bundleInfo.getAddonId().isBlank()) {
|
||||
bundleInfo.setAddonId(result.getUID().getBindingId());
|
||||
}
|
||||
} else if (type instanceof ChannelGroupTypeXmlResult) {
|
||||
ChannelGroupTypeXmlResult result = (ChannelGroupTypeXmlResult) type;
|
||||
} else if (type instanceof ChannelGroupTypeXmlResult result) {
|
||||
bundleInfo.getChannelGroupTypesXml().add(result);
|
||||
if (bundleInfo.getAddonId().isBlank()) {
|
||||
bundleInfo.setAddonId(result.getUID().getBindingId());
|
||||
}
|
||||
} else if (type instanceof ChannelTypeXmlResult) {
|
||||
ChannelTypeXmlResult result = (ChannelTypeXmlResult) type;
|
||||
} else if (type instanceof ChannelTypeXmlResult result) {
|
||||
bundleInfo.getChannelTypesXml().add(result);
|
||||
if (bundleInfo.getAddonId().isBlank()) {
|
||||
bundleInfo.setAddonId(result.toChannelType().getUID().getBindingId());
|
||||
|
||||
Reference in New Issue
Block a user