Complete documentation page mirrored and translated for learning. Attribution is shown at the bottom of each article.

阅读中文版

referencejavacom-daml-ledger-javaapi-data-codegenvaluedecoder

ValueDecoder

Documentation Index

Fetch the complete documentation index at: https://docs.canton.network/llms.txt Use this file to discover all available pages before exploring further.

ValueDecoder

A converter from the encoded form of a Daml value, represented by Value, to the codegen-decoded form, represented by Data. Every codegen class for a template, record, or variant includes a valueDecoder method that produces one of these. If the data type has type parameters, valueDecoder has arguments that correspond to ValueDecoders for those type arguments. For primitive types that are not code-generated, see PrimitiveValueDecoders. // given template ‘Foo’, and encoded payload ‘Value fooValue’ Foo foo = Foo.valueDecoder().decode(fooValue); // given Daml datatypes ‘Bar a b’ and ‘Baz’, // and encoded ‘Bar’ ‘Value barValue’ Bar<Baz, Long> bar = Bar.valueDecoder( Baz.valueDecoder(), PrimitiveValueDecoders.fromInt64) .decode(barValue); Bar<List, Map<Long, String>> barWithAggregates = Bar.valueDecoder( PrimitiveValueDecoders.fromList(Baz.valueDecoder), PrimitiveValueDecoders.fromGenMap( PrimitiveValueDecoders.fromInt64, PrimitiveValueDecoders.fromText)) .decode(barAggregateValue);

ValueDecoder - stable

Upstream docs: Open

Signature

@FunctionalInterface public interface ValueDecoder<Data>

Members

DocsMemberIntroducedDeprecatedRemoved
Opendecode(Value)3.4.8--

Mirrored from Canton Network official documentation (CC-BY-4.0) by CC Privacy Club for learning purposes.