@Test public void builderShouldWork() { ImmutableMap<MailboxCreationId, Mailbox> created = ImmutableMap.of(MailboxCreationId.of("1"), Mailbox.builder() .id(InMemoryId.of(1)) .name("myBox") .build()); ImmutableList<MailboxId> updated = ImmutableList.of(InMemoryId.of(2)); ImmutableList<MailboxId> destroyed = ImmutableList.of(InMemoryId.of(3)); ImmutableMap<MailboxCreationId, SetError> notCreated = ImmutableMap.of(MailboxCreationId.of("dead-beef-defec8"), SetError.builder().type(SetError.Type.INVALID_PROPERTIES).build()); ImmutableMap<MailboxId, SetError> notUpdated = ImmutableMap.of(InMemoryId.of(4), SetError.builder().type(SetError.Type.INVALID_ARGUMENTS).build()); ImmutableMap<MailboxId, SetError> notDestroyed = ImmutableMap.of(InMemoryId.of(5), SetError.builder().type(SetError.Type.NOT_FOUND).build()); SetMailboxesResponse expected = new SetMailboxesResponse(created, updated, destroyed, notCreated, notUpdated, notDestroyed); SetMailboxesResponse setMessagesResponse = SetMailboxesResponse.builder() .created(created) .updated(updated) .destroyed(destroyed) .notCreated(notCreated) .notUpdated(notUpdated) .notDestroyed(notDestroyed) .build(); assertThat(setMessagesResponse).isEqualToComparingFieldByField(expected); }
public static Builder builder() { return new Builder(); }
SetMailboxesResponse implements Method.Response { public static Builder builder() { return new Builder(); } }
SetMailboxesResponse implements Method.Response { public static Builder builder() { return new Builder(); } @VisibleForTesting  SetMailboxesResponse(ImmutableMap<MailboxCreationId, Mailbox> created, ImmutableList<MailboxId> updated, ImmutableList<MailboxId> destroyed,
            ImmutableMap<MailboxCreationId, SetError> notCreated, ImmutableMap<MailboxId, SetError> notUpdated, ImmutableMap<MailboxId, SetError> notDestroyed); }
SetMailboxesResponse implements Method.Response { public static Builder builder() { return new Builder(); } @VisibleForTesting  SetMailboxesResponse(ImmutableMap<MailboxCreationId, Mailbox> created, ImmutableList<MailboxId> updated, ImmutableList<MailboxId> destroyed,
            ImmutableMap<MailboxCreationId, SetError> notCreated, ImmutableMap<MailboxId, SetError> notUpdated, ImmutableMap<MailboxId, SetError> notDestroyed); static Builder builder(); ImmutableMap<MailboxCreationId, Mailbox> getCreated(); ImmutableList<MailboxId> getUpdated(); ImmutableList<MailboxId> getDestroyed(); Map<MailboxCreationId, SetError> getNotCreated(); ImmutableMap<MailboxId,SetError> getNotUpdated(); ImmutableMap<MailboxId,SetError> getNotDestroyed(); SetMailboxesResponse.Builder mergeInto(SetMailboxesResponse.Builder responseBuilder); @Override int hashCode(); @Override boolean equals(Object obj); }
SetMailboxesResponse implements Method.Response { public static Builder builder() { return new Builder(); } @VisibleForTesting  SetMailboxesResponse(ImmutableMap<MailboxCreationId, Mailbox> created, ImmutableList<MailboxId> updated, ImmutableList<MailboxId> destroyed,
            ImmutableMap<MailboxCreationId, SetError> notCreated, ImmutableMap<MailboxId, SetError> notUpdated, ImmutableMap<MailboxId, SetError> notDestroyed); static Builder builder(); ImmutableMap<MailboxCreationId, Mailbox> getCreated(); ImmutableList<MailboxId> getUpdated(); ImmutableList<MailboxId> getDestroyed(); Map<MailboxCreationId, SetError> getNotCreated(); ImmutableMap<MailboxId,SetError> getNotUpdated(); ImmutableMap<MailboxId,SetError> getNotDestroyed(); SetMailboxesResponse.Builder mergeInto(SetMailboxesResponse.Builder responseBuilder); @Override int hashCode(); @Override boolean equals(Object obj);  }