Class ContractTypeCompanion<ContractType,Data>
- java.lang.Object
-
- com.daml.ledger.javaapi.data.codegen.ContractTypeCompanion<ContractType,Data>
-
- Type Parameters:
ContractType- The type argument toContractIds of this contract type. This is the same asDatafor 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.ObjectThe commonality betweenContractCompanionandInterfaceCompanion.
-
-
Field Summary
Fields Modifier and Type Field Description java.util.Map<java.lang.String,ChoiceMetadata<ContractType,?,?>>choicesThe provides a mapping of choice name to Choice.IdentifierTEMPLATE_IDThe full template ID of the template or interface that defined this companion.
-
Constructor Summary
Constructors Modifier Constructor Description protectedContractTypeCompanion(Identifier templateId, java.lang.String templateClassName, java.util.List<ChoiceMetadata<ContractType,?,?>> choices)INTERNAL API: this is meant for use byContractCompanionandInterfaceCompanion, and should not be referenced directly.
-
-
-
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,ChoiceMetadata<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;
-
-
Constructor Detail
-
ContractTypeCompanion
protected ContractTypeCompanion(Identifier templateId, java.lang.String templateClassName, java.util.List<ChoiceMetadata<ContractType,?,?>> choices)
INTERNAL API: this is meant for use byContractCompanionandInterfaceCompanion, and should not be referenced directly. Applications should refer to code-generatedCOMPANIONandINTERFACEfields specific to the template or interface in question instead.
-
-