Class AbstractRequiredUnlessRestriction

    • Constructor Detail

      • AbstractRequiredUnlessRestriction

        public AbstractRequiredUnlessRestriction()
    • Method Detail

      • unless

        protected abstract <T> boolean unless​(ParseState<T> state,
                                              OptionMetadata option)
        Answers whether the unless condition of the restriction is met

        If the unless condition is met then the restriction will not require the option to be present.

        Type Parameters:
        T - Command Type
        Parameters:
        state - Parse state
        option - Option Metadata
        Returns:
        True if unless condition met, false otherwise
      • unless

        protected abstract <T> boolean unless​(ParseState<T> state,
                                              ArgumentsMetadata arguments)
        Answers whether the unless condition of the restriction is met

        If the unless condition is met then the restriction will not require arguments to be present.

        Type Parameters:
        T - Command Type
        Parameters:
        state - Parse state
        arguments - Arguments Metadata
        Returns:
        True if unless condition met, false otherwise
      • unlessDescription

        protected abstract java.lang.String unlessDescription()
        Provides a description of the unless condition, this will be included in the error messages when this restriction is not met
        Returns:
        Unless condition description