@Test void ofPositiveNameTypeShouldFilterOutNegativeEntries() throws Exception { MailboxACL mailboxACL = new MailboxACL( ImmutableMap.of(EntryKey.createUserEntryKey(Username.of("user1"), NEGATIVE), MailboxACL.FULL_RIGHTS)); assertThat(mailboxACL.ofPositiveNameType(NameType.user)) .isEmpty(); }
public Map<EntryKey, Rfc4314Rights> ofPositiveNameType(NameType nameType) { return this.entries.entrySet().stream() .filter(entry -> !entry.getKey().isNegative()) .filter(entry -> entry.getKey().getNameType().equals(nameType)) .collect(Guavate.entriesToMap()); }
MailboxACL { public Map<EntryKey, Rfc4314Rights> ofPositiveNameType(NameType nameType) { return this.entries.entrySet().stream() .filter(entry -> !entry.getKey().isNegative()) .filter(entry -> entry.getKey().getNameType().equals(nameType)) .collect(Guavate.entriesToMap()); } }
MailboxACL { public Map<EntryKey, Rfc4314Rights> ofPositiveNameType(NameType nameType) { return this.entries.entrySet().stream() .filter(entry -> !entry.getKey().isNegative()) .filter(entry -> entry.getKey().getNameType().equals(nameType)) .collect(Guavate.entriesToMap()); } MailboxACL(); @SafeVarargs  MailboxACL(Map.Entry<EntryKey, Rfc4314Rights>... entries);  MailboxACL(Map<EntryKey, Rfc4314Rights> entries);  MailboxACL(Properties props); }
MailboxACL { public Map<EntryKey, Rfc4314Rights> ofPositiveNameType(NameType nameType) { return this.entries.entrySet().stream() .filter(entry -> !entry.getKey().isNegative()) .filter(entry -> entry.getKey().getNameType().equals(nameType)) .collect(Guavate.entriesToMap()); } MailboxACL(); @SafeVarargs  MailboxACL(Map.Entry<EntryKey, Rfc4314Rights>... entries);  MailboxACL(Map<EntryKey, Rfc4314Rights> entries);  MailboxACL(Properties props); static ACLCommand.Builder command(); final boolean equals(Object o); final int hashCode(); MailboxACL apply(ACLCommand aclUpdate); MailboxACL except(MailboxACL other); MailboxACL except(EntryKey key, Rfc4314Rights mailboxACLRights); Map<EntryKey, Rfc4314Rights> getEntries(); MailboxACL replace(EntryKey key, Rfc4314Rights replacement); String toString(); MailboxACL union(MailboxACL other); MailboxACL union(EntryKey key, Rfc4314Rights mailboxACLRights); Map<EntryKey, Rfc4314Rights> ofPositiveNameType(NameType nameType); }
MailboxACL { public Map<EntryKey, Rfc4314Rights> ofPositiveNameType(NameType nameType) { return this.entries.entrySet().stream() .filter(entry -> !entry.getKey().isNegative()) .filter(entry -> entry.getKey().getNameType().equals(nameType)) .collect(Guavate.entriesToMap()); } MailboxACL(); @SafeVarargs  MailboxACL(Map.Entry<EntryKey, Rfc4314Rights>... entries);  MailboxACL(Map<EntryKey, Rfc4314Rights> entries);  MailboxACL(Properties props); static ACLCommand.Builder command(); final boolean equals(Object o); final int hashCode(); MailboxACL apply(ACLCommand aclUpdate); MailboxACL except(MailboxACL other); MailboxACL except(EntryKey key, Rfc4314Rights mailboxACLRights); Map<EntryKey, Rfc4314Rights> getEntries(); MailboxACL replace(EntryKey key, Rfc4314Rights replacement); String toString(); MailboxACL union(MailboxACL other); MailboxACL union(EntryKey key, Rfc4314Rights mailboxACLRights); Map<EntryKey, Rfc4314Rights> ofPositiveNameType(NameType nameType); static final char ADD_RIGHTS_MARKER; static final char DEFAULT_GROUP_MARKER; static final char DEFAULT_NEGATIVE_MARKER; static final char REMOVE_RIGHTS_MARKER; static final EntryKey ANYBODY_KEY; static final EntryKey ANYBODY_NEGATIVE_KEY; static final EntryKey AUTHENTICATED_KEY; static final EntryKey AUTHENTICATED_NEGATIVE_KEY; static final MailboxACL EMPTY; static final Rfc4314Rights FULL_RIGHTS; static final Rfc4314Rights NO_RIGHTS; static final MailboxACL OWNER_FULL_ACL; static final MailboxACL OWNER_FULL_EXCEPT_ADMINISTRATION_ACL; static final EntryKey OWNER_KEY; static final EntryKey OWNER_NEGATIVE_KEY; }