Data.Builder

class Data.Builder


A builder for Data objects.

Summary

Public constructors

Public functions

Data

Builds a Data object.

Data.Builder
putAll(data: Data)

Puts all input key-value pairs from a Data into the Builder.

Data.Builder
putAll(values: Map<StringAny?>)

Puts all input key-value pairs from a Map into the Builder.

Data.Builder
putBoolean(key: String, value: Boolean)

Puts a boolean into the arguments.

Data.Builder

Puts a boolean array into the arguments.

Data.Builder
putByte(key: String, value: Byte)

Puts an byte into the arguments.

Data.Builder
putByteArray(key: String, value: ByteArray)

Puts an integer array into the arguments.

Data.Builder
putDouble(key: String, value: Double)

Puts a double into the arguments.

Data.Builder

Puts a double array into the arguments.

Data.Builder
putFloat(key: String, value: Float)

Puts a float into the arguments.

Data.Builder

Puts a float array into the arguments.

Data.Builder
putInt(key: String, value: Int)

Puts an integer into the arguments.

Data.Builder
putIntArray(key: String, value: IntArray)

Puts an integer array into the arguments.

Data.Builder
putLong(key: String, value: Long)

Puts a long into the arguments.

Data.Builder
putLongArray(key: String, value: LongArray)

Puts a long array into the arguments.

Data.Builder
putString(key: String, value: String?)

Puts a String into the arguments.

Data.Builder
putStringArray(key: String, value: Array<String?>)

Puts a String array into the arguments.

Public constructors

Builder

Added in 1.0.0
Builder()

Public functions

build

Added in 1.0.0
fun build(): Data

Builds a Data object.

Returns
Data

The Data object containing all key-value pairs specified by this Builder.

putAll

Added in 1.0.0
fun putAll(data: Data): Data.Builder

Puts all input key-value pairs from a Data into the Builder.

Valid value types are: Boolean, Integer, Long, Float, Double, String, and their array versions. Invalid types will throw an IllegalArgumentException.

Parameters
data: Data

Data containing key-value pairs to add

Returns
Data.Builder

The Builder

putAll

Added in 1.0.0
fun putAll(values: Map<StringAny?>): Data.Builder

Puts all input key-value pairs from a Map into the Builder.

Valid value types are: Boolean, Integer, Long, Float, Double, String, and their array versions. Invalid types will throw an IllegalArgumentException.

Parameters
values: Map<StringAny?>

A Map of key-value pairs to add

Returns
Data.Builder

The Builder

putBoolean

Added in 1.0.0
fun putBoolean(key: String, value: Boolean): Data.Builder

Puts a boolean into the arguments.

Parameters
key: String

The key for this argument

value: Boolean

The value for this argument

Returns
Data.Builder

The Builder

putBooleanArray

Added in 1.0.0
fun putBooleanArray(key: String, value: BooleanArray): Data.Builder

Puts a boolean array into the arguments.

Parameters
key: String

The key for this argument

value: BooleanArray

The value for this argument

Returns
Data.Builder

The Builder

putByte

Added in 2.1.0
fun putByte(key: String, value: Byte): Data.Builder

Puts an byte into the arguments.

Parameters
key: String

The key for this argument

value: Byte

The value for this argument

Returns
Data.Builder

The Builder

putByteArray

Added in 2.1.0
fun putByteArray(key: String, value: ByteArray): Data.Builder

Puts an integer array into the arguments.

Parameters
key: String

The key for this argument

value: ByteArray

The value for this argument

Returns
Data.Builder

The Builder

putDouble

Added in 1.0.0
fun putDouble(key: String, value: Double): Data.Builder

Puts a double into the arguments.

Parameters
key: String

The key for this argument

value: Double

The value for this argument

Returns
Data.Builder

The Builder

putDoubleArray

Added in 1.0.0
fun putDoubleArray(key: String, value: DoubleArray): Data.Builder

Puts a double array into the arguments.

Parameters
key: String

The key for this argument

value: DoubleArray

The value for this argument

Returns
Data.Builder

The Builder

putFloat

Added in 1.0.0
fun putFloat(key: String, value: Float): Data.Builder

Puts a float into the arguments.

Parameters
key: String

The key for this argument

value: Float

The value for this argument

Returns
Data.Builder

The Builder

putFloatArray

Added in 1.0.0
fun putFloatArray(key: String, value: FloatArray): Data.Builder

Puts a float array into the arguments.

Parameters
key: String

The key for this argument

value: FloatArray

The value for this argument

Returns
Data.Builder

The Builder

putInt

Added in 1.0.0
fun putInt(key: String, value: Int): Data.Builder

Puts an integer into the arguments.

Parameters
key: String

The key for this argument

value: Int

The value for this argument

Returns
Data.Builder

The Builder

putIntArray

Added in 1.0.0
fun putIntArray(key: String, value: IntArray): Data.Builder

Puts an integer array into the arguments.

Parameters
key: String

The key for this argument

value: IntArray

The value for this argument

Returns
Data.Builder

The Builder

putLong

Added in 1.0.0
fun putLong(key: String, value: Long): Data.Builder

Puts a long into the arguments.

Parameters
key: String

The key for this argument

value: Long

The value for this argument

Returns
Data.Builder

The Builder

putLongArray

Added in 1.0.0
fun putLongArray(key: String, value: LongArray): Data.Builder

Puts a long array into the arguments.

Parameters
key: String

The key for this argument

value: LongArray

The value for this argument

Returns
Data.Builder

The Builder

putString

Added in 1.0.0
fun putString(key: String, value: String?): Data.Builder

Puts a String into the arguments.

Parameters
key: String

The key for this argument

value: String?

The value for this argument

Returns
Data.Builder

The Builder

putStringArray

Added in 1.0.0
fun putStringArray(key: String, value: Array<String?>): Data.Builder

Puts a String array into the arguments.

Parameters
key: String

The key for this argument

value: Array<String?>

The value for this argument

Returns
Data.Builder

The Builder