Class ProfileEntry.Builder

java.lang.Object
ch.andre601.advancedserverlist.api.profiles.ProfileEntry.Builder
Enclosing class:
ProfileEntry

public static class ProfileEntry.Builder extends Object
Builder class to create a new ProfileEntry instance.
  • Constructor Details

    • Builder

      public Builder()
      Empty Builder Constructor used to create a new instance of this class.
  • Method Details

    • motd

      public ProfileEntry.Builder motd(List<String> motd)

      Sets a new MOTD to use.

      Set to an empty list to not change the MOTD.

      Only the first two entries of the list will be considered and any additional ones discarded.

      An IllegalArgumentException may be thrown by the CheckUtil should the provided motd list be null.

      Parameters:
      motd - The MOTD to use.
      Returns:
      This Builder after the motd has been set. Useful for chaining.
    • players

      public ProfileEntry.Builder players(List<String> players)

      Sets the players (lines) to use for the hover.

      Set to an empty list to not change the hover text.

      An IllegalArgumentException may be thrown by the CheckUtil should the provided players list be null.

      Parameters:
      players - The lines to set for the hover.
      Returns:
      This Builder after the players have been set. Useful for chaining.
    • playerCountText

      public ProfileEntry.Builder playerCountText(String playerCountText)

      Sets the text to override the player count with.

      Set to an empty String or null to not alter the Player count text.

      Parameters:
      playerCountText - The text to show in the player count.
      Returns:
      This Builder after the player count text has been set. Useful for chaining.
    • favicon

      public ProfileEntry.Builder favicon(String favicon)

      Sets the value to use for the favicon.
      The following values are supported:

      • URL to a valid PNG file
      • File name (With .png extension) matching a file saved in the favicons folder of AdvancedServerList
      • ${player uuid} to display the avatar of the player.

      Set to an empty String or null to not alter the Favicon.

      Parameters:
      favicon - The favicon to use.
      Returns:
      This Builder after the favicon has been set. Useful for chaining.
    • hidePlayersEnabled

      public ProfileEntry.Builder hidePlayersEnabled(NullBool hidePlayersEnabled)

      Sets whether the player count should be hidden or not.

      Set to NullBool.NOT_SET to not set this.

      An IllegalArgumentException may be thrown by the CheckUtil should hidePlayersEnabled be null.

      Parameters:
      hidePlayersEnabled - Whether the player count should be hidden or not.
      Returns:
      This Builder after the NullBool has been set. Useful for chaining.
    • extraPlayersEnabled

      public ProfileEntry.Builder extraPlayersEnabled(NullBool extraPlayersEnabled)

      Sets whether the extra players feature should be enabled.

      Set to NullBool.NOT_SET to not set this.

      An IllegalArgumentException may be thrown by the CheckUtil should extraPlayersEnabled be null.

      Parameters:
      extraPlayersEnabled - Whether the extra players feature should be enabled or not.
      Returns:
      This Builder after the NullBool has been set. Useful for chaining.
    • maxPlayersEnabled

      public ProfileEntry.Builder maxPlayersEnabled(NullBool maxPlayersEnabled)

      Sets whether the max players feature should be enabled.

      Set to NullBool.NOT_SET to not set this.

      An IllegalArgumentException may be thrown by the CheckUtil should maxPlayersEnabled be null.

      Parameters:
      maxPlayersEnabled - Whether the extra players feature should be enabled or not.
      Returns:
      This Builder after the NullBool has been set. Useful for chaining.
    • onlinePlayersEnabled

      public ProfileEntry.Builder onlinePlayersEnabled(NullBool onlinePlayersEnabled)

      Sets whether the online players feature should be enabled.

      Set to NullBool.NOT_SET to not set this.

      An IllegalArgumentException may be thrown by the CheckUtil should onlinePlayersEnabled be null.

      Parameters:
      onlinePlayersEnabled - Whether the online players feature should be enabled or not.
      Returns:
      This Builder after the NullBool has been set. Useful for chaining.
    • extraPlayersCount

      public ProfileEntry.Builder extraPlayersCount(String extraPlayersCount)

      Sets the value to resolve into a number by AdvancedServerList.
      Strings not resolving into valid numbers will be treated as this option not being set.

      This option has no effect when ProfileEntry.extraPlayersEnabled() is set to NullBool.FALSE or NullBool.NOT_SET.

      Set this to null to not alter the max player count. Alternatively disable extra Players.

      Parameters:
      extraPlayersCount - The number of extra players to add.
      Returns:
      This Builder after the extra player count has been set. Useful for chaining.
    • maxPlayersCount

      public ProfileEntry.Builder maxPlayersCount(String maxPlayersCount)

      Sets the value to resolve into a number by AdvancedServerList.
      Strings not resolving into valid numbers will be treated as this option not being set.

      This option has no effect when ProfileEntry.maxPlayersEnabled() is set to NullBool.FALSE or NullBool.NOT_SET.

      Set this to null to not alter the max player count. Alternatively disable max Players.

      Parameters:
      maxPlayersCount - The number of max players to set.
      Returns:
      This Builder after the max player count has been set. Useful for chaining.
    • onlinePlayersCount

      public ProfileEntry.Builder onlinePlayersCount(String onlinePlayersCount)

      Sets the value to resolve into a number by AdvancedServerList.
      Strings not resolving into valid numbers will be treated as this option not being set.

      This option has no effect when ProfileEntry.onlinePlayersEnabled() is set to NullBool.FALSE or NullBool.NOT_SET.

      Set this to null to not alter the online player count. Alternatively disable online Players.

      Parameters:
      onlinePlayersCount - The number of online players to set.
      Returns:
      This Builder after the max player count has been set. Useful for chaining.
    • build

      public ProfileEntry build()
      Creates a new ProfileEntry instance with the values set in this Builder.
      Returns:
      New ProfileEntry instance.