Class PreconditionFactory<T extends Annotation>
java.lang.Object
kboyle.oktane.core.module.factory.PreconditionFactory<T>
- Type Parameters:
T- The type ofAnnotationthat this factory is for.
- Direct Known Subclasses:
RequireBotOwner.Factory,RequireFailure.Factory,RequireGuildOwner.Factory,RequireHi.Factory,RequireHierarchy.Factory,RequirePermission.Factory
Representations a factory for turning a given
Annotation into a Precondition.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic ObjectThe value that the library uses to represent an ungroupPrecondition. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateGrouped(T annotation, BiConsumer<Object,Precondition> preconditionConsumer)Allows creation of groupedPreconditions.voidcreateUngrouped(T annotation, Consumer<Precondition> preconditionConsumer)Allows creation of ungroupedPreconditions.
-
Field Details
-
NO_GROUP
The value that the library uses to represent an ungroupPrecondition.
-
-
Constructor Details
-
PreconditionFactory
public PreconditionFactory()
-
-
Method Details
-
supportedType
- Returns:
- The type of
Annotationthat this factory supports.
-
createUngrouped
Allows creation of ungroupedPreconditions.- Parameters:
annotation- TheAnnotationto turn into a precondition.preconditionConsumer- ThePreconditionconsumer, call this to add your precondition.
-
createGrouped
Allows creation of groupedPreconditions.- Parameters:
annotation- TheAnnotationto turn into a precondition.preconditionConsumer- ThePreconditionconsumer, call this to add your precondition, the first argument is the group.
-