Record Class EliminationResult
java.lang.Object
java.lang.Record
dev.itsharshxd.zentrix.api.elimination.EliminationResult
- Record Components:
eliminatedPlayers- the players removed from the match, in the order they were removedeliminatedTeams- the teams that lost their last member as a resultskipped- the players that were asked for but were not eliminablereason- why nothing happened, when nothing did
public record EliminationResult(@NotNull List<UUID> eliminatedPlayers, @NotNull List<String> eliminatedTeams, @NotNull List<UUID> skipped, @Nullable String reason)
extends Record
What an elimination request actually did.
An elimination is best-effort per player: a player who already left, was already a spectator or was never in the match is skipped rather than failing the whole batch, so the counts below are the authoritative record of what happened.
- Since:
- 1.6.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theeliminatedPlayersrecord component.Returns the value of theeliminatedTeamsrecord component.final booleanIndicates whether some other object is "equal to" this one.static @NotNull EliminationResultNothing was eliminated, and this is why.final inthashCode()Returns a hash code value for this object.booleanWhether at least one player was eliminated.static @NotNull EliminationResultof(@NotNull Collection<UUID> players, @NotNull Collection<String> teams, @NotNull Collection<UUID> skipped) int@Nullable Stringreason()Returns the value of thereasonrecord component.skipped()Returns the value of theskippedrecord component.intfinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EliminationResult
public EliminationResult(@NotNull @NotNull List<UUID> eliminatedPlayers, @NotNull @NotNull List<String> eliminatedTeams, @NotNull @NotNull List<UUID> skipped, @Nullable @Nullable String reason) Creates an instance of aEliminationResultrecord class.- Parameters:
eliminatedPlayers- the value for theeliminatedPlayersrecord componenteliminatedTeams- the value for theeliminatedTeamsrecord componentskipped- the value for theskippedrecord componentreason- the value for thereasonrecord component
-
-
Method Details
-
failed
Nothing was eliminated, and this is why. -
of
@NotNull public static @NotNull EliminationResult of(@NotNull @NotNull Collection<UUID> players, @NotNull @NotNull Collection<String> teams, @NotNull @NotNull Collection<UUID> skipped) -
isSuccess
public boolean isSuccess()Whether at least one player was eliminated. -
playerCount
public int playerCount() -
teamCount
public int teamCount() -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
eliminatedPlayers
Returns the value of theeliminatedPlayersrecord component.- Returns:
- the value of the
eliminatedPlayersrecord component
-
eliminatedTeams
Returns the value of theeliminatedTeamsrecord component.- Returns:
- the value of the
eliminatedTeamsrecord component
-
skipped
Returns the value of theskippedrecord component.- Returns:
- the value of the
skippedrecord component
-
reason
Returns the value of thereasonrecord component.- Returns:
- the value of the
reasonrecord component
-