corda / net.corda.finance.contracts / Commodity

Commodity

data class Commodity : 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.

Parameters

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.

Constructors

<init>

Commodity(commodityCode: String, displayName: String, defaultFractionDigits: Int = 0)

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.

Properties

commodityCode

val commodityCode: String

a unique code for the commodity. No specific registry for these is currently defined, although this is likely to change in future.

defaultFractionDigits

val defaultFractionDigits: Int

the number of digits normally after the decimal point when referring to quantities of this commodity.

displayName

val displayName: String

human readable name for the commodity.

displayTokenSize

val displayTokenSize: BigDecimal

The nominal display unit size of a single token, potentially with trailing decimal display places if the scale parameter is non-zero.

Companion Object Functions

getInstance

fun getInstance(commodityCode: String): Commodity?

Extension Functions

contextLogger

fun Any.contextLogger(): Logger

When called from a companion object, returns the logger for the enclosing class.