Interface EnumRankNode<E extends Enum<E>>
- All Superinterfaces:
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 TypeMethodDescription@Nullable EnumRankNode<E>Returns the previous rank node in the hierarchy.getValue()Returns the enum value of this rank node.linear(E value, boolean ascending) Creates aEnumRankNodewith a linear hierarchy.
-
Method Details
-
linear
static <E extends Enum<E>> RankNode linear(E value, Function<E, String> nameExtractor, boolean ascending) Creates aEnumRankNodewith 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 valuenameExtractor- the extractor for the rank nameascending- whether the enum ranks are in ascending order- Returns:
- the created enum rank node
-
linear
-
getValue
E getValue()Returns the enum value of this rank node. -
getPrevious
@Nullable EnumRankNode<E> getPrevious()Description copied from interface:RankNodeReturns the previous rank node in the hierarchy.- Specified by:
getPreviousin interfaceRankNode
-