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:
Holger Friedrich
2023-04-30 18:37:48 +02:00
committed by GitHub
parent ac0f512178
commit 33233982b3
23 changed files with 99 additions and 112 deletions
@@ -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());