public interface Track
Group
s.Modifier and Type | Method and Description |
---|---|
@NonNull DataMutateResult |
appendGroup(@NonNull Group group)
Appends a group to the end of this track
|
void |
clearGroups()
Clear all of the groups from this track
|
boolean |
containsGroup(@NonNull Group group)
Checks if a group features on this track
|
boolean |
containsGroup(@NonNull String group)
Checks if a group features on this track
|
@NonNull DemotionResult |
demote(@NonNull User user,
@NonNull ContextSet contextSet)
Demotes the given user along this track.
|
@NonNull List<String> |
getGroups()
Gets a list of the groups on this track
|
@NonNull String |
getName()
Gets the name of this track
|
@Nullable String |
getNext(@NonNull Group current)
Gets the next group on the track, after the one provided
|
@Nullable String |
getPrevious(@NonNull Group current)
Gets the previous group on the track, before the one provided
|
int |
getSize()
Gets the number of groups on this track
|
@NonNull DataMutateResult |
insertGroup(@NonNull Group group,
int position)
Inserts a group at a certain position on this track
|
@NonNull PromotionResult |
promote(@NonNull User user,
@NonNull ContextSet contextSet)
Promotes the given user along this track.
|
@NonNull DataMutateResult |
removeGroup(@NonNull Group group)
Removes a group from this track
|
@NonNull DataMutateResult |
removeGroup(@NonNull String group)
Removes a group from this track
|
@NonNull String getName()
@NonNull List<String> getGroups()
Index 0 is the first/lowest group in (or start of) the track.
The returned collection is immutable, and cannot be modified.
List
of the groups on this trackint getSize()
@Nullable String getNext(@NonNull Group current)
null
is returned if the group is not on the track.
current
- the group before the group being requestedNullPointerException
- if the group is nullIllegalStateException
- if the group instance was not obtained from LuckPerms.@Nullable String getPrevious(@NonNull Group current)
null
is returned if the group is not on the track.
current
- the group after the group being requestedNullPointerException
- if the group is nullIllegalStateException
- if the group instance was not obtained from LuckPerms.@NonNull PromotionResult promote(@NonNull User user, @NonNull ContextSet contextSet)
user
- the user to promotecontextSet
- the contexts to promote the user in@NonNull DemotionResult demote(@NonNull User user, @NonNull ContextSet contextSet)
user
- the user to demotecontextSet
- the contexts to demote the user in@NonNull DataMutateResult appendGroup(@NonNull Group group)
group
- the group to appendNullPointerException
- if the group is nullIllegalStateException
- if the group instance was not obtained from LuckPerms.@NonNull DataMutateResult insertGroup(@NonNull Group group, int position) throws IndexOutOfBoundsException
group
- the group to be insertedposition
- the index position (a value of 0 inserts at the start)IndexOutOfBoundsException
- if the position is less than 0 or greater than the size of the trackNullPointerException
- if the group is nullIllegalStateException
- if the group instance was not obtained from LuckPerms.@NonNull DataMutateResult removeGroup(@NonNull Group group)
group
- the group to removeNullPointerException
- if the group is nullIllegalStateException
- if the group instance was not obtained from LuckPerms.@NonNull DataMutateResult removeGroup(@NonNull String group)
group
- the group to removeNullPointerException
- if the group is nullboolean containsGroup(@NonNull Group group)
group
- the group to checkNullPointerException
- if the group is nullIllegalStateException
- if the group instance was not obtained from LuckPerms.boolean containsGroup(@NonNull String group)
group
- the group to checkNullPointerException
- if the group is nullvoid clearGroups()