Class Permission
- java.lang.Object
-
- ca.stellardrift.permissionsex.minecraft.command.Permission
-
- All Implemented Interfaces:
cloud.commandframework.keys.CloudKeyHolder<Void>,cloud.commandframework.permission.CommandPermission,cloud.commandframework.permission.PredicatePermission<Commander>
@Immutable(builder=false) public abstract class Permission extends Object implements cloud.commandframework.permission.PredicatePermission<Commander>
A representation of a permission. [value] is a dotted string [description] describes the permission's purpose, including ways it may be specialized in use [default] is the value to resolve this permission to when unset
-
-
Constructor Summary
Constructors Constructor Description Permission()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intdefaultValue()A default value for when this permission is unassigned.abstract @Nullable net.kyori.adventure.text.Componentdescription()A description of the purpose of this permission.@NonNull cloud.commandframework.keys.CloudKey<Void>getKey()@NonNull Collection<@NonNull cloud.commandframework.permission.CommandPermission>getPermissions()booleanhasPermission(Commander sender)static Permissionof(String permission)static Permissionof(String permission, net.kyori.adventure.text.Component description)static Permissionof(String permission, net.kyori.adventure.text.Component component, int defaultValue)static Permissionpex(String value)Permissionthen(ca.stellardrift.permissionsex.subject.SubjectRef<?> other)Permissionthen(String other)StringtoString()abstract Stringvalue()A dot-separated string of permission elements.abstract Permissionvalue(String value)Get a permission with a modified value.
-
-
-
Constructor Detail
-
Permission
public Permission()
-
-
Method Detail
-
of
public static Permission of(String permission)
-
of
public static Permission of(String permission, net.kyori.adventure.text.Component description)
-
of
public static Permission of(String permission, net.kyori.adventure.text.Component component, int defaultValue)
-
pex
public static Permission pex(String value)
-
value
@Parameter public abstract String value()
A dot-separated string of permission elements.- Returns:
- the permission value
-
value
public abstract Permission value(String value)
Get a permission with a modified value.- Parameters:
value- the new permission value- Returns:
- a new value
-
description
@Parameter public abstract @Nullable net.kyori.adventure.text.Component description()
A description of the purpose of this permission.- Returns:
- the description, or empty
-
defaultValue
@Parameter @Default public int defaultValue()
A default value for when this permission is unassigned.- Returns:
- the default value
-
then
public final Permission then(ca.stellardrift.permissionsex.subject.SubjectRef<?> other)
-
then
public final Permission then(String other)
-
hasPermission
public final boolean hasPermission(Commander sender)
- Specified by:
hasPermissionin interfacecloud.commandframework.permission.PredicatePermission<Commander>
-
getPermissions
public final @NonNull Collection<@NonNull cloud.commandframework.permission.CommandPermission> getPermissions()
- Specified by:
getPermissionsin interfacecloud.commandframework.permission.CommandPermission- Specified by:
getPermissionsin interfacecloud.commandframework.permission.PredicatePermission<Commander>
-
-