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, String, NullBool, String, String) |
Creates a new instance of a ProfileEntry with the given values. |
Nested Class Summary¶
Modifier and Type | Class | Description |
---|---|---|
static class |
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<String> |
motd() |
Gets the currently set MOTD of this ProfileEntry. |
List<String> |
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. |
NullBool |
onlinePlayersEnabled() |
Whether the online players feature should be used or not. |
NullBool |
hidePlayersHoverEnabled() |
Whether the Hover List of online players should be hidden or not. |
nullable String |
extraPlayersCount() |
Gets the currently set number of extra players of this ProfileEntry. |
nullable String |
maxPlayersCount() |
Gets the currently set number of max players of this ProfileEntry. |
nullable String |
onlinePlayersCount() |
Gets the currently set number of online players of this ProfileEntry. |
boolean |
isInvalid() |
Whether this ProfileEntry is considered invalid or not. |
Constructor Details¶
ProfileEntry(List<String>, List<String>, String, String, NullBool, NullBool, NullBool, String, NullBool, String, String)¶
Creates a new instance of a ProfileEntry with the given values. It's recommended to use the [`Builder` class](builder.md) 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. -
String: onlinePlayersCount
- The number to set for the Online Players count. -
NullBool: hidePlayersHoverEnabled
- Whether the online Players Hover should beenabled. -
String: extraPlayersCount
- The number to add to the online Players for the extra Players. -
String: maxPlayersCount
- The number to set for the max Players count.
See also:¶
Method Details¶
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
:NullBool.NOT_SET
onlinePlayersEnabled
:NullBool.NOT_SET
hidePlayersHoverEnabled
:NullBool.NOT_SET
extraPlayersCount
:null
maxPlayersCount
:null
onlinePlayersCount
:null
Returns:¶
New ProfileEntry instance with empty/null values defined
ProfileEntry copy()
¶
Creates a copy of this ProfileEntry instance.
This is a convenience method that avoids using builder()
first followed by ProfileEntry.Builder.build()
:
ProfileEntry entry = ProfileEntry.empty(); // Obtain ProfileEntry
// Both do the same
ProfileEntry newEntry1 = entry.builder().build();
ProfileEntry newEntry2 = entry.copy();
Returns:¶
A copy of this ProfileEntry instance.
See also:¶
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.
NullBool onlinePlayersEnabled()
¶
Whether the online players feature should be used or not.
To get the actual boolean value, append getOrDefault(boolean)
.
Returns:¶
Whether the online players feature should be used or not.
NullBool hidePlayersHoverEnabled()
¶
Whether the Hover List of online players should be hidden or not.
To get the actual boolean value, append getOrDefault(boolean)
.
When true, this option will force the players()
list to be ignored.
Returns:¶
Whether the Hover List of online players should be hidden or not.
String extraPlayersCount()
¶
Gets the currently set number of extra players of this ProfileEntry.
Returns:¶
The current number of extra players used by this ProfileEntry.
String maxPlayersCount()
¶
Gets the currently set number of max players of this ProfileEntry.
Returns:¶
The current number of max players used by this ProfileEntry.
String onlinePlayersCount()
¶
Gets the currently set number of online players of this ProfileEntry.
Returns:¶
The current number of online 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.
As long as one of the above is not true is this ProfileEntry considered valid and false
will be returned.
Returns:¶
Whether this ProfileEntry is invalid or not.