Package com.treescrub.spedran.data
Class Leaderboard
- java.lang.Object
-
- com.treescrub.spedran.data.Resource
-
- com.treescrub.spedran.data.Leaderboard
-
public class Leaderboard extends Resource
A collection of runs sorted by ranking as they would appear on SRC. Does not contain obsoleted runs.
This class is immutable and thread-safe.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetCategory()Gets the category ID for this leaderboard.Optional<Boolean>getEmulators()Gets whether runs using an emulator were filtered out.StringgetGame()Gets the game ID for this leaderboard.Optional<String>getLevel()Gets the level ID as anOptional.Optional<String>getPlatform()Gets the platform ID as anOptional.Optional<String>getRegion()Gets the region ID as anOptional.List<LeaderboardRun>getRuns()Gets all runs on the leaderboard.Optional<TimingType>getTiming()Gets theTimingTypethat was used to sort the runs fromgetRuns().Map<String,String>getValues()Gets a mapping of variable IDs to variable value IDs.StringgetWeblink()Gets the link to this leaderboard on SRC.booleanisVideoOnly()If runs with no video were filtered out, returnstrue, otherwisefalse.StringtoString()
-
-
-
Method Detail
-
getWeblink
public String getWeblink()
Gets the link to this leaderboard on SRC.
SRC API currently returns a link that does not work!- Returns:
- a link to the leaderboard on SRC
-
getGame
public String getGame()
Gets the game ID for this leaderboard.- Returns:
- the game ID
- See Also:
Spedran.getGame(String),Game
-
getCategory
public String getCategory()
Gets the category ID for this leaderboard.- Returns:
- the category ID
- See Also:
Spedran.getCategory(String),Category
-
getLevel
public Optional<String> getLevel()
Gets the level ID as anOptional.- Returns:
- an
Optionalcontaining the level ID, empty if no level was provided - See Also:
Spedran.getLevel(String),Level
-
getPlatform
public Optional<String> getPlatform()
Gets the platform ID as anOptional.- Returns:
- an
Optionalcontaining the platform ID, empty if no platform was provided - See Also:
Spedran.getPlatform(String),Platform
-
getRegion
public Optional<String> getRegion()
Gets the region ID as anOptional.- Returns:
- an
Optionalwith the region ID, empty if no region was provided - See Also:
Spedran.getRegion(String),Region
-
getEmulators
public Optional<Boolean> getEmulators()
Gets whether runs using an emulator were filtered out.- Returns:
falseif runs using an emulator were filtered out, otherwisetrue
-
isVideoOnly
public boolean isVideoOnly()
If runs with no video were filtered out, returnstrue, otherwisefalse.- Returns:
trueif the 'videos only' filter was set, otherwisefalse
-
getTiming
public Optional<TimingType> getTiming()
Gets theTimingTypethat was used to sort the runs fromgetRuns().- Returns:
- the
TimingTypethat the runs were sorted by, empty if not specified - See Also:
TimingType
-
getValues
public Map<String,String> getValues()
Gets a mapping of variable IDs to variable value IDs.- Returns:
- an unmodifiable
Mapwith keys being variable IDs and values being variable values - See Also:
Variable
-
getRuns
public List<LeaderboardRun> getRuns()
Gets all runs on the leaderboard. Runs are sorted by place on the leaderboard.- Returns:
- an unmodifiable
Listwith all runs on this leaderboard - See Also:
LeaderboardRun
-
-