@Test void theSeNtMailboxNameShouldNotBeASystemMailbox() { Optional<Role> role = Role.from("SeNt"); assertThat(role).isEmpty(); }
public static Optional<Role> from(String name) { Optional<Role> predefinedRole = predefinedRole(name); if (predefinedRole.isPresent()) { return predefinedRole; } else { return tryBuildCustomRole(name); } }
Role { public static Optional<Role> from(String name) { Optional<Role> predefinedRole = predefinedRole(name); if (predefinedRole.isPresent()) { return predefinedRole; } else { return tryBuildCustomRole(name); } } }
Role { public static Optional<Role> from(String name) { Optional<Role> predefinedRole = predefinedRole(name); if (predefinedRole.isPresent()) { return predefinedRole; } else { return tryBuildCustomRole(name); } } @VisibleForTesting  Role(String name, String defaultMailbox, BiFunction<String, String, Boolean> comparator); @VisibleForTesting  Role(String name); }
Role { public static Optional<Role> from(String name) { Optional<Role> predefinedRole = predefinedRole(name); if (predefinedRole.isPresent()) { return predefinedRole; } else { return tryBuildCustomRole(name); } } @VisibleForTesting  Role(String name, String defaultMailbox, BiFunction<String, String, Boolean> comparator); @VisibleForTesting  Role(String name); static Optional<Role> from(String name); boolean isSystemRole(); String serialize(); String getDefaultMailbox(); @Override int hashCode(); @Override boolean equals(Object object); @Override String toString(); }
Role { public static Optional<Role> from(String name) { Optional<Role> predefinedRole = predefinedRole(name); if (predefinedRole.isPresent()) { return predefinedRole; } else { return tryBuildCustomRole(name); } } @VisibleForTesting  Role(String name, String defaultMailbox, BiFunction<String, String, Boolean> comparator); @VisibleForTesting  Role(String name); static Optional<Role> from(String name); boolean isSystemRole(); String serialize(); String getDefaultMailbox(); @Override int hashCode(); @Override boolean equals(Object object); @Override String toString(); static final String USER_DEFINED_ROLE_PREFIX; static final Role INBOX; static final Role DRAFTS; static final Role OUTBOX; static final Role SENT; static final Role TRASH; static final Role ARCHIVE; static final Role SPAM; static final Role TEMPLATES; static final Role RESTORED_MESSAGES; }