You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by sh...@apache.org on 2021/10/05 09:31:07 UTC

[unomi] branch draft-custom-items updated: Modify property condition builders to use collections instead of lists (works with sets now)

This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch draft-custom-items
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/draft-custom-items by this push:
     new 26c85f3  Modify property condition builders to use collections instead of lists (works with sets now)
26c85f3 is described below

commit 26c85f3cb5caeaaa226641c9816b2d1daf8e995f
Author: Serge Huber <sh...@jahia.com>
AuthorDate: Tue Oct 5 11:31:01 2021 +0200

    Modify property condition builders to use collections instead of lists (works with sets now)
---
 .../plugins/baseplugin/conditions/PropertyConditionEvaluator.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/PropertyConditionEvaluator.java b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/PropertyConditionEvaluator.java
index 6a0aadc..064a460 100644
--- a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/PropertyConditionEvaluator.java
+++ b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/PropertyConditionEvaluator.java
@@ -236,10 +236,10 @@ public class PropertyConditionEvaluator implements ConditionEvaluator {
         } else if (op.equals("lessThanOrEqualTo")) {
             return compare(actualValue, expectedValue, expectedValueDate, expectedValueInteger, expectedValueDateExpr, expectedValueDouble) <= 0;
         } else if (op.equals("between")) {
-            List<?> expectedValuesInteger = (List<?>) condition.getParameter("propertyValuesInteger");
-            List<?> expectedValuesDouble = (List<?>) condition.getParameter("propertyValuesDouble");
-            List<?> expectedValuesDate = (List<?>) condition.getParameter("propertyValuesDate");
-            List<?> expectedValuesDateExpr = (List<?>) condition.getParameter("propertyValuesDateExpr");
+            Collection<?> expectedValuesInteger = (Collection<?>) condition.getParameter("propertyValuesInteger");
+            Collection<?> expectedValuesDouble = (Collection<?>) condition.getParameter("propertyValuesDouble");
+            Collection<?> expectedValuesDate = (Collection<?>) condition.getParameter("propertyValuesDate");
+            Collection<?> expectedValuesDateExpr = (Collection<?>) condition.getParameter("propertyValuesDateExpr");
             return compare(actualValue, null,
                     getDate(getFirst(expectedValuesDate)),
                     getFirst(expectedValuesInteger),