@Test public void builderShouldWork() { FilterCondition filterCondition = FilterCondition.builder() .inMailboxes(Optional.of(ImmutableList.of("1", "2"))) .build(); List<String> sort = ImmutableList.of("date desc"); List<String> fetchMessageProperties = ImmutableList.of("id", "blobId"); GetMessageListRequest expectedGetMessageListRequest = new GetMessageListRequest(Optional.empty(), Optional.of(filterCondition), sort, Optional.of(true), Optional.of(Number.fromLong(1L)), Optional.empty(), Optional.empty(), Optional.of(Number.fromLong(2)), Optional.empty(), Optional.of(true), fetchMessageProperties, Optional.empty()); GetMessageListRequest getMessageListRequest = GetMessageListRequest.builder() .filter(filterCondition) .sort(sort) .collapseThreads(true) .position(1L) .limit(2) .fetchMessages(true) .fetchMessageProperties(fetchMessageProperties) .build(); assertThat(getMessageListRequest).isEqualToComparingFieldByField(expectedGetMessageListRequest); }
public static Builder builder() { return new Builder(); }
GetMessageListRequest implements JmapRequest { public static Builder builder() { return new Builder(); } }
GetMessageListRequest implements JmapRequest { public static Builder builder() { return new Builder(); } @VisibleForTesting  GetMessageListRequest(Optional<String> accountId, Optional<Filter> filter, List<String> sort, Optional<Boolean> collapseThreads,
            Optional<Number> position, Optional<String> anchor, Optional<Number> anchorOffset, Optional<Number> limit, Optional<Boolean> fetchThreads,
            Optional<Boolean> fetchMessages, List<String> fetchMessageProperties, Optional<Boolean> fetchSearchSnippets); }
GetMessageListRequest implements JmapRequest { public static Builder builder() { return new Builder(); } @VisibleForTesting  GetMessageListRequest(Optional<String> accountId, Optional<Filter> filter, List<String> sort, Optional<Boolean> collapseThreads,
            Optional<Number> position, Optional<String> anchor, Optional<Number> anchorOffset, Optional<Number> limit, Optional<Boolean> fetchThreads,
            Optional<Boolean> fetchMessages, List<String> fetchMessageProperties, Optional<Boolean> fetchSearchSnippets); static Builder builder(); Optional<String> getAccountId(); Optional<Filter> getFilter(); List<String> getSort(); Optional<Boolean> isCollapseThreads(); Optional<Number> getPosition(); Optional<String> getAnchor(); Optional<Number> getAnchorOffset(); Optional<Number> getLimit(); Optional<Boolean> isFetchThreads(); Optional<Boolean> isFetchMessages(); List<String> getFetchMessageProperties(); Optional<Boolean> isFetchSearchSnippets(); }
GetMessageListRequest implements JmapRequest { public static Builder builder() { return new Builder(); } @VisibleForTesting  GetMessageListRequest(Optional<String> accountId, Optional<Filter> filter, List<String> sort, Optional<Boolean> collapseThreads,
            Optional<Number> position, Optional<String> anchor, Optional<Number> anchorOffset, Optional<Number> limit, Optional<Boolean> fetchThreads,
            Optional<Boolean> fetchMessages, List<String> fetchMessageProperties, Optional<Boolean> fetchSearchSnippets); static Builder builder(); Optional<String> getAccountId(); Optional<Filter> getFilter(); List<String> getSort(); Optional<Boolean> isCollapseThreads(); Optional<Number> getPosition(); Optional<String> getAnchor(); Optional<Number> getAnchorOffset(); Optional<Number> getLimit(); Optional<Boolean> isFetchThreads(); Optional<Boolean> isFetchMessages(); List<String> getFetchMessageProperties(); Optional<Boolean> isFetchSearchSnippets();  }