StateBuilders.State.Builder


public final class StateBuilders.State.Builder


Builder for State

Summary

Public constructors

Creates an instance of Builder.

Public methods

@NonNull StateBuilders.State.Builder
@RequiresSchemaVersion(major = 1, minor = 200)
<T extends DynamicBuilders.DynamicType> addKeyToValueMapping(
    @NonNull AppDataKey<T> sourceKey,
    @NonNull DynamicDataBuilders.DynamicDataValue<T> value
)

Adds an entry into any shared state between the provider and renderer.

@NonNull StateBuilders.State.Builder
@RequiresSchemaVersion(major = 1, minor = 200)
addToStateMap(@NonNull DynamicDataPair[] entries)

Adds the entries into any shared state between the provider and renderer.

@NonNull StateBuilders.State

Builds an instance from accumulated values.

@NonNull StateBuilders.State.Builder
@RequiresSchemaVersion(major = 1, minor = 200)
setStateMap(@NonNull DynamicDataMap map)

Sets the mapping for any shared state between the provider and renderer.

@NonNull StateBuilders.State.Builder
@RequiresSchemaVersion(major = 1, minor = 200)
setStateMap(@NonNull DynamicDataPair[] pairs)

Sets the mapping for any shared state between the provider and renderer.

Public constructors

Builder

Added in 1.0.0
public Builder()

Creates an instance of Builder.

Public methods

addKeyToValueMapping

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
public @NonNull StateBuilders.State.Builder <T extends DynamicBuilders.DynamicType> addKeyToValueMapping(
    @NonNull AppDataKey<T> sourceKey,
    @NonNull DynamicDataBuilders.DynamicDataValue<T> value
)

Adds an entry into any shared state between the provider and renderer.

Throws
java.lang.IllegalStateException

if adding the new key/value will make the state larger than the allowed limit (getMaxStateEntryCount).

addToStateMap

@RequiresSchemaVersion(major = 1, minor = 200)
public @NonNull StateBuilders.State.Builder addToStateMap(@NonNull DynamicDataPair[] entries)

Adds the entries into any shared state between the provider and renderer.

Throws
java.lang.IllegalArgumentException

if adding the new key/value will make the state larger than the allowed limit (getMaxStateEntryCount).

build

Added in 1.0.0
public @NonNull StateBuilders.State build()

Builds an instance from accumulated values.

Throws
java.lang.IllegalStateException

if number of key/value pairs are greater than getMaxStateEntryCount.

setStateMap

Added in 1.3.0-alpha08
@RequiresSchemaVersion(major = 1, minor = 200)
public @NonNull StateBuilders.State.Builder setStateMap(@NonNull DynamicDataMap map)

Sets the mapping for any shared state between the provider and renderer. This method replaces the current state map with the entries from map.Any previous entries added using this setStateMap or addKeyToValueMapping will be overwritten.

Throws
java.lang.IllegalArgumentException

if the size of map is larger than the allowed limit (getMaxStateEntryCount).

setStateMap

@RequiresSchemaVersion(major = 1, minor = 200)
public @NonNull StateBuilders.State.Builder setStateMap(@NonNull DynamicDataPair[] pairs)

Sets the mapping for any shared state between the provider and renderer. This method replaces the current state map with the entries from map. Any previous entries added using this setStateMap or addKeyToValueMapping will be overwritten.

Throws
java.lang.IllegalArgumentException

if the size of map is larger than the allowed limit (getMaxStateEntryCount).