Commodity
Keywords: net.corda.finance.contracts.Commodity class
Date: 2023-09-18

net.corda.finance.contracts

## Class Commodity

- net.corda.finance.contracts.Commodity

- All Implemented Interfaces:
    TokenizableAssetInfo

      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.

  See Also:
    Currency, CommodityContract

- - ### Field Detail

    - #### Companion

          public static net.corda.finance.contracts.Commodity.Companion Companion

  - ### Constructor Detail

    - #### Commodity

          public Commodity(@NotNull
                           java.lang.String commodityCode,
                           @NotNull
                           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, 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.
      See Also:
        Currency, CommodityContract

  - ### Method Detail

    - #### getDisplayTokenSize

          @NotNull
          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.

    - #### getCommodityCode

          @NotNull
          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.

    - #### getDisplayName

          @NotNull
          public java.lang.String getDisplayName()

      human readable name for the commodity.

    - #### getDefaultFractionDigits

          public int getDefaultFractionDigits()

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

      this commodity.

    - #### component1

          @NotNull
          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.

    - #### component2

          @NotNull
          public java.lang.String component2()

      human readable name for the commodity.

    - #### component3

          public int component3()

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

      this commodity.

    - #### copy

          @NotNull
          public Commodity copy(@NotNull
                                         java.lang.String commodityCode,
                                         @NotNull
                                         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

          @NotNull
          public java.lang.String toString()

      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

    - #### hashCode

          public int hashCode()

      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

    - #### equals

          public boolean equals(@Nullable
                                java.lang.Object p)

      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