Class TrackerAnimation.Builder<T extends Tracker>
java.lang.Object
kr.toxicity.model.api.tracker.TrackerAnimation.Builder<T>
- Type Parameters:
T- the type of tracker
- Enclosing class:
TrackerAnimation<T extends Tracker>
A builder class for creating instances of
TrackerAnimation.- Since:
- 2.2.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull TrackerAnimation<T> build()Builds theTrackerAnimationinstance.@NotNull TrackerAnimation.Builder<T> Sets the condition that must be met for the animation to play.@NotNull TrackerAnimation.Builder<T> modifier(@NotNull Function<? super T, AnimationModifier> modifierBuilder) Sets the modifier builder for the animation.@NotNull TrackerAnimation.Builder<T> onFallback(@NotNull Consumer<? super T> fallbackTask) Sets the task to run when the animation fails to start.@NotNull TrackerAnimation.Builder<T> Sets the task to run when the animation is removed.@NotNull TrackerAnimation.Builder<T> Sets the task to run when the animation starts successfully.@NotNull TrackerAnimation.Builder<T> priority(int priority) Sets the priority of the animation.<R extends T>
TrackerAnimation.Builder<R> Changes the target tracker type for this builder.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
type
Changes the target tracker type for this builder.- Type Parameters:
R- the new tracker type- Parameters:
newTargetClass- the new target class- Returns:
- a new builder for the specified type
- Since:
- 2.2.0
-
priority
Sets the priority of the animation.- Parameters:
priority- the priority- Returns:
- this builder
- Since:
- 2.2.0
-
check
@NotNull public @NotNull TrackerAnimation.Builder<T> check(@NotNull @NotNull Predicate<? super T> applyCondition) Sets the condition that must be met for the animation to play.- Parameters:
applyCondition- the condition predicate- Returns:
- this builder
- Since:
- 2.2.0
-
modifier
@NotNull public @NotNull TrackerAnimation.Builder<T> modifier(@NotNull @NotNull Function<? super T, AnimationModifier> modifierBuilder) Sets the modifier builder for the animation.- Parameters:
modifierBuilder- a function that provides anAnimationModifier- Returns:
- this builder
- Since:
- 2.2.0
-
onRemove
@NotNull public @NotNull TrackerAnimation.Builder<T> onRemove(@NotNull @NotNull Consumer<? super T> removeTask) Sets the task to run when the animation is removed.- Parameters:
removeTask- the removal task- Returns:
- this builder
- Since:
- 2.2.0
-
onSuccess
@NotNull public @NotNull TrackerAnimation.Builder<T> onSuccess(@NotNull @NotNull Consumer<? super T> successTask) Sets the task to run when the animation starts successfully.- Parameters:
successTask- the success task- Returns:
- this builder
- Since:
- 2.2.0
-
onFallback
@NotNull public @NotNull TrackerAnimation.Builder<T> onFallback(@NotNull @NotNull Consumer<? super T> fallbackTask) Sets the task to run when the animation fails to start.- Parameters:
fallbackTask- the fallback task- Returns:
- this builder
- Since:
- 2.2.0
-
build
Builds theTrackerAnimationinstance.- Returns:
- the constructed animation
- Since:
- 2.2.0
-