public interface Game
Game
. This should contain all information provided from Discord about a Game.Modifier and Type | Interface and Description |
---|---|
static class |
Game.GameType |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getName()
The displayed name of the
Game . |
Game.GameType |
getType()
The type of
Game . |
java.lang.String |
getUrl()
The URL of the
Game . |
static boolean |
isValidStreamingUrl(java.lang.String url)
Checks if a given String is a valid Twitch url (ie, one that will display "Streaming" on the Discord client).
|
static Game |
of(java.lang.String name)
Creates a new Game instance with the specified name.
|
static Game |
of(java.lang.String name,
java.lang.String url)
Creates a new Game instance with the specified name and url.
|
java.lang.String getName()
Game
. If no name has been set, this returns null.java.lang.String getUrl()
Game
. This will return null for regular games.Game.GameType getType()
Game
. This will return null for regular games.static Game of(java.lang.String name)
name
- The not-null name of the newly created gameGame.GameType.DEFAULT
java.lang.IllegalArgumentException
- if the specified name is null or emptystatic Game of(java.lang.String name, java.lang.String url)
name
- The not-null name of the newly created gameurl
- The streaming url to use, invalid for GameType#DEFAULT
java.lang.IllegalArgumentException
- if the specified name is null or emptyisValidStreamingUrl(String)
static boolean isValidStreamingUrl(java.lang.String url)
url
- The url to check.