@NotThreadSafe public interface CommandBuilderSupport<B extends CommandBuilderSupport<B>>
CommandBuilders and, for those plugins which choose to provide them, type-safe builders.| Modifier and Type | Method and Description |
|---|---|
<T> Command<T> |
build(CommandOutputHandler<T> outputHandler)
|
B |
clearEnvironment()
Clears any environment variables which have been set.
|
B |
defaultExitHandler()
Applies the default
CommandExitHandler. |
B |
exitHandler(CommandExitHandler value)
Sets the
CommandExitHandler which should be invoked after the command exits. |
B |
removeEnvironment(String name)
Removes the environment variable with the provided
name if it has been set |
B |
withEnvironment(String name,
String value)
Adds an environment variable with the specified
name and value. |
@Nonnull <T> Command<T> build(@Nonnull CommandOutputHandler<T> outputHandler)
Command which, when executed, will provide output to the provided
outputHandler for processing.T - type for the builderoutputHandler - the handler to receive and process output from the command as it executesNullPointerException - if the provided outputHandler is null@Nonnull B clearEnvironment()
this@Nonnull B defaultExitHandler()
CommandExitHandler. The default exit handler used is based on the builder in play;
each builder is free to define its own default exit handler.
Note: If no explicit exit handler is set, the default will be applied
automatically when the command is built; it is not possible to build a
command without an exit handler.
this@Nonnull B exitHandler(@Nonnull CommandExitHandler value)
CommandExitHandler which should be invoked after the command exits. This handler receives:
Throwable thrown during processingvalue - the handler which should be invoked when the command exitsthisNullPointerException - if the provided value is null@Nonnull B removeEnvironment(@Nonnull String name)
name if it has been setname - the name of the environment variable to clearthisIllegalArgumentException - if name is empty or blankNullPointerException - if name is null@Nonnull B withEnvironment(@Nonnull String name, @Nonnull String value)
name and value. Both parameters are required,
and an exception will be thrown if either is not provided.name - the name of the environment variable to setvalue - the value to set for the environment variablethisIllegalArgumentException - if name or value is empty or blankNullPointerException - if name or value is nullCopyright © 2023 Atlassian. All rights reserved.