Class PrimitiveValueDecoders
java.lang.Object
com.daml.ledger.javaapi.data.codegen.PrimitiveValueDecoders
ValueDecoders for Daml types that are not code-generated.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ValueDecoder<Boolean>static final ValueDecoder<LocalDate>static final ValueDecoder<Long>static final ValueDecoder<BigDecimal>static final ValueDecoder<String>static final ValueDecoder<String>static final ValueDecoder<Instant>static final ValueDecoder<Unit> -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ValueDecoder<ContractId<T>>fromContractId(ValueDecoder<T> contractType) static <K,V> ValueDecoder<Map<K, V>> fromGenMap(ValueDecoder<K> keyType, ValueDecoder<V> valueType) Specifically for decoding theDA.Internal.LF.Mapprimitive type.static <T> ValueDecoder<List<T>>fromList(ValueDecoder<T> element) static <T> ValueDecoder<Optional<T>>fromOptional(ValueDecoder<T> element) static <T> ValueDecoder<Map<String,T>> fromTextMap(ValueDecoder<T> valueType) Specifically for decoding theDA.Internal.LF.TextMapprimitive type.static <T> ValueDecoder<T>Can be passed to decoder-producing functions to decode phantom type parameters only.
-
Field Details
-
fromBool
-
fromInt64
-
fromText
-
fromTimestamp
-
fromParty
-
fromUnit
-
fromDate
-
fromNumeric
-
-
Method Details
-
fromList
-
fromOptional
-
fromContractId
-
fromTextMap
Specifically for decoding theDA.Internal.LF.TextMapprimitive type.// given a ValueDecoder<V> vdv // this decodes a TextMap Map<String, V> m1 = fromTextMap(vdv).decode(value); // this decodes a GenMap with a Text key type // which has an incompatible encoded format Map<String, V> m2 = fromGenMap(fromText, vdv).decode(value);
-
fromGenMap
public static <K,V> ValueDecoder<Map<K,V>> fromGenMap(ValueDecoder<K> keyType, ValueDecoder<V> valueType) Specifically for decoding theDA.Internal.LF.Mapprimitive type. -
impossible
Can be passed to decoder-producing functions to decode phantom type parameters only. Such type parameters appear on the left of the=indatadeclarations, but are used for no actual data. This will fail at runtime if the type parameter isn't really phantom.
-