public class Commodity implements TokenizableAssetInfo
Class representing a commodity, as an equivalent to the Currency class. This exists purely to enable the CommodityContract contract, and is likely to change in future.
Modifier and Type | Class and Description |
---|---|
static class |
Commodity.Companion |
Modifier and Type | Field and Description |
---|---|
static Commodity.Companion |
Companion |
Constructor and Description |
---|
Commodity(java.lang.String commodityCode,
java.lang.String displayName,
int defaultFractionDigits)
Class representing a commodity, as an equivalent to the Currency class. This exists purely to enable the
CommodityContract contract, and is likely to change in future.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
component1()
a unique code for the commodity.
|
java.lang.String |
component2()
human readable name for the commodity.
|
int |
component3()
the number of digits normally after the decimal point when referring to quantities of
|
Commodity |
copy(java.lang.String commodityCode,
java.lang.String displayName,
int defaultFractionDigits)
Class representing a commodity, as an equivalent to the Currency class. This exists purely to enable the
CommodityContract contract, and is likely to change in future.
|
boolean |
equals(java.lang.Object p) |
java.lang.String |
getCommodityCode()
a unique code for the commodity.
|
int |
getDefaultFractionDigits()
the number of digits normally after the decimal point when referring to quantities of
|
java.lang.String |
getDisplayName()
human readable name for the commodity.
|
java.math.BigDecimal |
getDisplayTokenSize()
The nominal display unit size of a single token, potentially with trailing decimal display places if the scale parameter is non-zero.
|
int |
hashCode() |
java.lang.String |
toString() |
getDisplayTokenSize
public static Commodity.Companion Companion
public Commodity(java.lang.String commodityCode, java.lang.String displayName, int defaultFractionDigits)
Class representing a commodity, as an equivalent to the Currency class. This exists purely to enable the CommodityContract contract, and is likely to change in future.
commodityCode
- a unique code for the commodity. No specific registry for these is currently defined, althoughthis is likely to change in future.displayName
- human readable name for the commodity.defaultFractionDigits
- the number of digits normally after the decimal point when referring to quantities ofthis commodity.commodityCode
- a unique code for the commodity. No specific registry for these is currently defined, although
this is likely to change in future.displayName
- human readable name for the commodity.defaultFractionDigits
- the number of digits normally after the decimal point when referring to quantities of
this commodity.public java.math.BigDecimal getDisplayTokenSize()
The nominal display unit size of a single token, potentially with trailing decimal display places if the scale parameter is non-zero.
public java.lang.String getCommodityCode()
a unique code for the commodity.
No specific registry for these is currently defined, althoughthis is likely to change in future.
public java.lang.String getDisplayName()
human readable name for the commodity.
public int getDefaultFractionDigits()
the number of digits normally after the decimal point when referring to quantities of
this commodity.
public java.lang.String component1()
a unique code for the commodity.
No specific registry for these is currently defined, althoughthis is likely to change in future.
public java.lang.String component2()
human readable name for the commodity.
public int component3()
the number of digits normally after the decimal point when referring to quantities of
this commodity.
public Commodity copy(java.lang.String commodityCode, java.lang.String displayName, int defaultFractionDigits)
Class representing a commodity, as an equivalent to the Currency class. This exists purely to enable the CommodityContract contract, and is likely to change in future.
commodityCode
- a unique code for the commodity. No specific registry for these is currently defined, although
this is likely to change in future.displayName
- human readable name for the commodity.defaultFractionDigits
- the number of digits normally after the decimal point when referring to quantities of
this commodity.public java.lang.String toString()
public int hashCode()
public boolean equals(java.lang.Object p)