Interface RequirementFailureHandler<C,R extends Requirement<C,R>>

Type Parameters:
C - command sender type
R - requirement type
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface @API(status=STABLE, since="1.0.0") public interface RequirementFailureHandler<C,R extends Requirement<C,R>>
Handler that gets invoked when a requirement is not met.
Since:
1.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    handleFailure(@NonNull org.incendo.cloud.context.CommandContext<C> context, @NonNull R requirement)
    Handles the case where the given context does not meet the given requirement.
    static <C, R extends Requirement<C, R>>
    @NonNull RequirementFailureHandler<C,R>
    Returns a requirement failure handler that does nothing.
  • Method Details

    • noOp

      static <C, R extends Requirement<C, R>> @NonNull RequirementFailureHandler<C,R> noOp()
      Returns a requirement failure handler that does nothing.
      Type Parameters:
      C - command sender type
      R - requirement type
      Returns:
      the handler
    • handleFailure

      void handleFailure(@NonNull org.incendo.cloud.context.CommandContext<C> context, @NonNull R requirement)
      Handles the case where the given context does not meet the given requirement.
      Parameters:
      context - the context
      requirement - the unmet requirement