Result

inner class Result<T>(val v: CmdUtils.Var, val fileNameConvention: CmdUtils.Var.() -> String, val envVarNameConvention: CmdUtils.Var.() -> String, val transform: CmdUtils.Var.(List<String>) -> T = { it as T })

Represents different kinds of results a variable can emit.

Parameters

T

output type of the result: list of string or string etc.

Constructors

Link copied to clipboard
constructor(v: CmdUtils.Var, fileNameConvention: CmdUtils.Var.() -> String, envVarNameConvention: CmdUtils.Var.() -> String, transform: CmdUtils.Var.(List<String>) -> T = { it as T })

Types

Link copied to clipboard
private inner class Content(outputHandler: CmdOutputHandler)

Container for content received from outputHandler of the result.

Properties

Link copied to clipboard

Alias for getting filePath.

Link copied to clipboard

Returns an environment variable storing the result, if the CmdOutputHandler did use environment variables.

Link copied to clipboard
private lateinit var content: CmdUtils.Var.Result.Content<T>
Link copied to clipboard

Returns the environment variable used to store the result, if the CmdOutputHandler did use environment variables.

Link copied to clipboard
Link copied to clipboard

Returns the file name used to store the result.

Link copied to clipboard
Link copied to clipboard

Returns the absolute path of fileName within the stage execution environment host.

Link copied to clipboard

Returns a command for printing the content of environment variable storing the result, if the CmdOutputHandler did use environment variables.

Link copied to clipboard

additional transformation from list of lines to a desired value of type T.

Link copied to clipboard

the underlying Var.

Functions

Link copied to clipboard
fun readyContent(outputHandler: CmdOutputHandler): T

Initializes result content once if not yet: retrieves it through outputHandler and memoizes it. Returns the already retrieved content.