You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by "chibenwa (via GitHub)" <gi...@apache.org> on 2023/05/24 08:56:03 UTC

[GitHub] [james-project] chibenwa commented on a diff in pull request #1572: DeletedMessagesVault API - support limit query

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


##########
mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/dto/query/QueryDTO.java:
##########
@@ -36,22 +35,22 @@ public class QueryDTO implements QueryElement {
 
     @VisibleForTesting
     static QueryDTO and(QueryElement... queryElements) {
-        return new QueryDTO(Combinator.AND.getValue(), ImmutableList.copyOf(queryElements), Optional.empty());
+        return new QueryDTO(Combinator.AND.getValue(), ImmutableList.copyOf(queryElements), null);
     }
 
     @VisibleForTesting
     static QueryDTO and(Long limit, QueryElement... queryElements) {
-        return new QueryDTO(Combinator.AND.getValue(), ImmutableList.copyOf(queryElements), Optional.ofNullable(limit));
+        return new QueryDTO(Combinator.AND.getValue(), ImmutableList.copyOf(queryElements), limit);
     }
 
     private final String combinator;
     private final List<QueryElement> criteria;
-    private final Optional<Long> limit;
+    private final Long limit;

Review Comment:
   Why get rid of the optional? 
   
   Sounds like a "regression" to me...



-- 
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: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org