Record Class ProfileEntry
- Record Components:
motd
- The MOTD to use.players
- The Players (lines) to show on the Player count hover.playerCountText
- The text to display instead of the default player count.favicon
- The favicon to use.hidePlayersEnabled
- Whether player count should be hidden.extraPlayersEnabled
- Whether the extra Players Option should be enabled.maxPlayersEnabled
- Whether the max Players Option should be enabled.onlinePlayersEnabled
- Whether the online Players Option should be enabled.extraPlayersCount
- The number to add to the online Players for the extra Players.maxPlayersCount
- The number to set for the max Players count.onlinePlayersCount
- The number to set for the Online Players count.
This record represents the content found in a Server List Profile YAML file.
The content may come from either the profiles
list option, the options in the YAML file itself, or a combination
of both.
This class is ummutable. Use builder()
to get a Builder Instance of this record.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder class to create a new ProfileEntry instance. -
Constructor Summary
ConstructorDescriptionProfileEntry
(List<String> motd, List<String> players, String playerCountText, String favicon, NullBool hidePlayersEnabled, NullBool extraPlayersEnabled, NullBool maxPlayersEnabled, NullBool onlinePlayersEnabled, String extraPlayersCount, String maxPlayersCount, String onlinePlayersCount) Creates a new Instance of a ProfileEntry with the provided values. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a Builder instance with the values from this ProfileEntry set.copy()
Creates a copy of this ProfileEntry Instance.static ProfileEntry
empty()
Creates an "empty" PlayerEntry with the following values:final boolean
Indicates whether some other object is "equal to" this one.Gets the currently set number of extra players of this ProfileEntry.Whether the extra players feature should be used or not.favicon()
Gets the currently set favicon of this ProfileEntry.final int
hashCode()
Returns a hash code value for this object.Whether the player count should be hidden or not.boolean
Whether this ProfileEntry is invalid or not.Gets the currently set number of max players of this ProfileEntry.Whether the max players feature should be used or not.motd()
Gets the currently set MOTD of this ProfileEntry.Gets the currently set number of online players of this ProfileEntry.Whether the online players feature should be used or not.Gets the currently set player count text of this ProfileEntry.players()
Gets the currently set list of players of this ProfileEntry.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
ProfileEntry
public ProfileEntry(List<String> motd, List<String> players, String playerCountText, String favicon, NullBool hidePlayersEnabled, NullBool extraPlayersEnabled, NullBool maxPlayersEnabled, NullBool onlinePlayersEnabled, String extraPlayersCount, String maxPlayersCount, String onlinePlayersCount) Creates a new Instance of a ProfileEntry with the provided values.
It's generally recommended to use the Builder Class instead for a more user-friendly way of setting values.- Parameters:
motd
- The MOTD to use.players
- The Players (lines) to show on the Player count hover.playerCountText
- The text to display instead of the default player count.favicon
- The favicon to use.hidePlayersEnabled
- Whether player count should be hidden.extraPlayersEnabled
- Whether the extra Players Option should be enabled.maxPlayersEnabled
- Whether the max Players Option should be enabled.onlinePlayersEnabled
- Whether the online Players Option should be enabled.extraPlayersCount
- The number to add to the online Players for the extra Players.maxPlayersCount
- The number to set for the max Players count.onlinePlayersCount
- The number to set for the Online Players count.- See Also:
-
-
Method Details
-
empty
Creates an "empty" PlayerEntry with the following values:
motd()
: Empty Listplayers()
: Empty ListplayerCountText()
: Empty Stringfavicon()
: Empty StringhidePlayersEnabled()
:NullBool.NOT_SET
extraPlayersEnabled()
:NullBool.NOT_SET
maxPlayersEnabled()
:NullBool.NOT_SET
onlinePlayersEnabled()
:NullBool.NOT_SET
extraPlayersCount()
:null
maxPlayersCount()
:null
onlinePlayersCount()
:null
This is equal to just doing
new ProfileEntry.Builder().build()
.- Returns:
- New ProfileEntry Instance with empty/null values set.
-
copy
Creates a copy of this ProfileEntry Instance.
This is a convenience method that avoids using
builder()
first followed byProfileEntry.Builder.build()
:ProfileEntry entry = ProfileEntry.empty(); // Obtain ProfileEntry // Both methods do the same. ProfileEntry newEntry1 = entry.builder().build(); ProfileEntry newEntry2 = entry.copy();
If you want to modify the ProfileEntry should
builder()
be preferred.- Returns:
- A copy of this ProfilyEntry Instance.
- See Also:
-
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.
-
motd
-
players
-
playerCountText
Gets the currently set player count text of this ProfileEntry.- Returns:
- The current player count text used by this ProfileEntry.
-
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.
-
hidePlayersEnabled
Whether the player count should be hidden or not.
To get the actual boolean value, use getOrDefault(boolean) of the returnedNullBool
.- Returns:
- Whether the player count should be hidden or not.
-
extraPlayersEnabled
Whether the extra players feature should be used or not.
To get the actual boolean value, use getOrDefault(boolean) of the returnedNullBool
.- Returns:
- Whether the extra players feature should be used or not.
-
maxPlayersEnabled
Whether the max players feature should be used or not.
To get the actual boolean value, use getOrDefault(boolean) of the returnedNullBool
.- Returns:
- Whether the max players feature should be used or not.
-
onlinePlayersEnabled
Whether the online players feature should be used or not.
To get the actual boolean value, use getOrDefault(boolean) of the returnedNullBool
.- Returns:
- Whether the online players feature should be used or not.
-
extraPlayersCount
Gets the currently set number of extra players of this ProfileEntry.- Returns:
- The current number of extra players used by this ProfileEntry.
-
maxPlayersCount
Gets the currently set number of max players of this ProfileEntry.- Returns:
- The current number of max players used by this ProfileEntry.
-
onlinePlayersCount
Gets the currently set number of online players of this ProfileEntry.- Returns:
- The current number of online players used by this ProfileEntry.
-
isInvalid
public boolean isInvalid()Whether this ProfileEntry is invalid or not.
The ProfileEntry is considered invalid if all the following is true:
motd()
is emptyplayers()
is emptyplayerCountText()
is null/empty andhidePlayersEnabled()
isfalse
favicon()
isnull
/empty
As long as one of the above is not true is this ProfileEntry considered valid.
- Returns:
- Whether this ProfileEntry is invalid.
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
.
-