TlvStream

data class TlvStream<T : Tlv>(records: List<T>, unknown: List<GenericTlv>)

A tlv stream is a collection of tlv records. A tlv stream is constrained to a specific tlv namespace that dictates how to parse the tlv records. That namespace is provided by a trait extending the top-level tlv trait.

Parameters

records

known tlv records.

unknown

unknown tlv records.

Constructors

TlvStream
Link copied to clipboard
common
fun <T : Tlv> TlvStream(records: List<T>, unknown: List<GenericTlv> = listOf())

Types

Companion
Link copied to clipboard
common
object Companion

Functions

addOrUpdate
Link copied to clipboard
common
inline fun <R : T> addOrUpdate(r: R): TlvStream<T>

Add a record to the tlv stream. Only one record of each type is allowed, so this replaced the previous record of the same type.

get
Link copied to clipboard
common
inline fun <R : T> get(): R?

Properties

records
Link copied to clipboard
common
val records: List<T>
unknown
Link copied to clipboard
common
val unknown: List<GenericTlv>