Always use multiple types if present. If not present - use singular type

This commit is contained in:
Volodymyr Babak 2023-04-11 13:32:20 +03:00
parent a7e0cace13
commit c4d50181ff
4 changed files with 4 additions and 16 deletions

View File

@ -38,10 +38,7 @@ public class AssetTypeFilter implements EntityFilter {
private List<String> assetTypes;
public List<String> getAssetTypes() {
if (assetType != null) {
assetTypes = Collections.singletonList(assetType);
}
return assetTypes;
return !CollectionUtils.isEmpty(assetTypes) ? assetTypes : Collections.singletonList(assetType);
}
@Getter

View File

@ -42,10 +42,7 @@ public class DeviceTypeFilter implements EntityFilter {
private List<String> deviceTypes;
public List<String> getDeviceTypes() {
if (deviceType != null) {
deviceTypes = Collections.singletonList(deviceType);
}
return deviceTypes;
return !CollectionUtils.isEmpty(deviceTypes) ? deviceTypes : Collections.singletonList(deviceType);
}
@Getter

View File

@ -38,10 +38,7 @@ public class EdgeTypeFilter implements EntityFilter {
private List<String> edgeTypes;
public List<String> getEdgeTypes() {
if (edgeType != null) {
edgeTypes = Collections.singletonList(edgeType);
}
return edgeTypes;
return !CollectionUtils.isEmpty(edgeTypes) ? edgeTypes : Collections.singletonList(edgeType);
}
@Getter

View File

@ -38,10 +38,7 @@ public class EntityViewTypeFilter implements EntityFilter {
private List<String> entityViewTypes;
public List<String> getEntityViewTypes() {
if (entityViewType != null) {
entityViewTypes = Collections.singletonList(entityViewType);
}
return entityViewTypes;
return !CollectionUtils.isEmpty(entityViewTypes) ? entityViewTypes : Collections.singletonList(entityViewType);
}
@Getter