hungphan227 commented on code in PR #1643:
URL: https://github.com/apache/james-project/pull/1643#discussion_r1263476916
##########
server/data/data-jmap-cassandra/src/main/java/org/apache/james/jmap/cassandra/filtering/RuleDTO.java:
##########
@@ -34,6 +34,43 @@
public class RuleDTO {
+ public static class ConditionGroupDTO {
+
+ private Rule.ConditionCombiner conditionCombiner;
+ private List<ConditionDTO> conditionDTOs;
+
+ public ConditionGroupDTO(@JsonProperty("conditionCombiner")
Rule.ConditionCombiner conditionCombiner,
+ @JsonProperty("conditions")
List<ConditionDTO> conditionDTOs) {
+ this.conditionCombiner = conditionCombiner;
+ this.conditionDTOs = conditionDTOs;
+ }
+
+ public Rule.ConditionCombiner getConditionCombiner() {
+ return conditionCombiner;
+ }
+
+ public Rule.ConditionGroup toConditionGroup() {
+ return Rule.ConditionGroup.of(conditionCombiner,
conditionDTOs.stream().map(ConditionDTO::toCondition).collect(Collectors.toList()));
+ }
+
+ public static ConditionGroupDTO from(Rule.ConditionGroup
conditionGroup) {
+ return new
ConditionGroupDTO(conditionGroup.getConditionCombiner(),
conditionGroup.getConditions().stream().map(ConditionDTO::from).collect(Collectors.toList()));
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ ConditionGroupDTO that = (ConditionGroupDTO) o;
+ return conditionCombiner == that.conditionCombiner &&
Objects.equals(conditionDTOs, that.conditionDTOs);
+ }
Review Comment:
"Also please follow the equals pattern of other POJOs". Why?
--
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]