Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Fix for BaseAssetQuery.objectValueAsQuery() to use thw right names in the switch statement

Michael Rademaker83f41688a01a
diff --git a/model/src/main/java/org/openremote/model/query/BaseAssetQuery.java b/model/src/main/java/org/openremote/model/query/BaseAssetQuery.java
index bbe0845ea..9c64b6e9c 100644
--- a/model/src/main/java/org/openremote/model/query/BaseAssetQuery.java
+++ b/model/src/main/java/org/openremote/model/query/BaseAssetQuery.java
@@ -307,19 +307,19 @@ public class BaseAssetQuery<CHILD extends BaseAssetQuery<CHILD>> {
predicateValue.getString("predicateType").ifPresent(predicateType -> {
switch (predicateType) {
- case "StringPredicate":
+ case StringPredicate.name:
attributePredicate.value = StringPredicate.fromObjectValue(predicateValue);
break;
- case "BooleanPredicate":
+ case BooleanPredicate.name:
attributePredicate.value = BooleanPredicate.fromObjectValue(predicateValue);
break;
- case "StringArrayPredicate":
+ case StringArrayPredicate.name:
attributePredicate.value = StringArrayPredicate.fromObjectValue(predicateValue);
break;
- case "DateTimePredicate":
+ case DateTimePredicate.name:
attributePredicate.value = DateTimePredicate.fromObjectValue(predicateValue);
break;
- case "NumberPredicate":
+ case NumberPredicate.name:
attributePredicate.value = NumberPredicate.fromObjectValue(predicateValue);
break;
}