Interface UsageVerifier<S extends Source>


@AvailableSince("1.0.0") public interface UsageVerifier<S extends Source>
Verifies that the CommandUsage is suitable to be added to the command

Rule(s) recommended following when creating a usage:

1) A usage MUST have AT LEAST ONE required parameter at the beginning before any other parameters whether optional or required

2) If the usage doesn't have any subcommands, it must not be duplicated in a similar parameters pattern

3) It MUSTN'T have a greedy argument in the middle of the parameters, therefore, if you want to add any greedy arguments, you should put A SINGLE (not multiple) greedy argument at the END of the usage parameters list ONLY

  • Method Details

    • simpleVerifier

      static <S extends Source> UsageVerifier<S> simpleVerifier()
    • typeTolerantVerifier

      static <S extends Source> UsageVerifier<S> typeTolerantVerifier()
    • verify

      boolean verify(CommandUsage<S> usage)
      Parameters:
      usage - the usage
      Returns:
      Verifies the usage to be acceptable
    • areAmbiguous

      boolean areAmbiguous(CommandUsage<S> firstUsage, CommandUsage<S> secondUsage)
      Parameters:
      firstUsage - the first usage
      secondUsage - the second usage
      Returns:
      whether both usages are similar and/or share similar indistinguishable parameters or syntax