Class Feature
java.lang.Object
io.github.projectunified.faststats.core.Feature
- Direct Known Subclasses:
ErrorTracker, PaperErrorTracker
An abstract representation of a feature that can submit telemetry payloads on demand.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the default properties to assign to the configuration.getFeature(Class<T> featureClass) Finds a registered feature of the specified class.final StringgetProperty(String key, String defaultValue) Gets a configuration property.protected final TaskSchedulerGets the TaskScheduler instance.voidCalled when the Metrics coordinator is shutdown.voidonStart()Called when the Metrics coordinator is started.protected final voidSubmits the given data map payload.
-
Constructor Details
-
Feature
public Feature()
-
-
Method Details
-
onStart
public void onStart()Called when the Metrics coordinator is started. Subclasses can override this to initialize scheduling or start listeners. -
onShutdown
public void onShutdown()Called when the Metrics coordinator is shutdown. Subclasses can override this to release resources or stop listeners. -
getDefaultProperties
-
submit
-
getProperty
-
getFeature
Finds a registered feature of the specified class.- Type Parameters:
T- the feature type- Parameters:
featureClass- the feature class- Returns:
- an Optional containing the feature if found, or empty if not found or metrics is not set
-
getScheduler
Gets the TaskScheduler instance.- Returns:
- the TaskScheduler instance
-