Class Track

java.lang.Object
me.lucko.luckperms.common.model.Track

public final class Track extends Object
  • Constructor Details

  • Method Details

    • getName

      public String getName()
    • getApiProxy

      public ApiTrack getApiProxy()
    • getGroups

      public List<String> getGroups()
      Gets an ordered list of the groups on this track
      Returns:
      am ordered List of the groups on this track
    • setGroups

      public void setGroups(List<String> groups)
    • getSize

      public int getSize()
      Gets the number of groups on this track
      Returns:
      the number of groups on this track
    • getNext

      public String getNext(Group current) throws IllegalArgumentException
      Gets the next group on the track, after the one provided
      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:
      IllegalArgumentException - if the track does not contain the group given
    • getPrevious

      public String getPrevious(Group current) throws IllegalArgumentException
      Gets the group before the group provided
      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:
      IllegalArgumentException - if the track does not contain the group given
    • getNext

      public String getNext(String current) throws IllegalArgumentException
      Gets the next group on the track, after the one provided
      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:
      IllegalArgumentException - if the track does not contain the group given
    • getPrevious

      public String getPrevious(String current) throws IllegalArgumentException
      Gets the group before the group provided
      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:
      IllegalArgumentException - if the track does not contain the group given
    • appendGroup

      public net.luckperms.api.model.data.DataMutateResult appendGroup(Group group)
      Appends a group to the end of this track
      Parameters:
      group - the group to append
      Returns:
      the result of the operation
    • insertGroup

      public net.luckperms.api.model.data.DataMutateResult insertGroup(Group group, int position) throws IndexOutOfBoundsException
      Inserts a group at a certain position on this track
      Parameters:
      group - the group to be inserted
      position - the index position (a value of 0 inserts at the start)
      Returns:
      the result of the operation
      Throws:
      IndexOutOfBoundsException - if the position is less than 0 or greater than the size of the track
    • removeGroup

      public net.luckperms.api.model.data.DataMutateResult removeGroup(Group group)
      Removes a group from this track
      Parameters:
      group - the group to remove
      Returns:
      the result of the operation
    • removeGroup

      public net.luckperms.api.model.data.DataMutateResult removeGroup(String group)
      Removes a group from this track
      Parameters:
      group - the group to remove
      Returns:
      the result of the operation
    • containsGroup

      public boolean containsGroup(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
    • containsGroup

      public boolean containsGroup(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
    • clearGroups

      public void clearGroups()
      Clear all of the groups within this track
    • promote

      public net.luckperms.api.track.PromotionResult promote(User user, net.luckperms.api.context.ContextSet context, Predicate<String> nextGroupPermissionChecker, @Nullable Sender sender, boolean addToFirst)
    • demote

      public net.luckperms.api.track.DemotionResult demote(User user, net.luckperms.api.context.ContextSet context, Predicate<String> previousGroupPermissionChecker, @Nullable Sender sender, boolean removeFromFirst)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object