Browse Source

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

pull/8026/head
Volodymyr Babak 3 years ago
parent
commit
c4d50181ff
  1. 5
      common/data/src/main/java/org/thingsboard/server/common/data/query/AssetTypeFilter.java
  2. 5
      common/data/src/main/java/org/thingsboard/server/common/data/query/DeviceTypeFilter.java
  3. 5
      common/data/src/main/java/org/thingsboard/server/common/data/query/EdgeTypeFilter.java
  4. 5
      common/data/src/main/java/org/thingsboard/server/common/data/query/EntityViewTypeFilter.java

5
common/data/src/main/java/org/thingsboard/server/common/data/query/AssetTypeFilter.java

@ -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

5
common/data/src/main/java/org/thingsboard/server/common/data/query/DeviceTypeFilter.java

@ -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

5
common/data/src/main/java/org/thingsboard/server/common/data/query/EdgeTypeFilter.java

@ -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

5
common/data/src/main/java/org/thingsboard/server/common/data/query/EntityViewTypeFilter.java

@ -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…
Cancel
Save