Class ArenaPicker
java.lang.Object
de.marcely.bedwars.api.arena.picker.ArenaPicker
Represents the final ArenaPicker product that persists of a selector and a bunch of conditions (aka as a condition group).
Use ArenaPickerAPI.parsePicker(String)
to parse it given by a String.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionThe condition filters arena.Returns the selector.@Nullable Arena
Filters out all local arenas that do not match the conditions and gets the arena that matches the arena.@Nullable Arena
processLocal
(Collection<Arena> arenas) Filters out all local arenas that do not match the conditions and gets the arena that matches the arena.@Nullable RemoteArena
Filters out all local arenas that do not match the conditions and gets the arena that matches the arena.@Nullable RemoteArena
processRemote
(Collection<? extends RemoteArena> arenas) Filters out all remote arenas that do not match the conditions and gets the arena that matches the arena.Serializes a string representation that may as well be used to deserialize/parse it.toString()
-
Constructor Details
-
ArenaPicker
-
-
Method Details
-
getSelector
Returns the selector.The selector decides which one arena shall be chosen from all the arenas that got filtered using
getCondition()
.- Returns:
- The selector of this picker
-
getCondition
The condition filters arena.- Returns:
- The condition of this picker
-
processLocal
Filters out all local arenas that do not match the conditions and gets the arena that matches the arena.The given collection is not being modified in any way.
- Parameters:
arenas
- The local arenas that shall be processed- Returns:
- The matching arena.
null
in case all were filtered out or none matches the selector
-
processRemote
Filters out all remote arenas that do not match the conditions and gets the arena that matches the arena.The given collection is not being modified in any way.
- Parameters:
arenas
- The remote arenas that shall be processed- Returns:
- The matching arena.
null
in case all were filtered out or none matches the selector
-
processLocal
Filters out all local arenas that do not match the conditions and gets the arena that matches the arena.Uses
GameAPI.getArenas()
as the reference.- Returns:
- The matching arena.
null
in case all were filtered out or none matches the selector
-
processRemote
Filters out all local arenas that do not match the conditions and gets the arena that matches the arena.Uses
RemoteAPI.getArenas()
as the reference.- Returns:
- The matching arena.
null
in case all were filtered out or none matches the selector
-
serialize
Serializes a string representation that may as well be used to deserialize/parse it.- Returns:
- A string representation of this picker
- See Also:
-
toString
-