Background.Builder


class Background.Builder


A builder of Background.

Summary

Public constructors

Returns an empty Builder instance.

Builder(background: Background)

Returns a new Builder with the data from the given Background instance.

Public functions

Background

Constructs the Background defined by this builder.

Background.Builder

Sets the CarColor to be used for the background.

Background.Builder
setImage(image: CarIcon)

Sets the CarIcon that will be displayed as the background.

Public constructors

Builder

Added in 1.8.0
Builder()

Returns an empty Builder instance.

Builder

Added in 1.8.0
Builder(background: Background)

Returns a new Builder with the data from the given Background instance.

Public functions

build

Added in 1.8.0
fun build(): Background

Constructs the Background defined by this builder.

Ensures that exactly one of either an image or a color is set for the background.

Throws
java.lang.IllegalStateException

if neither an image nor a color is set, or if both an image and a color are set.

setColor

Added in 1.8.0
fun setColor(color: CarColor): Background.Builder

Sets the CarColor to be used for the background.

Throws
java.lang.NullPointerException

if color is null

setImage

Added in 1.8.0
fun setImage(image: CarIcon): Background.Builder

Sets the CarIcon that will be displayed as the background.

Throws
java.lang.NullPointerException

if image is null

java.lang.IllegalArgumentException

if image is not of type TYPE_CUSTOM