@Test public void buildShouldThrowWhenBothMapAndOldKeyword() { assertThatThrownBy(() -> CreationMessage.builder() .mailboxIds(ImmutableList.of("ba9-0f-dead-beef")) .headers(ImmutableMap.of()) .keywords(ImmutableMap.of("$Draft", true)) .isAnswered(Optional.of(true)) .build()) .isInstanceOf(IllegalArgumentException.class) .hasMessage("Does not support keyword and is* at the same time"); }
public static Builder builder() { return new Builder(); }
CreationMessage { public static Builder builder() { return new Builder(); } }
CreationMessage { public static Builder builder() { return new Builder(); } @VisibleForTesting  CreationMessage(ImmutableList<String> mailboxIds, Optional<String> inReplyToMessageId, ImmutableMap<String, String> headers, Optional<DraftEmailer> from,
                    ImmutableList<DraftEmailer> to, ImmutableList<DraftEmailer> cc, ImmutableList<DraftEmailer> bcc, ImmutableList<DraftEmailer> replyTo, String subject, ZonedDateTime date, Optional<String> textBody, Optional<String> htmlBody, ImmutableList<Attachment> attachments,
                    ImmutableMap<BlobId, SubMessage> attachedMessages, Keywords keywords); }
CreationMessage { public static Builder builder() { return new Builder(); } @VisibleForTesting  CreationMessage(ImmutableList<String> mailboxIds, Optional<String> inReplyToMessageId, ImmutableMap<String, String> headers, Optional<DraftEmailer> from,
                    ImmutableList<DraftEmailer> to, ImmutableList<DraftEmailer> cc, ImmutableList<DraftEmailer> bcc, ImmutableList<DraftEmailer> replyTo, String subject, ZonedDateTime date, Optional<String> textBody, Optional<String> htmlBody, ImmutableList<Attachment> attachments,
                    ImmutableMap<BlobId, SubMessage> attachedMessages, Keywords keywords); static Builder builder(); Keywords getKeywords(); ImmutableList<String> getMailboxIds(); Optional<String> getInReplyToMessageId(); ImmutableMap<String, String> getHeaders(); Optional<DraftEmailer> getFrom(); ImmutableList<DraftEmailer> getTo(); ImmutableList<DraftEmailer> getCc(); ImmutableList<DraftEmailer> getBcc(); ImmutableList<DraftEmailer> getReplyTo(); String getSubject(); ZonedDateTime getDate(); Optional<String> getTextBody(); Optional<String> getHtmlBody(); ImmutableList<Attachment> getAttachments(); ImmutableMap<BlobId, SubMessage> getAttachedMessages(); boolean isValid(); boolean isDraft(); List<ValidationResult> validate(); boolean isIn(MessageManager mailbox); boolean isOnlyIn(MessageManager mailbox); @Override String toString(); }
CreationMessage { public static Builder builder() { return new Builder(); } @VisibleForTesting  CreationMessage(ImmutableList<String> mailboxIds, Optional<String> inReplyToMessageId, ImmutableMap<String, String> headers, Optional<DraftEmailer> from,
                    ImmutableList<DraftEmailer> to, ImmutableList<DraftEmailer> cc, ImmutableList<DraftEmailer> bcc, ImmutableList<DraftEmailer> replyTo, String subject, ZonedDateTime date, Optional<String> textBody, Optional<String> htmlBody, ImmutableList<Attachment> attachments,
                    ImmutableMap<BlobId, SubMessage> attachedMessages, Keywords keywords); static Builder builder(); Keywords getKeywords(); ImmutableList<String> getMailboxIds(); Optional<String> getInReplyToMessageId(); ImmutableMap<String, String> getHeaders(); Optional<DraftEmailer> getFrom(); ImmutableList<DraftEmailer> getTo(); ImmutableList<DraftEmailer> getCc(); ImmutableList<DraftEmailer> getBcc(); ImmutableList<DraftEmailer> getReplyTo(); String getSubject(); ZonedDateTime getDate(); Optional<String> getTextBody(); Optional<String> getHtmlBody(); ImmutableList<Attachment> getAttachments(); ImmutableMap<BlobId, SubMessage> getAttachedMessages(); boolean isValid(); boolean isDraft(); List<ValidationResult> validate(); boolean isIn(MessageManager mailbox); boolean isOnlyIn(MessageManager mailbox); @Override String toString();  }