public class Currency
extends java.lang.Object
Some commonly used and known instances are also provided statically if the user wants to work offline.
Objects of this class are created using the CurrencyBuilder
and they are thread safe
and immutable.
Modifier and Type | Field and Description |
---|---|
static Currency |
CAT_CURRENCY
The original public bootstrap network currency.
|
static Currency |
CAT_HARVEST
The original public bootstrap havest currency.
|
static Currency |
SYMBOL_XYM
Currency for public / Public_test network.
|
Modifier and Type | Method and Description |
---|---|
Mosaic |
createAbsolute(java.math.BigInteger amount)
Create xem with using micro xem as unit, 1 NetworkCurrencyMosaic = 1000000 micro
NetworkCurrencyMosaic.
|
Mosaic |
createAbsolute(long amount)
Create xem with using micro xem as unit, 1 NetworkCurrencyMosaic = 1000000 micro
NetworkCurrencyMosaic.
|
Mosaic |
createRelative(java.math.BigDecimal amount)
Create xem with using xem as unit.
|
Mosaic |
createRelative(java.math.BigInteger amount)
Create xem with using xem as unit.
|
Mosaic |
createRelative(double amount)
Create xem with using xem as unit.
|
Mosaic |
createRelative(long amount)
Create xem with using xem as unit.
|
boolean |
equals(java.lang.Object o) |
int |
getDivisibility() |
java.util.Optional<MosaicId> |
getMosaicId() |
java.util.Optional<NamespaceId> |
getNamespaceId() |
UnresolvedMosaicId |
getUnresolvedMosaicId() |
int |
hashCode() |
boolean |
isSupplyMutable() |
boolean |
isTransferable() |
public static final Currency SYMBOL_XYM
This represents the per-network currency mosaic. This mosaicId is aliased with namespace name `symbol.xym`.
This simplifies offline operations but general applications should load the currency from the repository factory and network currency service.
If you are creating a private network and you need offline access, you can create a Currency in memory.
public static final Currency CAT_CURRENCY
public static final Currency CAT_HARVEST
public UnresolvedMosaicId getUnresolvedMosaicId()
public java.util.Optional<MosaicId> getMosaicId()
public java.util.Optional<NamespaceId> getNamespaceId()
public int getDivisibility()
public boolean isTransferable()
public boolean isSupplyMutable()
public Mosaic createRelative(double amount)
amount
- amount to sendpublic Mosaic createRelative(long amount)
amount
- amount to sendpublic Mosaic createRelative(java.math.BigDecimal amount)
amount
- amount to sendpublic Mosaic createRelative(java.math.BigInteger amount)
amount
- amount to sendpublic Mosaic createAbsolute(java.math.BigInteger amount)
amount
- amount to sendpublic Mosaic createAbsolute(long amount)
amount
- amount to sendpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object