@FunctionalInterface
public static interface CommandPermission.Factory<A extends CommandActor>
CommandPermission
implementations. This reader can have access to a command's annotations.| Modifier and Type | Method and Description |
|---|---|
@Nullable CommandPermission<A> |
create(@NotNull AnnotationList annotations,
@NotNull Lamp<A> lamp)
Creates a new
CommandPermission for the given list of annotations. |
static <A extends CommandActor,T extends java.lang.annotation.Annotation> |
forAnnotation(@NotNull java.lang.Class<T> annotationType,
@NotNull java.util.function.Function<T,CommandPermission<A>> permissionCreator)
Creates a
CommandPermission.Factory that creates a CommandPermission for every
function or parameter that contains a certain |
static <A extends CommandActor,T extends java.lang.annotation.Annotation> CommandPermission.Factory<A> forAnnotation(@NotNull @NotNull java.lang.Class<T> annotationType, @NotNull @NotNull java.util.function.Function<T,CommandPermission<A>> permissionCreator)
CommandPermission.Factory that creates a CommandPermission for every
function or parameter that contains a certainA - The actor typeT - The annotation typeannotationType - The annotation typepermissionCreator - The function that creates a CommandPermission
for the given annotation.CommandPermission.Factory@Nullable @Nullable CommandPermission<A> create(@NotNull @NotNull AnnotationList annotations, @NotNull @NotNull Lamp<A> lamp)
CommandPermission for the given list of annotations. This
may be a parameter or a function (method).
If this factory is not responsible for the given input, it may return
null.
annotations - The annotation listlamp - The Lamp instance