public static final class QueryResponse.Builder extends Object
QueryResponse
objects.Modifier and Type | Method and Description |
---|---|
QueryResponse |
build()
Builds a new
QueryResponse with the supplied data. |
QueryResponse.Builder |
clearPlayers()
Removes all players from the builder.
|
QueryResponse.Builder |
clearPlugins()
Clears all currently set plugins.
|
QueryResponse.Builder |
currentPlayers(int currentPlayers)
Sets the players that are currently claimed to be online.
|
QueryResponse.Builder |
gameVersion(String gameVersion)
Sets the game version for the response.
|
QueryResponse.Builder |
hostname(String hostname)
Sets the hostname for the response.
|
QueryResponse.Builder |
map(String map)
Sets the map that will appear in the response.
|
QueryResponse.Builder |
maxPlayers(int maxPlayers)
Sets the maximum number of players this server purportedly can hold.
|
QueryResponse.Builder |
players(Collection<String> players)
Adds the specified players to the player list.
|
QueryResponse.Builder |
players(String... players)
Adds the specified players to the player list.
|
QueryResponse.Builder |
plugins(Collection<QueryResponse.PluginInformation> plugins)
Adds the specified plugins to the plugins list.
|
QueryResponse.Builder |
plugins(QueryResponse.PluginInformation... plugins)
Adds the specified plugins to the plugins list.
|
QueryResponse.Builder |
proxyHost(String proxyHost)
Sets the host where this proxy is running.
|
QueryResponse.Builder |
proxyPort(int proxyPort)
Sets the port where this proxy is running.
|
QueryResponse.Builder |
proxyVersion(String proxyVersion)
Sets the proxy version.
|
public QueryResponse.Builder hostname(String hostname)
hostname
- the hostname to setpublic QueryResponse.Builder gameVersion(String gameVersion)
gameVersion
- the game version to setpublic QueryResponse.Builder map(String map)
map
- the map to setpublic QueryResponse.Builder currentPlayers(int currentPlayers)
currentPlayers
- a non-negative number representing all players onlinepublic QueryResponse.Builder maxPlayers(int maxPlayers)
maxPlayers
- a non-negative number representing the maximum number of builderspublic QueryResponse.Builder proxyHost(String proxyHost)
proxyHost
- the host where the proxy is runningpublic QueryResponse.Builder proxyPort(int proxyPort)
proxyPort
- the port where the proxy is runningpublic QueryResponse.Builder players(Collection<String> players)
players
- the players to addpublic QueryResponse.Builder players(String... players)
players
- the players to addpublic QueryResponse.Builder clearPlayers()
QueryResponse.getCurrentPlayers()
.public QueryResponse.Builder proxyVersion(String proxyVersion)
proxyVersion
- the proxy version to setpublic QueryResponse.Builder plugins(Collection<QueryResponse.PluginInformation> plugins)
plugins
- the plugins to addpublic QueryResponse.Builder plugins(QueryResponse.PluginInformation... plugins)
plugins
- the plugins to addpublic QueryResponse.Builder clearPlugins()
public QueryResponse build()
QueryResponse
with the supplied data. The current instance can be reused
after this method is called.