Package org.mcpjava.server.progress
Interface ProgressTracker.Builder
- Enclosing interface:
ProgressTracker
public static interface ProgressTracker.Builder
Builder for creating progress trackers.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the progress tracker.setDefaultStep(double step) Sets the default step value.setDefaultStep(long step) Sets the default step value.setMessageBuilder(Function<BigDecimal, String> messageBuilder) Sets a message builder function.setTotal(double total) Sets the expected total value.setTotal(long total) Sets the expected total value.
-
Method Details
-
setTotal
Sets the expected total value.- Parameters:
total- the total value- Returns:
- this builder
-
setTotal
Sets the expected total value.- Parameters:
total- the total value- Returns:
- this builder
-
setDefaultStep
Sets the default step value.The default step is used when calling
ProgressTracker.advanceAndForget()without arguments.- Parameters:
step- the default step value- Returns:
- this builder
- See Also:
-
setDefaultStep
Sets the default step value.The default step is used when calling
ProgressTracker.advanceAndForget()without arguments.- Parameters:
step- the default step value- Returns:
- this builder
- See Also:
-
setMessageBuilder
Sets a message builder function.The message builder accepts the current progress value and produces a notification message. This is called each time progress is advanced.
- Parameters:
messageBuilder- the message builder function- Returns:
- this builder
-
build
ProgressTracker build()Builds the progress tracker.- Returns:
- a new progress tracker
-