Class QueryResponse.Builder

  • Enclosing class:
    QueryResponse

    public static final class QueryResponse.Builder
    extends java.lang.Object
    A builder for QueryResponse objects.
    • Method Detail

      • hostname

        public QueryResponse.Builder hostname​(java.lang.String hostname)
        Sets the hostname for the response.
        Parameters:
        hostname - the hostname to set
        Returns:
        this builder, for chaining
      • gameVersion

        public QueryResponse.Builder gameVersion​(java.lang.String gameVersion)
        Sets the game version for the response.
        Parameters:
        gameVersion - the game version to set
        Returns:
        this builder, for chaining
      • map

        public QueryResponse.Builder map​(java.lang.String map)
        Sets the map that will appear in the response.
        Parameters:
        map - the map to set
        Returns:
        this builder, for chaining
      • currentPlayers

        public QueryResponse.Builder currentPlayers​(int currentPlayers)
        Sets the players that are currently claimed to be online.
        Parameters:
        currentPlayers - a non-negative number representing all players online
        Returns:
        this builder, for chaining
      • maxPlayers

        public QueryResponse.Builder maxPlayers​(int maxPlayers)
        Sets the maximum number of players this server purportedly can hold.
        Parameters:
        maxPlayers - a non-negative number representing the maximum number of builders
        Returns:
        this builder, for chaining
      • proxyHost

        public QueryResponse.Builder proxyHost​(java.lang.String proxyHost)
        Sets the host where this proxy is running.
        Parameters:
        proxyHost - the host where the proxy is running
        Returns:
        this instance, for chaining
      • proxyPort

        public QueryResponse.Builder proxyPort​(int proxyPort)
        Sets the port where this proxy is running.
        Parameters:
        proxyPort - the port where the proxy is running
        Returns:
        this instance, for chaining
      • players

        public QueryResponse.Builder players​(java.util.Collection<java.lang.String> players)
        Adds the specified players to the player list.
        Parameters:
        players - the players to add
        Returns:
        this builder, for chaining
      • players

        public QueryResponse.Builder players​(java.lang.String... players)
        Adds the specified players to the player list.
        Parameters:
        players - the players to add
        Returns:
        this builder, for chaining
      • proxyVersion

        public QueryResponse.Builder proxyVersion​(java.lang.String proxyVersion)
        Sets the proxy version.
        Parameters:
        proxyVersion - the proxy version to set
        Returns:
        this builder, for chaining
      • clearPlugins

        public QueryResponse.Builder clearPlugins()
        Clears all currently set plugins.
        Returns:
        this builder, for chaining
      • build

        public QueryResponse build()
        Builds a new QueryResponse with the supplied data. The current instance can be reused after this method is called.
        Returns:
        response