Class ContractTypeCompanion<Ct,Id,ContractType,Data>

java.lang.Object
com.daml.ledger.javaapi.data.codegen.ContractTypeCompanion<Ct,Id,ContractType,Data>
Type Parameters:
Ct - The specific type of Contract representing contracts from the ledger. Always a subtype of Contract<Id, Data>.
Id - The code-generated class of ContractIds specific to this template or interface. Always a subtype of ContractId<ContractType>.
ContractType - The type argument to ContractIds of this contract type. This is the same as Data for templates, but is a pure marker type for interfaces.
Data - The "payload" data model for a contract. This is the template payload for templates, and the view type for interfaces.
Direct Known Subclasses:
ContractCompanion, InterfaceCompanion

public abstract class ContractTypeCompanion<Ct,Id,ContractType,Data> extends Object
The commonality between ContractCompanion and InterfaceCompanion.
  • Field Details

    • PACKAGE

      public final ContractTypeCompanion.Package PACKAGE
    • PACKAGE_ID

      public final String PACKAGE_ID
    • PACKAGE_NAME

      public final String PACKAGE_NAME
    • PACKAGE_VERSION

      public final PackageVersion PACKAGE_VERSION
    • TEMPLATE_ID

      public final Identifier TEMPLATE_ID
      The full template ID of the template or interface that defined this companion.
    • TEMPLATE_ID_WITH_PACKAGE_ID

      public final Identifier TEMPLATE_ID_WITH_PACKAGE_ID
    • choices

      public final Map<String,Choice<ContractType,?,?>> choices
      The provides a mapping of choice name to Choice.
       // if you statically know the name of a choice
       var c1 = Bar.COMPANION.choices.get("Transfer");
       // it is better to retrieve it directly from the generated field
       var c2 = Bar.CHOICE_Transfer;
       
  • Method Details