Top Description Fields Constructors Methods
liquibase.command

public Class CommandResultsBuilder

extends Object
Class Inheritance
Imports
liquibase.Scope, liquibase.util.StringUtil, java.io.OutputStream, java.util.SortedMap, .TreeMap

Because CommandResults is immutable, this class is used to build up the results during CommandStep#run(CommandResultsBuilder).

Field Summary

Modifier and TypeField and Description
private final CommandScope
private final OutputStream
private final SortedMap<String, Object>

Constructor Summary

AccessConstructor and Description
pack-priv
CommandResultsBuilder(CommandScope commandScope, OutputStream outputStream)

Method Summary

Modifier and TypeMethod and Description
public CommandResultsBuilder
addResult(String key, Object value)

Adds a key/value pair to the command results.

public <T> CommandResultsBuilder
addResult(CommandResultDefinition<T> definition, T value)

Sets the value for a known CommandResultDefinition to the command results.

pack-priv CommandResults
build()

Collects the results and flushes the output stream.

public CommandFailedException
commandFailed(String message, int exitCode)

public CommandFailedException
commandFailed(String message, int exitCode, boolean expected)

public CommandScope
getCommandScope()

Return the CommandScope the results are being built for.

public OutputStream
getOutputStream()

Returns the OutputStream for output for the command.

public Object
getResult(String key)

Allows any step of the pipeline to access any of the results.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

commandScopeback to summary
private final CommandScope commandScope
outputStreamback to summary
private final OutputStream outputStream
resultValuesback to summary
private final SortedMap<String, Object> resultValues

Constructor Detail

CommandResultsBuilderback to summary
pack-priv CommandResultsBuilder(CommandScope commandScope, OutputStream outputStream)

Method Detail

addResultback to summary
public CommandResultsBuilder addResult(String key, Object value)

Adds a key/value pair to the command results.

See Also
addResult(CommandResultDefinition, Object)
addResultback to summary
public <T> CommandResultsBuilder addResult(CommandResultDefinition<T> definition, T value)

Sets the value for a known CommandResultDefinition to the command results.

buildback to summary
pack-priv CommandResults build()

Collects the results and flushes the output stream.

commandFailedback to summary
public CommandFailedException commandFailed(String message, int exitCode)
commandFailedback to summary
public CommandFailedException commandFailed(String message, int exitCode, boolean expected)
getCommandScopeback to summary
public CommandScope getCommandScope()

Return the CommandScope the results are being built for.

getOutputStreamback to summary
public OutputStream getOutputStream()

Returns the OutputStream for output for the command.

See Also
CommandScope#setOutput(OutputStream)
getResultback to summary
public Object getResult(String key)

Allows any step of the pipeline to access any of the results.