Class MaximumValidator

java.lang.Object
com.github.kaktushose.jda.commands.dispatching.validation.impl.MaximumValidator
All Implemented Interfaces:
Validator

public class MaximumValidator extends Object implements Validator
A Validator implementation that checks the Max constraint.
See Also:
  • Constructor Details

    • MaximumValidator

      public MaximumValidator()
  • Method Details

    • apply

      public boolean apply(@NotNull @NotNull Object argument, @NotNull @NotNull Object annotation, @NotNull @NotNull InvocationContext<?> context)
      Validates an argument. The argument must be a number whose value must be less or equal to the specified maximum.
      Specified by:
      apply in interface Validator
      Parameters:
      argument - the argument to validate
      annotation - the corresponding annotation
      context - the corresponding InvocationContext
      Returns:
      true if the argument is a number whose value is less or equal to the specified maximum