Always use multiple types if present. If not present - use singular type
This commit is contained in:
parent
a7e0cace13
commit
c4d50181ff
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user