Class ContractCompanion<Ct,Id,Data>
java.lang.Object
com.daml.ledger.javaapi.data.codegen.ContractTypeCompanion<Ct,Id,Data,Data>
com.daml.ledger.javaapi.data.codegen.ContractCompanion<Ct,Id,Data>
- Type Parameters:
Ct- TheContractsubclass generated within the template class.Id- TheContractIdsubclass generated within the template class.Data- The generatedTemplatesubclass named after the template, whose instances contain only the payload.
- Direct Known Subclasses:
ContractCompanion.WithKey,ContractCompanion.WithoutKey
Metadata and utilities associated with a template as a whole, rather than one single contract
made from that template.
Application code should not instantiate or subclass; instead, refer to the
COMPANION field on generated Template subclasses. All
protected members herein are considered part of the INTERNAL API.
Every instance is either a ContractCompanion.WithKey or ContractCompanion.WithoutKey, depending on whether the
template defined a key type. ContractCompanion.WithKey defines extra utilities for working with
contract keys.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic final classstatic final classNested classes/interfaces inherited from class com.daml.ledger.javaapi.data.codegen.ContractTypeCompanion
ContractTypeCompanion.Package -
Field Summary
FieldsFields inherited from class com.daml.ledger.javaapi.data.codegen.ContractTypeCompanion
choices, PACKAGE, PACKAGE_ID, PACKAGE_NAME, PACKAGE_VERSION, TEMPLATE_ID, TEMPLATE_ID_WITH_PACKAGE_ID -
Method Summary
Modifier and TypeMethodDescriptionstatic <Data> ValueDecoder<Data>valueDecoder(ContractCompanion<?, ? extends ContractId<Data>, Data> companion) Static method to generate an implementation ofValueDecoderof typeDatawith metadata from the providedContractCompanion.Methods inherited from class com.daml.ledger.javaapi.data.codegen.ContractTypeCompanion
fromCreatedEvent, getTemplateIdWithPackageId, toContractId
-
Field Details
-
fromJson
-
-
Method Details
-
valueDecoder
public static <Data> ValueDecoder<Data> valueDecoder(ContractCompanion<?, ? extends ContractId<Data>, Data> companion) Static method to generate an implementation ofValueDecoderof typeDatawith metadata from the providedContractCompanion.- Parameters:
companion- an instance ofContractCompanion.- Returns:
- The
ValueDecoderfor parsingValueto get an instance ofData.
-
fromJson
- Throws:
JsonLfDecoder.Error
-