public class Game
extends java.lang.Object
Game.
| Modifier and Type | Class and Description |
|---|---|
static class |
Game.GameType
The type game being played, differentiating between a game and stream types.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
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 if the game is actually a Stream. |
int |
hashCode() |
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 |
toString() |
public java.lang.String getName()
Game. If no name has been set, this returns null.public java.lang.String getUrl()
Game if the game is actually a Stream.
public Game.GameType getType()
Game.GameType representing the type of Gamepublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic static Game of(java.lang.String name)
Game.of(String, String).name - The not-null name of the newly created gameGame.GameType.DEFAULTjava.lang.IllegalArgumentException - if the specified name is null or emptypublic static Game of(java.lang.String name, java.lang.String url)
https://twitch.tv/ and can be verified using isValidStreamingUrl(String). (see documentation)name - The not-null name of the newly created gameurl - The streaming url to use, required to display as "streaming"java.lang.IllegalArgumentException - if the specified name is null or emptyisValidStreamingUrl(String)public static boolean isValidStreamingUrl(java.lang.String url)
url - The url to check.