@Test public void toMailboxAclShouldReturnEmptyAclWhenEmpty() { Rights rights = Rights.EMPTY; assertThat(rights.toMailboxAcl()) .isEqualTo(new MailboxACL()); }
public MailboxACL toMailboxAcl() { BinaryOperator<MailboxACL> union = Throwing.binaryOperator(MailboxACL::union); return rights.asMap() .entrySet() .stream() .map(entry -> new MailboxACL( ImmutableMap.of( EntryKey.createUserEntryKey(entry.getKey()), toMailboxAclRights(entry.getValue())))) .reduce(MailboxACL.EMPTY, union); }
Rights { public MailboxACL toMailboxAcl() { BinaryOperator<MailboxACL> union = Throwing.binaryOperator(MailboxACL::union); return rights.asMap() .entrySet() .stream() .map(entry -> new MailboxACL( ImmutableMap.of( EntryKey.createUserEntryKey(entry.getKey()), toMailboxAclRights(entry.getValue())))) .reduce(MailboxACL.EMPTY, union); } }
Rights { public MailboxACL toMailboxAcl() { BinaryOperator<MailboxACL> union = Throwing.binaryOperator(MailboxACL::union); return rights.asMap() .entrySet() .stream() .map(entry -> new MailboxACL( ImmutableMap.of( EntryKey.createUserEntryKey(entry.getKey()), toMailboxAclRights(entry.getValue())))) .reduce(MailboxACL.EMPTY, union); } @JsonCreator  Rights(Map<Username, List<Right>> rights); private  Rights(Multimap<Username, Right> rights); }
Rights { public MailboxACL toMailboxAcl() { BinaryOperator<MailboxACL> union = Throwing.binaryOperator(MailboxACL::union); return rights.asMap() .entrySet() .stream() .map(entry -> new MailboxACL( ImmutableMap.of( EntryKey.createUserEntryKey(entry.getKey()), toMailboxAclRights(entry.getValue())))) .reduce(MailboxACL.EMPTY, union); } @JsonCreator  Rights(Map<Username, List<Right>> rights); private  Rights(Multimap<Username, Right> rights); static Builder builder(); static Rights fromACL(MailboxACL acl); @JsonAnyGetter Map<Username, Collection<Right>> getRights(); Rights removeEntriesFor(Username username); MailboxACL toMailboxAcl(); Optional<Boolean> mayReadItems(Username username); Optional<Boolean> mayAddItems(Username username); Optional<Boolean> mayCreateChild(Username username); Optional<Boolean> mayRemoveItems(Username username); Optional<Boolean> mayRename(Username username); Optional<Boolean> mayDelete(Username username); @Override final boolean equals(Object o); @Override final int hashCode(); }
Rights { public MailboxACL toMailboxAcl() { BinaryOperator<MailboxACL> union = Throwing.binaryOperator(MailboxACL::union); return rights.asMap() .entrySet() .stream() .map(entry -> new MailboxACL( ImmutableMap.of( EntryKey.createUserEntryKey(entry.getKey()), toMailboxAclRights(entry.getValue())))) .reduce(MailboxACL.EMPTY, union); } @JsonCreator  Rights(Map<Username, List<Right>> rights); private  Rights(Multimap<Username, Right> rights); static Builder builder(); static Rights fromACL(MailboxACL acl); @JsonAnyGetter Map<Username, Collection<Right>> getRights(); Rights removeEntriesFor(Username username); MailboxACL toMailboxAcl(); Optional<Boolean> mayReadItems(Username username); Optional<Boolean> mayAddItems(Username username); Optional<Boolean> mayCreateChild(Username username); Optional<Boolean> mayRemoveItems(Username username); Optional<Boolean> mayRename(Username username); Optional<Boolean> mayDelete(Username username); @Override final boolean equals(Object o); @Override final int hashCode(); static final Rights EMPTY; }