ResourceBuilders.Resources.Builder


class ResourceBuilders.Resources.Builder


Builder for Resources

Summary

Public constructors

Creates an instance of Builder.

Public functions

ResourceBuilders.Resources.Builder

Adds an entry into a map of resource_ids to images, which can be used by layouts.

ResourceBuilders.Resources

Builds an instance from accumulated values.

ResourceBuilders.Resources.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setVersion(version: String)

Sets the version of this Resources instance.

Public constructors

Builder

Added in 1.0.0
Builder()

Creates an instance of Builder.

Public functions

addIdToImageMapping

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
fun addIdToImageMapping(id: String, image: ResourceBuilders.ImageResource): ResourceBuilders.Resources.Builder

Adds an entry into a map of resource_ids to images, which can be used by layouts.

build

Added in 1.0.0
fun build(): ResourceBuilders.Resources

Builds an instance from accumulated values.

setVersion

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
fun setVersion(version: String): ResourceBuilders.Resources.Builder

Sets the version of this Resources instance.

Each layout specifies the version of resources it requires. After fetching a layout, the renderer will use the resources version specified by the layout to separately fetch the resources.

This value must match the version of the resources required by the layout for the layout to render successfully, and must match the resource version specified in ResourcesRequest which triggered this request.