ProfileEntry¶
This record represents the content found in a server list profile YAML file.
The content may come from either the "profiles" list, the options in the file itself (global options) or a mix of both.
This class is immutable. Use builder()
to get a Builder
instance with the values of this class added.
Constructor Summary
Constructor | Description |
---|---|
ProfileEntry(List<String>, List<String>, String, String, NullBool, NullBool, NullBool, Integer, Integer)
|
Creates a new instance of a ProfileEntry with the given values. |
Class Summary
Class | Description |
---|---|
Builder()
|
Builder class to create a new ProfileEntry instance. |
Method Summary
Modifier and Type | Method | Description |
---|---|---|
static ProfileEntry |
empty()
|
Creates an "empty" PlayerEntry with the following values set: |
ProfileEntry |
copy()
|
Creates a copy of this ProfileEntry instance. |
Builder |
builder()
|
Creates a Builder instance with the values from this ProfileEntry set. |
List |
motd()
|
Gets the currently set MOTD of this ProfileEntry. |
List |
players()
|
Gets the currently set players of this ProfileEntry. |
String |
playerCountText()
|
Gets the currently set player count text of this ProfileEntry. |
String |
favicon()
|
Gets the currently set favicon of this ProfileEntry. |
NullBool |
hidePlayersEnabled()
|
Whether the player count should be hidden or not in this ProfileEntry. |
NullBool |
extraPlayersEnabled()
|
Whether the extra players feature should be used or not in this ProfileEntry. |
NullBool |
maxPlayersEnabled()
|
Whether the max players feature should be used or not. |
nullable Integer |
extraPlayersCount()
|
Gets the currently set number of extra players to use by this ProfileEntry. May be null . |
nullable Integer |
maxPlayersCount()
|
Gets the currently set number of max players of this ProfileEntry. |
boolean |
isInvalid()
|
Whether this ProfileEntry is considered invalid or not. |
Constructor Detail
ProfileEntry(List<String>, List<String>, String, String, NullBool, NullBool, NullBool, Integer, Integer)
¶
Creates a new instance of a ProfileEntry with the given values.
It's recommended to use the Builder
class for a more convenient configuration of the Settings.
Parameters:¶
-
List<String>: motd
- The MOTD to use. -
List<String>: players
- The players (Lines) to show in the hover. -
String: playerCountText
- The text to display instead of the player count. -
String: favicon
- The favicon to use. -
NullBool: hidePlayersEnabled
- Whether player count should be hidden. -
NullBool: extraPlayersEnabled
- Whether the extra players option should be enabled. -
NullBool: maxPlayersEnabled
- Whether the max players option should be enabled. -
Integer: extraPlayersCount
- The number to add to the online players for the max players number. -
Integer: maxPlayersCount
- The number to use for the max players count.
Method Detail
ProfileEntry
empty()
¶
Creates an "empty" PlayerEntry with the following values set:
motd
: Empty Listplayers
: Empty ListplayerCountText
: Empty Stringfavicon
: Empty StringhidePlayersEnabled
:NullBool.NOT_SET
extraPlayersEnabled
:NullBool.NOT_SET
maxPlayersEnabled
:NullBoo.NOT_SET
extraPlayersCount
:null
maxPlayersCount
:null
Returns:¶
New ProfileEntry instance with empty/null values defined
ProfileEntry
copy()
¶
Creates a copy of this ProfileEntry instance.
This is simply a convenience method to not have to call builder()
.
build()
.
If you want to modify the ProfileEntry builder()
is preferred.
Returns:¶
A copy of this ProfileEntry instance.
Builder
builder()
¶
Creates a Builder
instance with the values from this ProfileEntry set.
Use this method if you would like to modify the ProfileEntry.
Returns:¶
A new Builder
instance with the values of this ProfileEntry set.
List<String>
motd()
¶
Gets the currently set MOTD of this ProfileEntry.
Returns:¶
The current MOTD used by this ProfileEntry.
List<String>
players()
¶
Gets the currently set players of this ProfileEntry.
Returns:¶
The current list of players used by this ProfileEntry.
String
playerCountText()
¶
Gets the currently set player count text of this ProfileEntry.
Returns:¶
The current player count text used by this ProfileEntry.
String
favicon()
¶
Gets the currently set favicon of this ProfileEntry.
Note that the favicon usually is and supports one of the following options:
- 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
Returns:¶
The current favicon used by this ProfileEntry.
NullBool
hidePlayersEnabled()
¶
Whether the player count should be hidden or not in this ProfileEntry.
To get the actual boolean value, append getOrDefault(boolean)
.
Returns:¶
Whether the player count should be hidden or not in this ProfileEntry.
NullBool
extraPlayersEnabled()
¶
Whether the extra players feature should be used or not in this ProfileEntry.
To get the actual boolean value, append getOrDefault(boolean)
.
Returns:¶
Whether the extra players feature should be used or not in this ProfileEntry.
NullBool
maxPlayersEnabled()
¶
Whether the max players feature should be used or not.
To get the actual boolean value, append getOrDefault(boolean)
.
Returns:¶
Whether the max players feature should be used or not.
Integer
extraPlayersCount()
¶
Gets the currently set number of extra players to use by this ProfileEntry. May be null
.
Returns:¶
Possibly-null integer number of extra players used by this ProfileEntry.
Integer
maxPlayersCount()
¶
Gets the currently set number of max players of this ProfileEntry.
Returns:¶
The current number of max players used by this ProfileEntry.
boolean
isInvalid()
¶
Whether this ProfileEntry is considered invalid or not.
The ProfileEntry is considered invalid if all the following is true:
motd()
is empty.players()
is empty.playerCountText()
is null/empty andhidePlayersEnabled()
isfalse
.favicon()
is null/empty.
false
will be returned.
Returns:¶
Whether this ProfileEntry is invalid or not.