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


##########
server/data/data-jmap-cassandra/src/main/java/org/apache/james/jmap/cassandra/filtering/RuleDTO.java:
##########
@@ -215,22 +217,45 @@ public static ImmutableList<RuleDTO> from(List<Rule> 
rules) {
     public static RuleDTO from(Rule rule) {
         return new RuleDTO(rule.getId().asString(),
                 rule.getName(),
-                ConditionDTO.from(rule.getCondition()),
+                
rule.getConditions().stream().map(ConditionDTO::from).collect(Collectors.toList()),
+                rule.getConditionCombiner(),
                 ActionDTO.from(rule.getAction()));
     }
 
     private final String id;
     private final String name;
     private final ConditionDTO conditionDTO;
+    private final List<ConditionDTO> conditionDTOs;
+    private final Rule.ConditionCombiner conditionCombiner;
     private final ActionDTO actionDTO;
 
+    @JsonCreator
+    public RuleDTO(@JsonProperty("id") String id,
+                   @JsonProperty("name") String name,
+                   @JsonProperty("conditions") List<ConditionDTO> 
conditionDTOs,
+                   @JsonProperty("conditionCombiner") Rule.ConditionCombiner 
conditionCombiner,
+                   @JsonProperty("action") ActionDTO actionDTO) {
+        this.name = name;
+        this.conditionDTO = null;
+        this.conditionDTOs = conditionDTOs;
+        this.conditionCombiner = conditionCombiner;
+        this.actionDTO = actionDTO;
+        Preconditions.checkNotNull(id);

Review Comment:
   preconditions should go first



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