Interface EnumRankNode<E extends Enum<E>>

All Superinterfaces:
RankNode

public interface EnumRankNode<E extends Enum<E>> extends RankNode
Represents a rank backed by an enum.
  • Field Summary

    Fields inherited from interface com.xpdustry.distributor.api.permission.rank.RankNode

    NAME_PATTERN
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable EnumRankNode<E>
    Returns the previous rank node in the hierarchy.
    Returns the enum value of this rank node.
    static <E extends Enum<E>>
    RankNode
    linear(E value, String namespace, boolean ascending)
    Creates a EnumRankNode with a linear hierarchy.
    static <E extends Enum<E>>
    RankNode
    singular(E value, String namespace)
    Creates a EnumRankNode with no hierarchy.

    Methods inherited from interface com.xpdustry.distributor.api.permission.rank.RankNode

    getName
  • Method Details

    • linear

      static <E extends Enum<E>> RankNode linear(E value, String namespace, boolean ascending)
      Creates a EnumRankNode with a linear hierarchy. This means the rank nodes are ordered by the enum ordinal. It can be either:
      • ascending, where the lower ordinal is the lower rank
      • descending, where the higher ordinal is the lower rank
      Type Parameters:
      E - the enum type
      Parameters:
      value - the rank value
      namespace - the rank namespace
      ascending - whether the enum ranks are in ascending order
      Returns:
      the created enum rank node
    • singular

      static <E extends Enum<E>> RankNode singular(E value, String namespace)
      Creates a EnumRankNode with no hierarchy. This means each rank node is independent of each other. Ideal for achievements based permissions.
      Type Parameters:
      E - the enum type
      Parameters:
      value - the rank value
      namespace - the rank namespace
      Returns:
      the created enum rank node
    • getValue

      E getValue()
      Returns the enum value of this rank node.
    • getPrevious

      @Nullable EnumRankNode<E> getPrevious()
      Description copied from interface: RankNode
      Returns the previous rank node in the hierarchy.
      Specified by:
      getPrevious in interface RankNode