CryptoBase
public final class CryptoInfo extends java.lang.Object implements CryptoBase
GeneralInfo
,
ConversionInfo
Modifier and Type | Method | Description |
---|---|---|
java.lang.String |
dataToString() |
returns a string representation of the data retrieved from the CryptoCompare
API
|
ConversionInfo |
getConversionInfo() |
returns ConversionInfo object equivalent to the 'ConversionInfo' json object
returned by the Coins
General Info end point.
|
java.lang.String |
getCurrencyFrom() |
gets the fsym(s) parameter this object uses for the CryptoCompare API
|
java.lang.String |
getCurrencyTo() |
gets the tsym(s) parameter this object uses for the CryptoCompare API
|
GeneralInfo |
getGeneralInfo() |
returns GeneralInfo object equivalent to the 'GeneralInfo' json object
returned by the Coins
General Info.
|
static CryptoInfo |
getInstance(java.lang.String currencyTo,
java.lang.String currencyFrom) |
gets a new instance of CryptoInfo with the following parameters
|
java.net.URL |
getURL() |
gets the min-api.cryptocompare.com/data/generalinfo end point url with
parameters currencyTo, currencyFrom, and apiKey (if any)
|
void |
setCurrencyFrom(java.lang.String currencyFrom) |
sets the fsym(s) parameter this object uses for the CryptoCompare API
|
void |
setCurrencyTo(java.lang.String currencyTo) |
sets the tsym(s) parameter this object uses for the CryptoCompare API
|
static java.util.stream.Stream<CryptoInfo> |
streamCryptoInfo(java.lang.String currencyTo,
java.lang.String... currenciesFrom) |
streams CryptoInfo objects by connecting to the Coins
General Info end point.
The number of objects streamed is equal to the length of currenciesFrom. |
void |
update() |
updates url with parameters, then connects and updates this objects
GeneralInfo and ConversionInfo aggregates with the returned json.
|
public static java.util.stream.Stream<CryptoInfo> streamCryptoInfo(java.lang.String currencyTo, java.lang.String... currenciesFrom) throws InvalidArgumentException
currencyTo
- currency to convert tocurrenciesFrom
- array of currencies to convert fromInvalidArgumentException
public static CryptoInfo getInstance(java.lang.String currencyTo, java.lang.String currencyFrom)
currencyTo
- currency symbol to convert tocurrencyFrom
- currency symbol to convert frompublic java.lang.String getCurrencyFrom()
CryptoBase
getCurrencyFrom
in interface CryptoBase
public void setCurrencyFrom(java.lang.String currencyFrom)
CryptoBase
setCurrencyFrom
in interface CryptoBase
currencyFrom
- currency symbol to convert frompublic java.lang.String getCurrencyTo()
CryptoBase
getCurrencyTo
in interface CryptoBase
public void setCurrencyTo(java.lang.String currencyTo)
CryptoBase
setCurrencyTo
in interface CryptoBase
currencyTo
- currency symbol to convert topublic java.net.URL getURL()
getURL
in interface CryptoBase
public GeneralInfo getGeneralInfo()
public ConversionInfo getConversionInfo()
public void update() throws InvalidArgumentException
update
in interface CryptoBase
InvalidArgumentException
getConversionInfo()
,
getGeneralInfo()
,
getURL()
public java.lang.String dataToString()
CryptoBase
dataToString
in interface CryptoBase
GeneralInfo.dataToString()
,
ConversionInfo.dataToString()