Class 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
    • Method Detail

      • 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)
      • 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)
      • getKey

        public final @NonNull cloud.commandframework.keys.CloudKey<VoidgetKey()
        Specified by:
        getKey in interface cloud.commandframework.keys.CloudKeyHolder<Void>
        Specified by:
        getKey in interface cloud.commandframework.permission.PredicatePermission<Commander>
      • hasPermission

        public final boolean hasPermission​(Commander sender)
        Specified by:
        hasPermission in interface cloud.commandframework.permission.PredicatePermission<Commander>
      • getPermissions

        public final @NonNull Collection<@NonNull cloud.commandframework.permission.CommandPermission> getPermissions()
        Specified by:
        getPermissions in interface cloud.commandframework.permission.CommandPermission
        Specified by:
        getPermissions in interface cloud.commandframework.permission.PredicatePermission<Commander>
      • toString

        public final String toString()
        Specified by:
        toString in interface cloud.commandframework.permission.CommandPermission
        Overrides:
        toString in class Object