@Override public Account getAccountById(short id) { checkOpen(); return accountInfoMapRef.get().getAccountById(id); }
@Override public Collection<Account> getAllAccounts() { checkOpen(); return accountInfoMapRef.get().getAccounts(); }
@Override public Account getAccountByName(String accountName) { checkOpen(); Objects.requireNonNull(accountName, "accountName cannot be null."); return accountInfoMapRef.get().getAccountByName(accountName); }
@Override public boolean addAccountUpdateConsumer(Consumer<Collection<Account>> accountUpdateConsumer) { checkOpen(); Objects.requireNonNull(accountUpdateConsumer, "accountUpdateConsumer to subscribe cannot be null"); return accountUpdateConsumers.add(accountUpdateConsumer); }
@Override public boolean removeAccountUpdateConsumer(Consumer<Collection<Account>> accountUpdateConsumer) { checkOpen(); Objects.requireNonNull(accountUpdateConsumer, "accountUpdateConsumer to unsubscribe cannot be null"); return accountUpdateConsumers.remove(accountUpdateConsumer); }
checkOpen(); Objects.requireNonNull(accounts, "accounts cannot be null"); if (hasDuplicateAccountIdOrName(accounts)) {