Package dev.kitteh.factions.permissible
Interface PermSelector
- All Known Implementing Classes:
AbstractRelationSelector,AbstractRoleSelector,AbstractSelector,AllSelector,FactionSelector,PlayerSelector,RelationAtLeastSelector,RelationAtMostSelector,RelationSingleSelector,RoleAtLeastSelector,RoleAtMostSelector,RoleSingleSelector,UnknownSelector
@AvailableSince("4.0.0")
@NullMarked
public interface PermSelector
A PermSelector tests if a given input Selectable matches or not. For
example, a FPlayer might match the PlayerSelector and a Role will never
match that selector but might match a RoleAtLeastSelector if it's at least
that selector's value.
Implementations must be immutable and should extend AbstractSelector (or at least copy its methods to be consistent).
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceDescribes a type of PermSelector, and can create them. -
Method Summary
Modifier and TypeMethodDescriptionGets the descriptor for this selector type.default net.kyori.adventure.text.ComponentGets the name of this selector for display in chat.default net.kyori.adventure.text.ComponentdisplayValue(Faction context) Gets the value of this selector for display in chat.default StringSerializes this selector for storage.Serializes the value of this selector for storage.booleantest(Selectable selectable, Faction faction) Tests if the given selectable matches this selector.
-
Method Details
-
descriptor
PermSelector.Descriptor descriptor()Gets the descriptor for this selector type.- Returns:
- descriptor
-
test
Tests if the given selectable matches this selector.- Parameters:
selectable- selectablefaction- faction context- Returns:
- true if matches
-
serialize
Serializes this selector for storage. Unlikely to need to override.- Returns:
- serialized selector
-
displayName
default net.kyori.adventure.text.Component displayName()Gets the name of this selector for display in chat.- Returns:
- display name
-
serializeValue
String serializeValue()Serializes the value of this selector for storage.- Returns:
- serialized value
-
displayValue
Gets the value of this selector for display in chat. Default is plain text without any decoration.- Parameters:
context- faction context- Returns:
- display value
-