Class ProviderContext<T>


  • public final class ProviderContext<T>
    extends Object
    Context from a CommandProvider for a command's execution.
    • Method Detail

      • of

        public static <T> ProviderContext<T> of​(Command<T> command,
                                                @Nullable
                                                T context)
        Constructs a ProviderContext.
        Parameters:
        command - The command for possible execution.
        context - The context for the command's execution. May be null.
        Returns:
        A constructed ProviderContext.
      • of

        public static <T> ProviderContext<T> of​(Command<T> command)
        Constructs a ProviderContext.
        Parameters:
        command - The command for possible execution.
        Returns:
        A constructed ProviderContext.
      • getCommand

        public Command<T> getCommand()
        Gets the command for possible execution.
        Returns:
        The command for possible execution.
      • getContext

        public Optional<T> getContext()
        Gets the context for the command's execution, if present.
        Returns:
        The context for the command's execution, if present.