public final class Wallet extends Object
DTO representing a Wallet
This is simply defined by an amount of money in a given currency, contained in the cash object.
This class is immutable.
Constructor and Description |
---|
Wallet(String currency,
BigDecimal balance)
|
Wallet(String currency,
BigDecimal balance,
BigDecimal available)
|
Wallet(String currency,
BigDecimal balance,
BigDecimal available,
BigDecimal frozen)
Constructs a wallet.
|
Wallet(String currency,
BigDecimal balance,
BigDecimal available,
BigDecimal frozen,
String description)
Deprecated.
|
Wallet(String currency,
BigDecimal balance,
BigDecimal available,
String description)
Deprecated.
|
Wallet(String currency,
BigDecimal balance,
String description)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
BigDecimal |
getAvailable()
Returns the amount of the
currency in this wallet that is available to trade. |
BigDecimal |
getBalance()
Returns the total amount of the
currency in this wallet. |
String |
getCurrency() |
String |
getDescription()
Deprecated.
|
BigDecimal |
getFrozen()
Returns the frozen amount of the
currency in this wallet that is locked in trading. |
int |
hashCode() |
String |
toString() |
static Wallet |
zero(String currency)
Returns a wallet with zero balances.
|
public Wallet(String currency, BigDecimal balance)
currency
- The underlying currencybalance
- The balancepublic Wallet(String currency, BigDecimal balance, BigDecimal available)
currency
- the underlying currency of this wallet.balance
- the total amount of the currency
in this wallet.available
- the amount of the currency
in this wallet that is available to trade.public Wallet(String currency, BigDecimal balance, BigDecimal available, BigDecimal frozen)
currency
- the underlying currency of this wallet.balance
- the total amount of the currency
in this wallet, including the available
and the frozen
.available
- the amount of the currency
in this wallet that is available to trade.frozen
- the frozen amount of the currency
in this wallet that is locked in trading.@Deprecated public Wallet(String currency, BigDecimal balance, String description)
description
- Optional description to distinguish same currency Wallets@Deprecated public Wallet(String currency, BigDecimal balance, BigDecimal available, String description)
@Deprecated public Wallet(String currency, BigDecimal balance, BigDecimal available, BigDecimal frozen, String description)
public static Wallet zero(String currency)
currency
- the wallet currency.public String getCurrency()
public BigDecimal getBalance()
currency
in this wallet.public BigDecimal getAvailable()
currency
in this wallet that is available to trade.public BigDecimal getFrozen()
currency
in this wallet that is locked in trading.@Deprecated public String getDescription()
Copyright © 2012–2018 Xeiam, LLC. All rights reserved.