Class CurrencyPairDTO
- java.lang.Object
-
- tech.cassandre.trading.bot.dto.util.CurrencyPairDTO
-
public final class CurrencyPairDTO extends Object
Currency pair for trading. The base currency represents how much of the quote currency to get one unit of the base currency. For example, if you were looking at the CAD/USD currency pair, the Canadian dollar would be the base currency, and the U.S. dollar would be the quote currency.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CurrencyPairDTO.CurrencyPairDTOBuilder
-
Constructor Summary
Constructors Constructor Description CurrencyPairDTO(String currencyPair)
Constructor.CurrencyPairDTO(String newBaseCurrency, String newQuoteCurrency)
Constructor withCurrencyDTO
.CurrencyPairDTO(String newBaseCurrency, String newQuoteCurrency, int newBaseCurrencyPrecision, int newQuoteCurrencyPrecision)
Constructor withCurrencyDTO
.CurrencyPairDTO(org.knowm.xchange.currency.CurrencyPair currencyPair)
Constructor.CurrencyPairDTO(org.knowm.xchange.instrument.Instrument instrument)
Constructor from XChange instrument.CurrencyPairDTO(org.knowm.xchange.instrument.Instrument instrument, int newBaseCurrencyPrecision, int newQuoteCurrencyPrecision)
Constructor from XChange instrument.CurrencyPairDTO(CurrencyDTO newBaseCurrency, CurrencyDTO newQuoteCurrency)
Constructor with String.CurrencyPairDTO(CurrencyDTO newBaseCurrency, CurrencyDTO newQuoteCurrency, int newBaseCurrencyPrecision, int newQuoteCurrencyPrecision)
Constructor with String.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CurrencyPairDTO.CurrencyPairDTOBuilder
builder()
boolean
equals(Object o)
CurrencyDTO
getBaseCurrency()
The base currency is the first currency appearing in a currency pair quotation.int
getBaseCurrencyPrecision()
The base currency precision.CurrencyDTO
getQuoteCurrency()
The quote currency is the second currency appearing in a currency pair quotation.int
getQuoteCurrencyPrecision()
The quote currency precision.int
hashCode()
String
toString()
-
-
-
Constructor Detail
-
CurrencyPairDTO
public CurrencyPairDTO(String currencyPair)
Constructor.- Parameters:
currencyPair
- currency pair
-
CurrencyPairDTO
public CurrencyPairDTO(org.knowm.xchange.currency.CurrencyPair currencyPair)
Constructor.- Parameters:
currencyPair
- currency pair
-
CurrencyPairDTO
public CurrencyPairDTO(String newBaseCurrency, String newQuoteCurrency)
Constructor withCurrencyDTO
.- Parameters:
newBaseCurrency
- The base currencynewQuoteCurrency
- The quote currency
-
CurrencyPairDTO
public CurrencyPairDTO(String newBaseCurrency, String newQuoteCurrency, int newBaseCurrencyPrecision, int newQuoteCurrencyPrecision)
Constructor withCurrencyDTO
.- Parameters:
newBaseCurrency
- The base currencynewQuoteCurrency
- The quote currencynewBaseCurrencyPrecision
- the base currency precisionnewQuoteCurrencyPrecision
- the quote currency precision
-
CurrencyPairDTO
public CurrencyPairDTO(CurrencyDTO newBaseCurrency, CurrencyDTO newQuoteCurrency)
Constructor with String.- Parameters:
newBaseCurrency
- The base currencynewQuoteCurrency
- The quote currency
-
CurrencyPairDTO
public CurrencyPairDTO(CurrencyDTO newBaseCurrency, CurrencyDTO newQuoteCurrency, int newBaseCurrencyPrecision, int newQuoteCurrencyPrecision)
Constructor with String.- Parameters:
newBaseCurrency
- The base currencynewQuoteCurrency
- The quote currencynewBaseCurrencyPrecision
- the base currency precisionnewQuoteCurrencyPrecision
- the quote currency precision
-
CurrencyPairDTO
public CurrencyPairDTO(org.knowm.xchange.instrument.Instrument instrument)
Constructor from XChange instrument.- Parameters:
instrument
- instrument
-
CurrencyPairDTO
public CurrencyPairDTO(org.knowm.xchange.instrument.Instrument instrument, int newBaseCurrencyPrecision, int newQuoteCurrencyPrecision)
Constructor from XChange instrument.- Parameters:
instrument
- instrumentnewBaseCurrencyPrecision
- the base currency precisionnewQuoteCurrencyPrecision
- the quote currency precision
-
-
Method Detail
-
builder
public static CurrencyPairDTO.CurrencyPairDTOBuilder builder()
-
getBaseCurrency
public CurrencyDTO getBaseCurrency()
The base currency is the first currency appearing in a currency pair quotation.
-
getQuoteCurrency
public CurrencyDTO getQuoteCurrency()
The quote currency is the second currency appearing in a currency pair quotation.
-
getBaseCurrencyPrecision
public int getBaseCurrencyPrecision()
The base currency precision.
-
getQuoteCurrencyPrecision
public int getQuoteCurrencyPrecision()
The quote currency precision.
-
-