Class PreconditionFactory<T extends Annotation>

java.lang.Object
kboyle.oktane.core.module.factory.PreconditionFactory<T>
Type Parameters:
T - The type of Annotation that this factory is for.
Direct Known Subclasses:
RequireBotOwner.Factory, RequireFailure.Factory, RequireGuildOwner.Factory, RequireHi.Factory, RequireHierarchy.Factory, RequirePermission.Factory

public abstract class PreconditionFactory<T extends Annotation> extends Object
Representations a factory for turning a given Annotation into a Precondition.
  • Field Details

    • NO_GROUP

      public static final Object NO_GROUP
      The value that the library uses to represent an ungroup Precondition.
  • Constructor Details

    • PreconditionFactory

      public PreconditionFactory()
  • Method Details

    • supportedType

      public abstract Class<T> supportedType()
      Returns:
      The type of Annotation that this factory supports.
    • createUngrouped

      public void createUngrouped(T annotation, Consumer<Precondition> preconditionConsumer)
      Allows creation of ungrouped Preconditions.
      Parameters:
      annotation - The Annotation to turn into a precondition.
      preconditionConsumer - The Precondition consumer, call this to add your precondition.
    • createGrouped

      public void createGrouped(T annotation, BiConsumer<Object,​Precondition> preconditionConsumer)
      Allows creation of grouped Preconditions.
      Parameters:
      annotation - The Annotation to turn into a precondition.
      preconditionConsumer - The Precondition consumer, call this to add your precondition, the first argument is the group.