public interface Command
Command encapsulates a complete CCL (Concourse Command Language)
statement that can be rendered as a CCL string.
Commands are constructed using the fluent builder methods
available from the CommandBuilder returned by to(),
is(), or go(). All three entry points are interchangeable
aliases — choose whichever reads most naturally for the command being
constructed: to() for actions, is() for checks, and
go() as an imperative. Each builder method returns a state object
whose methods guide the caller through the valid parameter sequence for that
command. Terminal states implement Command, so the result can be used
directly without an explicit build() call.
// Write
Command cmd = Command.to().add("name").as("jeff").in(1);
// Query
Command cmd = Command.to().find(criteria).order(order);
// Check
Command cmd = Command.is().holds(1);
// Imperative
Command cmd = Command.go().ping();
// Render
String ccl = cmd.ccl();
| Modifier and Type | Method and Description |
|---|---|
String |
ccl()
Return a CCL string equivalent to this
Command. |
static CommandBuilder |
go()
Return a
CommandBuilder for constructing Commands. |
static CommandBuilder |
is()
Return a
CommandBuilder for constructing Commands. |
static Command |
parse(String ccl)
Parse a CCL command string into a
Command. |
static List<Command> |
parseAll(String ccl)
|
static CommandBuilder |
to()
Return a
CommandBuilder for constructing Commands. |
static Command parse(String ccl)
Command.
The provided ccl string is compiled using the
ConcourseCompiler and must represent a valid command statement
(e.g., "find age > 30 order by name" or
"add name as jeff in 1").
ccl - the CCL command string to parseCommandParseException - if the CCL string is not a valid commandstatic List<Command> parseAll(String ccl)
ccl - the semicolon-separated CCL stringList of typed CommandsIllegalArgumentException - if any statement in the CCL string is
not a valid commandstatic CommandBuilder to()
CommandBuilder for constructing Commands.
This entry point reads naturally for action commands:
Command.to().add("name").as("jeff").in(1).
CommandBuilderstatic CommandBuilder is()
CommandBuilder for constructing Commands.
This entry point reads naturally for query and check commands:
Command.is().holds(1).
CommandBuilderstatic CommandBuilder go()
CommandBuilder for constructing Commands.
This entry point reads naturally as an imperative:
Command.go().add("name").as("jeff").in(1).
CommandBuilder