Class Metrics.Builder
java.lang.Object
io.github.projectunified.faststats.core.Metrics.Builder
- Enclosing class:
Metrics
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddFeature(Feature feature) Adds a feature to be configured with the submit executor.addFeatures(Collection<Feature> features) Adds a collection of features to be configured with the submit executor.Adds a metric to be collected and submitted.addMetrics(Collection<Metric<?>> metrics) Adds a collection of metrics to be collected and submitted.build()Builds theMetricsinstance.Sets the platform implementation.scheduler(TaskScheduler scheduler) Sets the task scheduler.serializer(Serializer serializer) Sets the JSON serializer.Sets the submitter.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
platform
Sets the platform implementation.- Parameters:
platform- the platform- Returns:
- this builder instance
-
serializer
Sets the JSON serializer.- Parameters:
serializer- the serializer- Returns:
- this builder instance
-
submitter
Sets the submitter.- Parameters:
submitter- the submitter- Returns:
- this builder instance
-
scheduler
Sets the task scheduler.- Parameters:
scheduler- the task scheduler- Returns:
- this builder instance
-
addMetric
Adds a metric to be collected and submitted.- Parameters:
metric- the metric to add- Returns:
- this builder instance
-
addMetrics
Adds a collection of metrics to be collected and submitted.- Parameters:
metrics- the metrics to add- Returns:
- this builder instance
-
addFeature
Adds a feature to be configured with the submit executor.- Parameters:
feature- the feature to add- Returns:
- this builder instance
-
addFeatures
Adds a collection of features to be configured with the submit executor.- Parameters:
features- the features to add- Returns:
- this builder instance
-
build
Builds theMetricsinstance.- Returns:
- a new Metrics instance
- Throws:
IllegalStateException- if any required fields are missing
-