DynamicDataBuilders.DynamicDataValue


@RequiresSchemaVersion(major = 1, minor = 200)
interface DynamicDataBuilders.DynamicDataValue<T : DynamicBuilders.DynamicType?>


Interface defining a dynamic data value.

Summary

Public functions

java-static DynamicDataBuilders.DynamicDataValue<DynamicBuilders.DynamicBool!>
@RequiresSchemaVersion(major = 1, minor = 200)
fromBool(constant: Boolean)

Creates a boolean DynamicDataValue.

java-static DynamicDataBuilders.DynamicDataValue<Any!>

Creates a DynamicDataValue from a byte array generated by toDynamicDataValueByteArray.

java-static DynamicDataBuilders.DynamicDataValue<Any!>
fromByteArray(byteArray: ByteArray, offset: Int, length: Int)

Creates a DynamicDataValue from the provided byte array at the provided offset and length, that was generated by one of the toDynamicDataValueByteArray overloads.

java-static DynamicDataBuilders.DynamicDataValue<DynamicBuilders.DynamicColor!>
@RequiresSchemaVersion(major = 1, minor = 200)
fromColor(constant: @ColorInt Int)

Creates a color DynamicDataValue.

java-static DynamicDataBuilders.DynamicDataValue<DynamicBuilders.DynamicDuration!>
@RequiresSchemaVersion(major = 1, minor = 300)
fromDuration(constant: Duration)

Creates a DurationDynamicDataValue.

java-static DynamicDataBuilders.DynamicDataValue<DynamicBuilders.DynamicFloat!>
@RequiresSchemaVersion(major = 1, minor = 200)
fromFloat(constant: Float)

Creates a float DynamicDataValue.

java-static DynamicDataBuilders.DynamicDataValue<DynamicBuilders.DynamicInstant!>
@RequiresSchemaVersion(major = 1, minor = 300)
fromInstant(constant: Instant)

Creates an InstantDynamicDataValue.

java-static DynamicDataBuilders.DynamicDataValue<DynamicBuilders.DynamicInt32!>
@RequiresSchemaVersion(major = 1, minor = 200)
fromInt(constant: Int)

Creates a int DynamicDataValue.

java-static DynamicDataBuilders.DynamicDataValue<DynamicBuilders.DynamicString!>
@RequiresSchemaVersion(major = 1, minor = 200)
fromString(constant: String)

Creates a string DynamicDataValue.

Boolean

Returns the boolean value stored in this DynamicDataValue.

@ColorInt Int

Returns the color value stored in this DynamicDataValue.

Duration

Returns the Duration value stored in this DynamicDataValue.

Float

Returns the float value stored in this DynamicDataValue.

Instant

Returns the Instant value stored in this DynamicDataValue.

Int

Returns the int value stored in this DynamicDataValue.

String

Returns the String value stored in this DynamicDataValue.

Boolean

Returns true if the DynamicDataValue contains a boolean value.

Boolean

Returns true if the DynamicDataValue contains a color value.

Boolean

Returns true if the DynamicDataValue contains an Duration value.

Boolean

Returns true if the DynamicDataValue contains a float value.

Boolean

Returns true if the DynamicDataValue contains an Instant value.

Boolean

Returns true if the DynamicDataValue contains an int value.

Boolean

Returns true if the DynamicDataValue contains a String value.

ByteArray<Byte>

Serializes the DynamicDataValue into a new byte array that can later be used with fromByteArray.

Int

Serializes the DynamicDataValue into the provided byte array, returning the amount of bytes written, that can later be used with DynamicDataValue.fromByteArray(byteArray, 0, bytesWritten).

Int
toDynamicDataValueByteArray(byteArray: ByteArray, offset: Int, length: Int)

Serializes the DynamicDataValue into the provided byte array, returning the amount of bytes written, limited by the provided offset and length, that can later be used with DynamicDataValue.fromByteArray(byteArray, offset, bytesWritten).

Public functions

fromBool

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
java-static fun fromBool(constant: Boolean): DynamicDataBuilders.DynamicDataValue<DynamicBuilders.DynamicBool!>

Creates a boolean DynamicDataValue.

fromByteArray

Added in 1.0.0
java-static fun fromByteArray(byteArray: ByteArray): DynamicDataBuilders.DynamicDataValue<Any!>

Creates a DynamicDataValue from a byte array generated by toDynamicDataValueByteArray.

Throws
java.lang.IllegalArgumentException

if the byte array does not contain a valid serialization

fromByteArray

Added in 1.0.0
java-static fun fromByteArray(byteArray: ByteArray, offset: Int, length: Int): DynamicDataBuilders.DynamicDataValue<Any!>

Creates a DynamicDataValue from the provided byte array at the provided offset and length, that was generated by one of the toDynamicDataValueByteArray overloads.

Throws
java.lang.IllegalArgumentException

if the byte array does not contain a valid serialization in the provided offset and length

fromColor

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
java-static fun fromColor(constant: @ColorInt Int): DynamicDataBuilders.DynamicDataValue<DynamicBuilders.DynamicColor!>

Creates a color DynamicDataValue.

fromDuration

Added in 1.1.0
@RequiresSchemaVersion(major = 1, minor = 300)
java-static fun fromDuration(constant: Duration): DynamicDataBuilders.DynamicDataValue<DynamicBuilders.DynamicDuration!>

Creates a DurationDynamicDataValue.

fromFloat

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
java-static fun fromFloat(constant: Float): DynamicDataBuilders.DynamicDataValue<DynamicBuilders.DynamicFloat!>

Creates a float DynamicDataValue.

fromInstant

Added in 1.1.0
@RequiresSchemaVersion(major = 1, minor = 300)
java-static fun fromInstant(constant: Instant): DynamicDataBuilders.DynamicDataValue<DynamicBuilders.DynamicInstant!>

Creates an InstantDynamicDataValue.

fromInt

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
java-static fun fromInt(constant: Int): DynamicDataBuilders.DynamicDataValue<DynamicBuilders.DynamicInt32!>

Creates a int DynamicDataValue.

fromString

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
java-static fun fromString(constant: String): DynamicDataBuilders.DynamicDataValue<DynamicBuilders.DynamicString!>

Creates a string DynamicDataValue.

getBoolValue

Added in 1.1.0
fun getBoolValue(): Boolean

Returns the boolean value stored in this DynamicDataValue.

Throws
java.lang.IllegalStateException

if the DynamicDataValue doesn't contain a boolean value.

getColorValue

Added in 1.1.0
fun getColorValue(): @ColorInt Int

Returns the color value stored in this DynamicDataValue.

Throws
java.lang.IllegalStateException

if the DynamicDataValue doesn't contain a color value.

getDurationValue

Added in 1.1.0
fun getDurationValue(): Duration

Returns the Duration value stored in this DynamicDataValue.

Throws
java.lang.IllegalStateException

if the DynamicDataValue doesn't contain an value.

getFloatValue

Added in 1.1.0
fun getFloatValue(): Float

Returns the float value stored in this DynamicDataValue.

Throws
java.lang.IllegalStateException

if the DynamicDataValue doesn't contain a float value.

getInstantValue

Added in 1.1.0
fun getInstantValue(): Instant

Returns the Instant value stored in this DynamicDataValue.

Throws
java.lang.IllegalStateException

if the DynamicDataValue doesn't contain an value.

getIntValue

Added in 1.1.0
fun getIntValue(): Int

Returns the int value stored in this DynamicDataValue.

Throws
java.lang.IllegalStateException

if the DynamicDataValue doesn't contain an int value.

getStringValue

Added in 1.1.0
fun getStringValue(): String

Returns the String value stored in this DynamicDataValue.

Throws
java.lang.IllegalStateException

if the DynamicDataValue doesn't contain a String value.

hasBoolValue

Added in 1.1.0
fun hasBoolValue(): Boolean

Returns true if the DynamicDataValue contains a boolean value. Otherwise returns false.

hasColorValue

Added in 1.1.0
fun hasColorValue(): Boolean

Returns true if the DynamicDataValue contains a color value. Otherwise returns false.

hasDurationValue

Added in 1.1.0
fun hasDurationValue(): Boolean

Returns true if the DynamicDataValue contains an Duration value. Otherwise returns false.

hasFloatValue

Added in 1.1.0
fun hasFloatValue(): Boolean

Returns true if the DynamicDataValue contains a float value. Otherwise returns false.

hasInstantValue

Added in 1.1.0
fun hasInstantValue(): Boolean

Returns true if the DynamicDataValue contains an Instant value. Otherwise returns false.

hasIntValue

Added in 1.1.0
fun hasIntValue(): Boolean

Returns true if the DynamicDataValue contains an int value. Otherwise returns false.

hasStringValue

Added in 1.1.0
fun hasStringValue(): Boolean

Returns true if the DynamicDataValue contains a String value. Otherwise returns false.

toDynamicDataValueByteArray

Added in 1.0.0
fun toDynamicDataValueByteArray(): ByteArray<Byte>

Serializes the DynamicDataValue into a new byte array that can later be used with fromByteArray.

toDynamicDataValueByteArray

Added in 1.0.0
fun toDynamicDataValueByteArray(byteArray: ByteArray): Int

Serializes the DynamicDataValue into the provided byte array, returning the amount of bytes written, that can later be used with DynamicDataValue.fromByteArray(byteArray, 0, bytesWritten).

Throws
java.lang.IllegalArgumentException

if the byte array is too small

toDynamicDataValueByteArray

Added in 1.0.0
fun toDynamicDataValueByteArray(byteArray: ByteArray, offset: Int, length: Int): Int

Serializes the DynamicDataValue into the provided byte array, returning the amount of bytes written, limited by the provided offset and length, that can later be used with DynamicDataValue.fromByteArray(byteArray, offset, bytesWritten).

Throws
java.lang.IllegalArgumentException

if the byte array is too small