Class PreconditionFactory<T extends Annotation>
java.lang.Object
kboyle.oktane.core.module.factory.PreconditionFactory<T>
- Type Parameters:
T
- The type ofAnnotation
that 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 Object
The value that the library uses to represent an ungroupPrecondition
. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
createGrouped(T annotation, BiConsumer<Object,Precondition> preconditionConsumer)
Allows creation of groupedPrecondition
s.void
createUngrouped(T annotation, Consumer<Precondition> preconditionConsumer)
Allows creation of ungroupedPrecondition
s.
-
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
Annotation
that this factory supports.
-
createUngrouped
Allows creation of ungroupedPrecondition
s.- Parameters:
annotation
- TheAnnotation
to turn into a precondition.preconditionConsumer
- ThePrecondition
consumer, call this to add your precondition.
-
createGrouped
Allows creation of groupedPrecondition
s.- Parameters:
annotation
- TheAnnotation
to turn into a precondition.preconditionConsumer
- ThePrecondition
consumer, call this to add your precondition, the first argument is the group.
-