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.Builder
-
Constructor Summary
Constructors Modifier Constructor Description CurrencyPairDTO(String currencyPair)
Constructor.CurrencyPairDTO(String newBaseCurrency, String newQuoteCurrency)
Constructor withCurrencyDTO
.CurrencyPairDTO(CurrencyDTO newBaseCurrency, CurrencyDTO newQuoteCurrency)
Constructor with String.protected
CurrencyPairDTO(CurrencyPairDTO.Builder builder)
Builder constructor withCurrencyDTO
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CurrencyPairDTO.Builder
builder()
Returns builder.boolean
equals(Object o)
CurrencyDTO
getBaseCurrency()
Getter for baseCurrency.CurrencyDTO
getQuoteCurrency()
Getter for quoteCurrency.int
hashCode()
String
toString()
-
-
-
Constructor Detail
-
CurrencyPairDTO
public CurrencyPairDTO(String 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(CurrencyDTO newBaseCurrency, CurrencyDTO newQuoteCurrency)
Constructor with String.- Parameters:
newBaseCurrency
- The base currencynewQuoteCurrency
- The quote currency
-
CurrencyPairDTO
protected CurrencyPairDTO(CurrencyPairDTO.Builder builder)
Builder constructor withCurrencyDTO
.- Parameters:
builder
- builder
-
-
Method Detail
-
getBaseCurrency
public CurrencyDTO getBaseCurrency()
Getter for baseCurrency.- Returns:
- baseCurrency
-
getQuoteCurrency
public CurrencyDTO getQuoteCurrency()
Getter for quoteCurrency.- Returns:
- quoteCurrency
-
builder
public static CurrencyPairDTO.Builder builder()
Returns builder.- Returns:
- builder
-
-