CryptoBasepublic 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 fromInvalidArgumentExceptionpublic 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()
CryptoBasegetCurrencyFrom in interface CryptoBasepublic void setCurrencyFrom(java.lang.String currencyFrom)
CryptoBasesetCurrencyFrom in interface CryptoBasecurrencyFrom - currency symbol to convert frompublic java.lang.String getCurrencyTo()
CryptoBasegetCurrencyTo in interface CryptoBasepublic void setCurrencyTo(java.lang.String currencyTo)
CryptoBasesetCurrencyTo in interface CryptoBasecurrencyTo - currency symbol to convert topublic java.net.URL getURL()
getURL in interface CryptoBasepublic GeneralInfo getGeneralInfo()
public ConversionInfo getConversionInfo()
public void update()
throws InvalidArgumentException
update in interface CryptoBaseInvalidArgumentExceptiongetConversionInfo(),
getGeneralInfo(),
getURL()public java.lang.String dataToString()
CryptoBasedataToString in interface CryptoBaseGeneralInfo.dataToString(),
ConversionInfo.dataToString()