MapBuilder

class MapBuilder<T>(parent: T, map: CborMap)

Map builder.

Constructors

Link copied to clipboard
constructor(parent: T, map: CborMap)

Functions

Link copied to clipboard
fun end(): T

Ends building the array.

Link copied to clipboard
fun put(key: Long, value: Boolean): MapBuilder<T>
fun put(key: Long, value: Byte): MapBuilder<T>
fun put(key: Long, value: ByteArray): MapBuilder<T>
fun put(key: Long, value: Double): MapBuilder<T>
fun put(key: Long, value: Float): MapBuilder<T>
fun put(key: Long, value: Int): MapBuilder<T>
fun put(key: Long, value: Long): MapBuilder<T>
fun put(key: Long, value: Short): MapBuilder<T>
fun put(key: Long, value: String): MapBuilder<T>
fun put(key: Long, value: DataItem): MapBuilder<T>
fun put(key: String, value: Boolean): MapBuilder<T>
fun put(key: String, value: Byte): MapBuilder<T>
fun put(key: String, value: ByteArray): MapBuilder<T>
fun put(key: String, value: Double): MapBuilder<T>
fun put(key: String, value: Float): MapBuilder<T>
fun put(key: String, value: Int): MapBuilder<T>
fun put(key: String, value: Long): MapBuilder<T>
fun put(key: String, value: Short): MapBuilder<T>
fun put(key: String, value: String): MapBuilder<T>
fun put(key: String, value: DataItem): MapBuilder<T>
fun put(key: DataItem, value: DataItem): MapBuilder<T>

Puts a new value in the map

Link copied to clipboard

Puts a new array in the map.

Link copied to clipboard
fun <T> MapBuilder<T>.putCborArray(key: Long, builderAction: ArrayBuilder<MapBuilder<T>>.() -> Unit)
fun <T> MapBuilder<T>.putCborArray(key: String, builderAction: ArrayBuilder<MapBuilder<T>>.() -> Unit)
fun <T> MapBuilder<T>.putCborArray(key: DataItem, builderAction: ArrayBuilder<MapBuilder<T>>.() -> Unit)

Adds the DataItem for a CBOR array produced by the given builder action to a CBOR map.

Link copied to clipboard
fun <T> MapBuilder<T>.putCborMap(key: Long, builderAction: MapBuilder<MapBuilder<T>>.() -> Unit)
fun <T> MapBuilder<T>.putCborMap(key: String, builderAction: MapBuilder<MapBuilder<T>>.() -> Unit)
fun <T> MapBuilder<T>.putCborMap(key: DataItem, builderAction: MapBuilder<MapBuilder<T>>.() -> Unit)

Adds the DataItem for a CBOR map produced by the given builder action to a CBOR map.

Link copied to clipboard

Puts a new map in the map.

Link copied to clipboard
fun putTagged(key: Long, tagNumber: Long, value: DataItem): MapBuilder<T>
fun putTagged(key: String, tagNumber: Long, value: DataItem): MapBuilder<T>
fun putTagged(key: DataItem, tagNumber: Long, taggedItem: DataItem): MapBuilder<T>

Puts a tagged data item in the map.

Link copied to clipboard
fun putTaggedEncodedCbor(key: Long, encodedCbor: ByteArray): MapBuilder<T>

Puts a tagged bstr with encoded CBOR in the map.