Builder

class Builder @JvmOverloads constructor(copy: DataObject = EMPTY_OBJECT)

Constructors

Link copied to clipboard
constructor(copy: DataObject = EMPTY_OBJECT)

Functions

Link copied to clipboard

Creates an immutable DataObject using the values added to the builder.

Link copied to clipboard

Builds the necessary path according to the given path in order to store the given item.

Link copied to clipboard

Clears all entries in the Builder.

Link copied to clipboard
operator fun get(key: String): DataItem?

Gets the DataItem at the given key, if there is one.

Link copied to clipboard
fun put(key: String, value: Double): DataObject.Builder
fun put(key: String, value: Int): DataObject.Builder
fun put(key: String, value: Long): DataObject.Builder
fun put(key: String, value: String): DataObject.Builder

Adds the provided value into this DataObject.Builder, overwriting the existing item at that key if it already exists.

Adds a DataItemConvertible object to the DataObject. The

Link copied to clipboard

Adds all entries from the provided dataObject into this DataObject.Builder, overwriting any keys that already exist.

Link copied to clipboard

Unsafe shortcut to put any object into the DataObject. The any will attempt to be converted to a supported type. If no supported type is available, then an UnsupportedDataItemException will be thrown.

Link copied to clipboard

Attempts to put any object into the DataObject. The any will attempt to be converted to a supported type. If no supported type is available, then DataItem.NULL will be instead.

Link copied to clipboard

Adds a DataItem.NULL object to the DataObject.

Link copied to clipboard

Removes the entry currently stored at the current key. If the key does not exist, then this is a no-operation.