Package de.eimmer
Class FeuerwerkEffekt.Builder
java.lang.Object
de.eimmer.FeuerwerkEffekt.Builder
- Enclosing class:
FeuerwerkEffekt
This is a builder for FireworkEffects.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Create aFeuerwerkEffekt
from the current contents of this builder.flicker
(boolean flicker) Set whether the firework effect should flicker.trail
(boolean trail) Set whether the firework effect should have a trail.with
(FeuerwerkEffekt.Type type) Specify the type of the firework effect.Add a primary farbe to the firework effect.Add several primary farbes to the firework effect.Add several primary farbes to the firework effect.Add a fade farbe to the firework effect.Add several fade farbes to the firework effect.Add several fade farbes to the firework effect.Add a flicker to the firework effect.Add a trail to the firework effect.
-
Method Details
-
with
@NotNull public FeuerwerkEffekt.Builder with(@NotNull FeuerwerkEffekt.Type type) throws IllegalArgumentException Specify the type of the firework effect.- Parameters:
type
- The effect type- Returns:
- This object, for chaining
- Throws:
IllegalArgumentException
- If type is null
-
withFlicker
Add a flicker to the firework effect.- Returns:
- This object, for chaining
-
flicker
Set whether the firework effect should flicker.- Parameters:
flicker
- true if it should flicker, false if not- Returns:
- This object, for chaining
-
withTrail
Add a trail to the firework effect.- Returns:
- This object, for chaining
-
trail
Set whether the firework effect should have a trail.- Parameters:
trail
- true if it should have a trail, false for no trail- Returns:
- This object, for chaining
-
withColor
@NotNull public FeuerwerkEffekt.Builder withColor(@NotNull Farbe farbe) throws IllegalArgumentException Add a primary farbe to the firework effect.- Parameters:
farbe
- The farbe to add- Returns:
- This object, for chaining
- Throws:
IllegalArgumentException
- If farbe is null
-
withColor
@NotNull public FeuerwerkEffekt.Builder withColor(@NotNull Farbe... farbes) throws IllegalArgumentException Add several primary farbes to the firework effect.- Parameters:
farbes
- The farbes to add- Returns:
- This object, for chaining
- Throws:
IllegalArgumentException
- If farbes is nullIllegalArgumentException
- If any color is null (may be thrown after changes have occurred)
-
withColor
@NotNull public FeuerwerkEffekt.Builder withColor(@NotNull Iterable<?> colors) throws IllegalArgumentException Add several primary farbes to the firework effect.- Parameters:
colors
- An iterable object whose iterator yields the desired farbes- Returns:
- This object, for chaining
- Throws:
IllegalArgumentException
- If farbes is nullIllegalArgumentException
- If any color is null (may be thrown after changes have occurred)
-
withFade
@NotNull public FeuerwerkEffekt.Builder withFade(@NotNull Farbe farbe) throws IllegalArgumentException Add a fade farbe to the firework effect.- Parameters:
farbe
- The farbe to add- Returns:
- This object, for chaining
- Throws:
IllegalArgumentException
- If farbes is nullIllegalArgumentException
- If any farbe is null (may be thrown after changes have occurred)
-
withFade
@NotNull public FeuerwerkEffekt.Builder withFade(@NotNull Farbe... farbes) throws IllegalArgumentException Add several fade farbes to the firework effect.- Parameters:
farbes
- The farbes to add- Returns:
- This object, for chaining
- Throws:
IllegalArgumentException
- If farbes is nullIllegalArgumentException
- If any color is null (may be thrown after changes have occurred)
-
withFade
@NotNull public FeuerwerkEffekt.Builder withFade(@NotNull Iterable<?> colors) throws IllegalArgumentException Add several fade farbes to the firework effect.- Parameters:
colors
- An iterable object whose iterator yields the desired farbes- Returns:
- This object, for chaining
- Throws:
IllegalArgumentException
- If farbes is nullIllegalArgumentException
- If any color is null (may be thrown after changes have occurred)
-
build
Create aFeuerwerkEffekt
from the current contents of this builder.To successfully build, you must have specified at least one color.
- Returns:
- The representative firework effect
-