Interface Track


  • public interface Track
    An ordered chain of Groups.
    • Method Detail

      • getName

        @NonNull String getName()
        Gets the name of this track
        Returns:
        the name of this track
      • getGroups

        @NonNull @Unmodifiable List<String> getGroups()
        Gets a list of the groups on this track

        Index 0 is the first/lowest group in (or start of) the track.

        The returned collection is immutable, and cannot be modified.

        Returns:
        an ordered List of the groups on this track
      • getNext

        @Nullable String getNext​(@NonNull Group current)
        Gets the next group on the track, after the one provided

        null is returned if the group is not on the track.

        Parameters:
        current - the group before the group being requested
        Returns:
        the group name, or null if the end of the track has been reached
        Throws:
        NullPointerException - if the group is null
        IllegalStateException - if the group instance was not obtained from LuckPerms.
      • getPrevious

        @Nullable String getPrevious​(@NonNull Group current)
        Gets the previous group on the track, before the one provided

        null is returned if the group is not on the track.

        Parameters:
        current - the group after the group being requested
        Returns:
        the group name, or null if the start of the track has been reached
        Throws:
        NullPointerException - if the group is null
        IllegalStateException - if the group instance was not obtained from LuckPerms.
      • containsGroup

        boolean containsGroup​(@NonNull Group group)
        Checks if a group features on this track
        Parameters:
        group - the group to check
        Returns:
        true if the group is on this track
        Throws:
        NullPointerException - if the group is null
        IllegalStateException - if the group instance was not obtained from LuckPerms.
      • containsGroup

        boolean containsGroup​(@NonNull String group)
        Checks if a group features on this track
        Parameters:
        group - the group to check
        Returns:
        true if the group is on this track
        Throws:
        NullPointerException - if the group is null
      • clearGroups

        void clearGroups()
        Clear all of the groups from this track