net.corda.core.contracts

## Class Commodity

- net.corda.core.contracts.Commodity

-     public class Commodity

  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.

  See Also:
    Currency, CommodityContract

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Commodity.Companion`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Commodity.Companion` | `Companion`

  - ### Constructor Summary

    Constructors
    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.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `component1()`
    `java.lang.String` | `component2()`
    `int` | `component3()`
    `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()`
    `int` | `getDefaultFractionDigits()`
    `java.lang.String` | `getDisplayName()`
    `int` | `hashCode()`
    `java.lang.String` | `toString()`

- - ### Field Detail

    - #### Companion

          public static Commodity.Companion Companion

  - ### Constructor Detail

    - #### Commodity

          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.

      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.
      See Also:
        Currency, CommodityContract

  - ### Method Detail

    - #### getCommodityCode

          public java.lang.String getCommodityCode()

    - #### getDisplayName

          public java.lang.String getDisplayName()

    - #### getDefaultFractionDigits

          public int getDefaultFractionDigits()

    - #### component1

          public java.lang.String component1()

    - #### component2

          public java.lang.String component2()

    - #### component3

          public int component3()

    - #### copy

          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.

      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.
      See Also:
        Currency, CommodityContract

    - #### toString

          public java.lang.String toString()

    - #### hashCode

          public int hashCode()

    - #### equals

          public boolean equals(java.lang.Object p)