Interface RequirementFailureHandler<C,R extends Requirement<C,R>>
- Type Parameters:
C- command sender typeR- 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 TypeMethodDescriptionvoidhandleFailure(@NonNull org.incendo.cloud.context.CommandContext<C> context, @NonNull R requirement) Handles the case where the givencontextdoes not meet the givenrequirement.static <C,R extends Requirement<C, R>>
@NonNull RequirementFailureHandler<C,R> noOp()Returns a requirement failure handler that does nothing.
-
Method Details
-
noOp
Returns a requirement failure handler that does nothing.- Type Parameters:
C- command sender typeR- requirement type- Returns:
- the handler
-
handleFailure
void handleFailure(@NonNull org.incendo.cloud.context.CommandContext<C> context, @NonNull R requirement) Handles the case where the givencontextdoes not meet the givenrequirement.- Parameters:
context- the contextrequirement- the unmet requirement
-