diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/query/AssetTypeFilter.java b/common/data/src/main/java/org/thingsboard/server/common/data/query/AssetTypeFilter.java index 5e59069237..f666c02777 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/query/AssetTypeFilter.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/query/AssetTypeFilter.java @@ -38,10 +38,7 @@ public class AssetTypeFilter implements EntityFilter { private List assetTypes; public List getAssetTypes() { - if (assetType != null) { - assetTypes = Collections.singletonList(assetType); - } - return assetTypes; + return !CollectionUtils.isEmpty(assetTypes) ? assetTypes : Collections.singletonList(assetType); } @Getter diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/query/DeviceTypeFilter.java b/common/data/src/main/java/org/thingsboard/server/common/data/query/DeviceTypeFilter.java index 491fd2cd16..bc25d1d158 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/query/DeviceTypeFilter.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/query/DeviceTypeFilter.java @@ -42,10 +42,7 @@ public class DeviceTypeFilter implements EntityFilter { private List deviceTypes; public List getDeviceTypes() { - if (deviceType != null) { - deviceTypes = Collections.singletonList(deviceType); - } - return deviceTypes; + return !CollectionUtils.isEmpty(deviceTypes) ? deviceTypes : Collections.singletonList(deviceType); } @Getter diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/query/EdgeTypeFilter.java b/common/data/src/main/java/org/thingsboard/server/common/data/query/EdgeTypeFilter.java index d554e513df..306aae43cc 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/query/EdgeTypeFilter.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/query/EdgeTypeFilter.java @@ -38,10 +38,7 @@ public class EdgeTypeFilter implements EntityFilter { private List edgeTypes; public List getEdgeTypes() { - if (edgeType != null) { - edgeTypes = Collections.singletonList(edgeType); - } - return edgeTypes; + return !CollectionUtils.isEmpty(edgeTypes) ? edgeTypes : Collections.singletonList(edgeType); } @Getter diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/query/EntityViewTypeFilter.java b/common/data/src/main/java/org/thingsboard/server/common/data/query/EntityViewTypeFilter.java index e2a60d6af0..8025cf43b5 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/query/EntityViewTypeFilter.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/query/EntityViewTypeFilter.java @@ -38,10 +38,7 @@ public class EntityViewTypeFilter implements EntityFilter { private List entityViewTypes; public List getEntityViewTypes() { - if (entityViewType != null) { - entityViewTypes = Collections.singletonList(entityViewType); - } - return entityViewTypes; + return !CollectionUtils.isEmpty(entityViewTypes) ? entityViewTypes : Collections.singletonList(entityViewType); } @Getter