Annotation Type RestrictedTo
-
@Retention(RUNTIME) @Target(TYPE) @Repeatable(Restrictions.class) @Documented public @interface RestrictedTo
An annotation with which one or more restriction rules for a command can be configured. If more than one of these annotations is present, a@RestrictionPolicy
annotation that defines how the single restrictions are to be combined is mandatory if the default implementation ofCommand.getRestrictionChain()
is used. For more complex boolean logicCommand.getRestrictionChain()
can be overwritten or an ownRestriction
implementation can be provided. For the latter also helpers likeChannelJavacord
,RoleJavacord
,ServerJavacord
,UserJavacord
,AllOf
,AnyOf
, orNoneOf
can be used as super classes.Alternatively to using this annotation the
Command.getRestrictionChain()
method can be overwritten. If that method is overwritten and this annotation is used, the method overwrite takes precedence. That method is also what should be used to retrieve the configured restrictions.- See Also:
Command.getRestrictionChain()
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description Class<? extends Restriction<?>>
value
Returns the restriction class for the annotated command.
-
-
-
Element Detail
-
value
Class<? extends Restriction<?>> value
Returns the restriction class for the annotated command.- Returns:
- the restriction class for the annotated command
-
-