Enum Class ServerSelectorType
java.lang.Object
java.lang.Enum<ServerSelectorType>
eu.cloudnetservice.modules.bridge.player.executor.ServerSelectorType
- All Implemented Interfaces:
Serializable,Comparable<ServerSelectorType>,Constable
The server selector type provides several constants to compare services based conditions.
- Since:
- 4.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe service with the highest player count is preferred.The service with the lowest player count is preferred.A random service is chosen. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Comparator<eu.cloudnetservice.driver.service.ServiceInfoSnapshot> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateServerSelectorType(@NonNull Comparator<eu.cloudnetservice.driver.service.ServiceInfoSnapshot> comparator) Creates a new server selector type enum constant with the given service comparator. -
Method Summary
Modifier and TypeMethodDescription@NonNull Comparator<eu.cloudnetservice.driver.service.ServiceInfoSnapshot> Gets the comparator used to sort the services infos according to the server selector type.static ServerSelectorTypeReturns the enum constant of this class with the specified name.static ServerSelectorType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
LOWEST_PLAYERS
The service with the lowest player count is preferred. -
HIGHEST_PLAYERS
The service with the highest player count is preferred. -
RANDOM
A random service is chosen.
-
-
Field Details
-
comparator
-
-
Constructor Details
-
ServerSelectorType
private ServerSelectorType(@NonNull @NonNull Comparator<eu.cloudnetservice.driver.service.ServiceInfoSnapshot> comparator) Creates a new server selector type enum constant with the given service comparator.- Parameters:
comparator- the comparator to apply to the services.- Throws:
NullPointerException- if the comparator is null.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
comparator
@NonNull public @NonNull Comparator<eu.cloudnetservice.driver.service.ServiceInfoSnapshot> comparator()Gets the comparator used to sort the services infos according to the server selector type.- Returns:
- the comparator for the server selector.
-