Constructor.
Type name, used in error messages.
OptionaltopTT: numberIf specified, encode as complete TLV; otherwise, encode as TLV-VALUE only.
OptionalsubclassSubclass constructor. This must be assigned, otherwise decoding function will not work.
Optional ReadonlytopIf specified, encode as complete TLV; otherwise, encode as TLV-VALUE only.
ReadonlytypeType name, used in error messages.
Add a field.
TLV-TYPE number.
Field name on the base class.
Field type.
Field options.
StructBuilder annotated with field typing.
Obtain a base class for the TLV structure class.
Subclass type.
StaticevdAccess EvDecoder for certain customizations.
ReadonlyafterObservers: TlvObserver<U>[]Callbacks after decoding TLV-VALUE.
ReadonlybeforeObservers: TlvObserver<U>[]Callbacks before decoding TLV-VALUE.
Statickeys
Helper to build a base class that represents a TLV structure.
Remarks
StructBuilder allows you to define the typing, constructor, encoder, and decoder, while writing each field only once. To be compatible with StructBuilder, the TLV structure being described shall contain a sequence of sub-TLV elements with distinct TLV-TYPE numbers, where each sub-TLV-TYPE appears zero, one, or multiple times.
To use StructBuilder, calling code should follow these steps:
.add()method successively to define sub-TLV elements..baseClass()method, which contains one field for each sub-TLV-TYPE as defined, along with constructor, encoding, and decoding functions..subclassproperty of the builder.