Package com.treescrub.spedran.data
Class Run
- java.lang.Object
-
- com.treescrub.spedran.data.Resource
-
- com.treescrub.spedran.data.IdentifiableResource
-
- com.treescrub.spedran.data.Run
-
public class Run extends IdentifiableResource
A speedrun on SRC.
This class is immutable and thread-safe.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DeleteRunRequestdelete()Gets a newDeleteRunRequestbuilder to delete this run from SRC.StringgetCategory()Returns a String containing the ID of this run's category.Optional<String>getComment()Gets the description of this run.Optional<LocalDate>getDateRan()Returns theLocalDatethat this run was actually ran.StringgetGame()Returns a String containing the ID of this run's game.Optional<String>getLevel()Returns anOptionalString containing the ID of this run's level.List<RunPlayer>getPlayers()Gets aListof the runners of this run.RunTimesgetRunTimes()Gets the times for this run in each timing category.Optional<Link>getSplits()Gets a link to the API of a splits hosting site.RunStatusgetStatus()Gets the current verification status of this run.Optional<Instant>getSubmitTime()Returns theInstantthat this run was submitted to SRC.RunSystemgetSystem()Gets the system that this run was played on.Map<String,String>getVariableValues()Returns aMapwith each key being a variable ID, and the corresponding value being the variable value ID.Optional<RunVideos>getVideos()Gets aRunVideosdescribing the videos in this run.StringgetWeblink()Returns a String containing the URL of the run on SRC.RunPlayersRequestsetPlayers()Gets a newRunPlayersRequestbuilder to set the players on this run.RunStatusRequestsetStatus()Gets a newRunStatusRequestbuilder to change the status of this run.StringtoString()-
Methods inherited from class com.treescrub.spedran.data.IdentifiableResource
equals, getId, hashCode
-
-
-
-
Method Detail
-
delete
public DeleteRunRequest delete()
Gets a newDeleteRunRequestbuilder to delete this run from SRC.
Requires a set API key with sufficient permissions to delete runs, or API key of run owner.- Returns:
- a
DeleteRunRequestbuilder - See Also:
Spedran.setApiKey(String)
-
setPlayers
public RunPlayersRequest setPlayers()
Gets a newRunPlayersRequestbuilder to set the players on this run.
Requires a set API key with sufficient permissions to change the players on this run.- Returns:
- a
RunPlayersRequestbuilder
-
setStatus
public RunStatusRequest setStatus()
Gets a newRunStatusRequestbuilder to change the status of this run.
Requires an API key with sufficient permissions to reject/verify runs.- Returns:
- a request builder to set the status
-
getWeblink
public String getWeblink()
Returns a String containing the URL of the run on SRC.- Returns:
- a link to the run
-
getGame
public String getGame()
Returns a String containing the ID of this run's game.- Returns:
- the id of the game this run belongs to
- See Also:
Game,Spedran.getGame(String)
-
getLevel
public Optional<String> getLevel()
Returns anOptionalString containing the ID of this run's level. If this run has no associated level, returns an empty Optional.- Returns:
- an
Optionalwith the ID of this run's level - See Also:
Level,Spedran.getLevel(String)
-
getCategory
public String getCategory()
Returns a String containing the ID of this run's category.- Returns:
- the ID of this run's category
- See Also:
Category,Spedran.getCategory(String)
-
getVideos
public Optional<RunVideos> getVideos()
Gets aRunVideosdescribing the videos in this run.- Returns:
- an
Optionalwith information about this run's videos
-
getComment
public Optional<String> getComment()
Gets the description of this run.- Returns:
- an
Optionalwith the run comment
-
getStatus
public RunStatus getStatus()
Gets the current verification status of this run.- Returns:
- a
RunStatuswith verification info
-
getPlayers
public List<RunPlayer> getPlayers()
Gets aListof the runners of this run.- Returns:
- an unmodifiable
Listof the runners
-
getDateRan
public Optional<LocalDate> getDateRan()
Returns theLocalDatethat this run was actually ran.- Returns:
- a
LocalDate
-
getSubmitTime
public Optional<Instant> getSubmitTime()
Returns theInstantthat this run was submitted to SRC.- Returns:
- a
Instant
-
getRunTimes
public RunTimes getRunTimes()
Gets the times for this run in each timing category.- Returns:
- a
RunTimesobject that has timing info
-
getSystem
public RunSystem getSystem()
Gets the system that this run was played on.- Returns:
- a
RunSystemobject that has system info
-
getSplits
public Optional<Link> getSplits()
Gets a link to the API of a splits hosting site. Currently only supportsSplits.io.
-
getVariableValues
public Map<String,String> getVariableValues()
Returns aMapwith each key being a variable ID, and the corresponding value being the variable value ID.- Returns:
- an unmodifiable
Mapbetween variable IDs and variable value IDs
-
-