Class RequirementPostprocessor<C,R extends Requirement<C,R>>

java.lang.Object
org.incendo.cloud.processors.requirements.RequirementPostprocessor<C,R>
Type Parameters:
C - command sender type
R - requirement type
All Implemented Interfaces:
Consumer<org.incendo.cloud.execution.postprocessor.CommandPostprocessingContext<C>>, Function<org.incendo.cloud.execution.postprocessor.CommandPostprocessingContext<C>,org.incendo.cloud.services.State>, org.incendo.cloud.execution.postprocessor.CommandPostprocessor<C>, org.incendo.cloud.services.type.ConsumerService<org.incendo.cloud.execution.postprocessor.CommandPostprocessingContext<C>>, org.incendo.cloud.services.type.Service<org.incendo.cloud.execution.postprocessor.CommandPostprocessingContext<C>,org.incendo.cloud.services.State>, org.incendo.cloud.services.type.SideEffectService<org.incendo.cloud.execution.postprocessor.CommandPostprocessingContext<C>>

@API(status=STABLE, since="1.0.0") public final class RequirementPostprocessor<C,R extends Requirement<C,R>> extends Object implements org.incendo.cloud.execution.postprocessor.CommandPostprocessor<C>
CommandPostprocessor that checks for requirements before the commands are executed.
Since:
1.0.0
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.incendo.cloud.services.type.ConsumerService

    org.incendo.cloud.services.type.ConsumerService.PipeBurst
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    accept(@NonNull org.incendo.cloud.execution.postprocessor.CommandPostprocessingContext<C> context)
     
    static <C, R extends Requirement<C, R>>
    RequirementPostprocessor<C,R>
    of(@NonNull org.incendo.cloud.key.CloudKey<Requirements<C,R>> requirementKey, @NonNull RequirementFailureHandler<C,R> failureHandler)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.function.Consumer

    andThen

    Methods inherited from interface org.incendo.cloud.services.type.ConsumerService

    handle

    Methods inherited from interface java.util.function.Function

    andThen, compose

    Methods inherited from interface org.incendo.cloud.services.type.Service

    apply, order
  • Method Details

    • of

      public static <C, R extends Requirement<C, R>> RequirementPostprocessor<C,R> of(@NonNull org.incendo.cloud.key.CloudKey<Requirements<C,R>> requirementKey, @NonNull RequirementFailureHandler<C,R> failureHandler)
      Type Parameters:
      C - command sender type
      R - requirement type
      Parameters:
      requirementKey - key that is used to store the requirements in the CommandMeta
      failureHandler - handler that gets invoked when a requirement is unmet
      Returns:
      the postprocessor
    • accept

      public void accept(@NonNull org.incendo.cloud.execution.postprocessor.CommandPostprocessingContext<C> context)
      Specified by:
      accept in interface Consumer<C>
      Specified by:
      accept in interface org.incendo.cloud.services.type.ConsumerService<C>