private static void generic(AccountService accountService) throws IOException { // Get the account information AccountInfo accountInfo = accountService.getAccountInfo(); System.out.println("Account balances: (available / available for withdrawal / total)"); Wallet wallet = accountInfo.getWallet(); Map<Currency, Balance> balances = wallet.getBalances(); for (Map.Entry<Currency, Balance> entry : balances.entrySet()) { Balance balance = entry.getValue(); System.out.format( "%s balance: %s / %s / %s\n", entry.getKey().getCurrencyCode(), balance.getAvailable(), balance.getAvailableForWithdrawal(), balance.getTotal()); } }
public static Builder from(Balance balance) { return new Builder() .currency(balance.getCurrency()) .total(balance.getTotal()) .available(balance.getAvailable()) .frozen(balance.getFrozen()) .borrowed(balance.getBorrowed()) .loaned(balance.getLoaned()) .withdrawing(balance.getWithdrawing()) .depositing(balance.getDepositing()); }
public static Builder from(Balance balance) { return new Builder() .currency(balance.getCurrency()) .total(balance.getTotal()) .available(balance.getAvailable()) .frozen(balance.getFrozen()) .borrowed(balance.getBorrowed()) .loaned(balance.getLoaned()) .withdrawing(balance.getWithdrawing()) .depositing(balance.getDepositing()); }