Class PlayerGraphDataSource
java.lang.Object
com.djrapitops.plan.extension.graph.PlayerGraphDataSource
Return value for Player graph from
GraphProvider annotated method.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionImplement this method to return newest datapoint.getPointHistory(long currentTimestamp, UUID playerUUID, String playerName) Override this method to return point history for your data.abstract List<SeriesMetadata> Implement this method to returnSeriesMetadatafor each Y axis value.
-
Constructor Details
-
PlayerGraphDataSource
public PlayerGraphDataSource()
-
-
Method Details
-
getPoint
public abstract Optional<DataPoint> getPoint(long currentTimestamp, UUID playerUUID, String playerName) Implement this method to return newest datapoint.DataPointshould return value for X axis and all values for Y axis. VALUES OF SAME SERIES OF DATA NEED TO BE AT SAME INDEX ALL THE TIME.- Parameters:
currentTimestamp- Epoch millisecond of method call time.playerUUID- UUID of the player.playerName- Name of the player.- Returns:
- Optional.empty() if there's no new point to add.
-
getPointHistory
Override this method to return point history for your data.VALUES OF SAME SERIES OF DATA NEED TO BE AT SAME INDEX ALL THE TIME.
- Parameters:
currentTimestamp- Epoch millisecond of method call time.playerUUID- UUID of the player.playerName- Name of the player.- Returns:
- List of points to add to Plan, each
DataPointincluding value for X axis and all values for Y axis.
-
getSeriesMetadata
Implement this method to returnSeriesMetadatafor each Y axis value.VALUES OF SAME SERIES OF DATA NEED TO BE AT SAME INDEX ALL THE TIME.
This method will be called when Extension is registered, and any time DataPoint has more values than previously.
Index in List defines which series metadata is for - if series stops getting data return null in that index.
- Returns:
List.of({metadata for Y series of DataPoint#values[0]}, {metadata for Y series of DataPoint#values[1]}, ...etc)- Throws:
NotReadyException- If you can't call this yet - empty metadata will be given.RuntimeException- Data source registration will fail.
-