Class ContractTypeCompanion<ContractType,​Data>

  • Type Parameters:
    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<ContractType,​Data>
    extends java.lang.Object
    The commonality between ContractCompanion and InterfaceCompanion.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.util.Map<java.lang.String,​Choice<ContractType,​?,​?>> choices
      The provides a mapping of choice name to Choice.
      Identifier TEMPLATE_ID
      The full template ID of the template or interface that defined this companion.
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • TEMPLATE_ID

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

        public final java.util.Map<java.lang.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;