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:
CloudKeyHolder<O>, Comparable<CommandArgument<?,?>>

@API(status=STABLE) public class ArgumentPair<C,U,V,O> extends CompoundArgument<Pair<U,V>,C,O>
A compound argument consisting of two inner arguments
  • Constructor Details

    • ArgumentPair

      protected ArgumentPair(boolean required, @NonNull String name, @NonNull Pair<@NonNull String,@NonNull String> names, @NonNull Pair<@NonNull Class<U>,@NonNull Class<V>> types, @NonNull Pair<@NonNull ArgumentParser<C,U>,@NonNull ArgumentParser<C,V>> parserPair, @NonNull 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 Details

    • of

      public static <C, U, V> @NonNull ArgumentPair.ArgumentPairIntermediaryBuilder<C,U,V> of(@NonNull CommandManager<C> manager, @NonNull String name, @NonNull Pair<@NonNull String,@NonNull String> names, @NonNull Pair<@NonNull Class<U>,@NonNull 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