Background.Builder
class Background.Builder
A builder of Background.
Summary
Public constructors |
|---|
Builder()Returns an empty |
Builder(background: Background)Returns a new |
Public functions |
|
|---|---|
Background |
build()Constructs the |
Background.Builder |
Sets the |
Background.Builder |
Sets the |
Public constructors
Builder
Builder(background: Background)
Returns a new Builder with the data from the given Background instance.
Public functions
build
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
fun setColor(color: CarColor): Background.Builder
Sets the CarColor to be used for the background.
| Throws | |
|---|---|
java.lang.NullPointerException |
if |
setImage
fun setImage(image: CarIcon): Background.Builder
Sets the CarIcon that will be displayed as the background.
| Throws | |
|---|---|
java.lang.NullPointerException |
if |
java.lang.IllegalArgumentException |
if |