chibenwa commented on code in PR #1643:
URL: https://github.com/apache/james-project/pull/1643#discussion_r1261429263


##########
server/data/data-jmap/src/main/java/org/apache/james/jmap/api/filtering/Rule.java:
##########
@@ -72,6 +72,54 @@ public String toString() {
         }
     }
 
+    public static class ConditionGroup {
+
+        private final ConditionCombiner conditionCombiner;
+        private final List<Condition> conditions;
+
+        public static ConditionGroup of(ConditionCombiner conditionCombiner, 
List<Condition> conditions) {
+            return new ConditionGroup(conditionCombiner, conditions);
+        }
+
+        public static ConditionGroup of(ConditionCombiner conditionCombiner, 
Condition... conditions) {
+            return new ConditionGroup(conditionCombiner, 
ImmutableList.copyOf(conditions));
+        }
+
+        private ConditionGroup(ConditionCombiner conditionCombiner, 
List<Condition> conditions) {
+            this.conditionCombiner = conditionCombiner;
+            this.conditions = conditions;
+        }
+
+        public ConditionCombiner getConditionCombiner() {
+            return conditionCombiner;
+        }
+
+        public List<Condition> getConditions() {
+            return conditions;
+        }
+
+        @Override
+        public boolean equals(Object o) {
+            if (this == o) return true;
+            if (o == null || getClass() != o.getClass()) return false;
+            ConditionGroup that = (ConditionGroup) o;
+            return conditionCombiner == that.conditionCombiner && 
Objects.equals(conditions, that.conditions);
+        }
+
+        @Override
+        public int hashCode() {
+            return Objects.hash(conditionCombiner, conditions);
+        }

Review Comment:
   Equals Verfier + standard pattern.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to