public class Currency extends java.lang.Object implements TelegramObject
| Constructor and Description |
|---|
Currency(java.lang.String code,
java.lang.String title,
java.lang.String symbol,
java.lang.String nativeSymbol,
java.lang.String thousandsSeparator,
java.lang.String decimalSeparator,
boolean symbolLeft,
boolean spaceBetween,
int exponent,
int minAmount,
int maxAmount)
Creates a Currency.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
format(int value,
boolean useNativeSymbol)
Converts a value to a price with this currency.
|
static Currency |
fromCode(java.lang.String code)
Returns the currency with the specified code.
|
java.lang.String |
getCode()
Getter for property
code. |
java.lang.String |
getDecimalSeparator()
Getter for property
decimalSeparator. |
int |
getExponent()
Getter for property
exponent. |
int |
getMaxAmount()
Getter for property
maxAmount. |
int |
getMinAmount()
Getter for property
minAmount. |
java.lang.String |
getNativeSymbol()
Getter for property
nativeSymbol. |
java.lang.String |
getSymbol()
Getter for property
symbol. |
java.lang.String |
getThousandsSeparator()
Getter for property
thousandsSeparator. |
java.lang.String |
getTitle()
Getter for property
title. |
static void |
init()
Loads currencies from the Telegram API.
|
boolean |
isSpaceBetween()
Getter for property
spaceBetween. |
boolean |
isSymbolLeft()
Getter for property
symbolLeft. |
public Currency(java.lang.String code,
java.lang.String title,
java.lang.String symbol,
java.lang.String nativeSymbol,
java.lang.String thousandsSeparator,
java.lang.String decimalSeparator,
boolean symbolLeft,
boolean spaceBetween,
int exponent,
int minAmount,
int maxAmount)
code - three-letter ISO 4217 currency codetitle - the title of the currencysymbol - the symbol of the currencynativeSymbol - the native symbol of the currencythousandsSeparator - the thousands separator of the currencydecimalSeparator - the decimal separator of the currencysymbolLeft - true if the symbol is on the left,
false otherwisespaceBetween - true if there is a space between the
value and the symbol, false otherwiseexponent - maximum number of decimal digitsminAmount - minimum amount of pricemaxAmount - maximum amount of pricepublic static void init()
throws java.io.IOException
java.io.IOException - if an IOException occurspublic static Currency fromCode(java.lang.String code)
code - the codepublic java.lang.String format(int value,
boolean useNativeSymbol)
value - the valueuseNativeSymbol - true if you want to use
the native symbol of the currencypublic java.lang.String getCode()
code.codepublic java.lang.String getTitle()
title.titlepublic java.lang.String getSymbol()
symbol.symbolpublic java.lang.String getNativeSymbol()
nativeSymbol.nativeSymbolpublic java.lang.String getThousandsSeparator()
thousandsSeparator.thousandsSeparatorpublic java.lang.String getDecimalSeparator()
decimalSeparator.decimalSeparatorpublic boolean isSymbolLeft()
symbolLeft.symbolLeftpublic boolean isSpaceBetween()
spaceBetween.spaceBetweenpublic int getExponent()
exponent.exponentpublic int getMinAmount()
minAmount.minAmount