DynamicValue
Dynamic types are represented by opaque types to reduce memory allocations during transformation from one codec to another.
There are 3 kinds of possible dynamic values:
- ADTs: records or variants. These are fixed in size, and are containers to other types. These types are addressable and have identifiers. There are special cases: enums and wrapped types.
- Traversables: lists, maps, optionals. These are variable in size and are containers to other types.
- Primitives: primitive scalar types.
Codecs and code-generations should be constructed in such a way that ADTs and Traversables expecting other underlying dynamic values in processing routines should know exactly what underlying values they expect. The unwrapping of dynamic value and casting should be safe then. SchemaProcessor takes care of constructing a tree of type processors and injects correct underlying processors where needed. See examples of how this is used in codecs: JSON and Grpc and code-gens: Java and Scala.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
DynamicValue.type
Members list
Type members
Types
Boolean
Boolean
Attributes
Contract ID
Contract ID
Attributes
Local date. Number of dates since epoch (1 Jan 1970).
Local date. Number of dates since epoch (1 Jan 1970).
Attributes
ADT, Sum type - special case of sum type with parameter-less constructors.
ADT, Sum type - special case of sum type with parameter-less constructors.
Attributes
Map with arbitrarily typed keys and values. Codecs should maintain stable order of key-value entries if possible.
Map with arbitrarily typed keys and values. Codecs should maintain stable order of key-value entries if possible.
Attributes
8-byte integer
8-byte integer
Attributes
Sequence of elements
Sequence of elements
Attributes
Numeric type with precision. Represented as a String
Numeric type with precision. Represented as a String
Attributes
Optional element
Optional element
Attributes
Party
Party
Attributes
ADT, Product type. Field values have to be in the same order os in the defining type. Field names here are not necessary, as codecs knows about field names at the time of construction
ADT, Product type. Field values have to be in the same order os in the defining type. Field names here are not necessary, as codecs knows about field names at the time of construction
Attributes
Text
Text
Attributes
Map with String keys. Codecs should maintain stable order of key-value entries if possible.
Map with String keys. Codecs should maintain stable order of key-value entries if possible.
Attributes
Timestamp. Number of microseconds (10^-6^) since epoch (midnight of 1 Jan 1970) in UTC timezone.
Timestamp. Number of microseconds (10^-6^) since epoch (midnight of 1 Jan 1970) in UTC timezone.
Attributes
Unit
Unit
Attributes
ADT, Sum type. Contains constructor's ordinal index and a wrapped value.
ADT, Sum type. Contains constructor's ordinal index and a wrapped value.