Class ArgumentPair<C,​U,​V,​O>

  • Type Parameters:
    C - Command sender type
    U - First argument type
    V - Second argument type
    O - Output type
    All Implemented Interfaces:
    java.lang.Comparable<CommandArgument<?,​?>>

    public class ArgumentPair<C,​U,​V,​O>
    extends CompoundArgument<Pair<U,​V>,​C,​O>
    A compound argument consisting of two inner arguments
    • Constructor Detail

      • ArgumentPair

        protected ArgumentPair​(boolean required,
                               @NonNull java.lang.String name,
                               @NonNull Pair<@NonNull java.lang.String,​@NonNull java.lang.String> names,
                               @NonNull Pair<@NonNull java.lang.Class<U>,​@NonNull java.lang.Class<V>> types,
                               @NonNull Pair<@NonNull ArgumentParser<C,​U>,​@NonNull ArgumentParser<C,​V>> parserPair,
                               @NonNull java.util.function.BiFunction<@NonNull C,​@NonNull Pair<@NonNull U,​@NonNull V>,​@NonNull O> mapper,
                               @NonNull io.leangen.geantyref.TypeToken<O> valueType)
        Create a new argument pair.
        Parameters:
        required - Whether or not the argument is required
        name - The argument name
        names - Names of the sub-arguments (in order)
        types - Types of the sub-arguments (in order)
        parserPair - The sub arguments
        mapper - Mapper that maps the sub-arguments to the output type
        valueType - The output type
    • Method Detail

      • of

        public static <C,​U,​V> @NonNull ArgumentPair.ArgumentPairIntermediaryBuilder<C,​U,​V> of​(@NonNull CommandManager<C> manager,
                                                                                                                      @NonNull java.lang.String name,
                                                                                                                      @NonNull Pair<@NonNull java.lang.String,​@NonNull java.lang.String> names,
                                                                                                                      @NonNull Pair<@NonNull java.lang.Class<U>,​@NonNull java.lang.Class<V>> types)
        Construct a builder for an argument pair
        Type Parameters:
        C - Command sender type
        U - First parsed type
        V - Second parsed type
        Parameters:
        manager - Command manager
        name - Argument name
        names - Sub-argument names
        types - Pair containing the types of the sub-arguments. There must be parsers for these types registered in the ParserRegistry used by the CommandManager
        Returns:
        Intermediary builder