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

net.corda.finance.contracts.asset

## Class Obligation<P>

- net.corda.finance.contracts.asset.Obligation<P>

- Type Parameters:
    `P` -

    the product the obligation is for payment of.

  All Implemented Interfaces:
    Contract

      public class Obligation<P>
      implements Contract

  An obligation contract commits the obligor to delivering a specified amount of a fungible asset (for example the `class Cash` contract) at a specified future point in time. Settlement transactions may split and merge contracts across multiple input and output states. The goal of this design is to handle amounts owed, and these contracts are expected to be netted/merged, with settlement only for any remainder amount.

  See Also:
    `class Cash`

- - ### Field Detail

    - #### PROGRAM_ID

          @NotNull
          public static java.lang.String PROGRAM_ID

      See Also:
        Constant Field Values

    - #### Companion

          public static net.corda.finance.contracts.asset.Obligation.Companion Companion

  - ### Constructor Detail

    - #### Obligation

          public Obligation()

      An obligation contract commits the obligor to delivering a specified amount of a fungible asset (for example the `class Cash` contract) at a specified future point in time. Settlement transactions may split and merge contracts across multiple input and output states. The goal of this design is to handle amounts owed, and these contracts are expected to be netted/merged, with settlement only for any remainder amount.

      See Also:
        `class Cash`

  - ### Method Detail

    - #### verify

          public void verify(@NotNull
                             LedgerTransaction tx)

      Takes an object that represents a state transition, and ensures the inputs/outputs/commands make sense. Must throw an exception if there's a problem that should prevent state transition. Takes a single object rather than an argument so that additional data can be added without breaking binary compatibility with existing contract code.