Static functions of global utility plopped into a class.
Type Params | Return Type | Name and description |
---|---|---|
|
static java.lang.String |
arg(java.lang.Object argument) Quotes the given shell argument. |
|
static java.lang.String |
args(java.util.List arguments) Quotes all given shell arguments. |
|
static java.lang.Object |
collectAllNested(java.lang.Object obj, java.lang.Object func = { it }) Similar to collectNested, recursively iterates through the given object's collections and transforms each value by calling the given closure. |
|
static java.lang.String |
envs(java.util.Map envVars) Combines all given environment variables into docker option format |
|
static java.lang.Object |
mapStrings(java.lang.Object value, java.lang.Object func = { it }) Iterates recursively over lists and maps in the given object and returns a new object where each member string has been mapped to a new value using the given closure. |
|
static java.util.Map |
merge(java.util.Map... maps) Merges two or more maps recursively. |
|
static java.util.Map |
parseImageRef(java.lang.String ref) Parses the given OCI image ref into constituent parts: (name, tag, digest). |
|
static java.lang.String |
randomAlphanum(java.lang.Object length) Returns a random alpha-numeric string that's length long. |
|
static java.lang.String |
sanitizeRelativePath(java.lang.String path) Forces the given path to be relative and absent any parent directory links ( .. |
|
static java.lang.String |
timestampLabel() Returns a timestamp suitable for use in image names, tags, etc. |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Quotes the given shell argument.
argument
- Shell argument.Quotes all given shell arguments.
arguments
- Shell argument.Similar to collectNested, recursively iterates through the given object's collections and transforms each value by calling the given closure. Where this differs from the former is that even the collection values themselves are transformed. This method also supports Maps whereas the former does not.
Combines all given environment variables into docker option format
envVars
- Environment variables Iterates recursively over lists and maps in the given object and returns
a new object where each member string has been mapped to a new value
using the given closure.
mapStrings([foo: [bar: "ab"], baz: "xy"]) { it.reverse()
// [foo: [bar: "ba"], baz: "yx"]
}
Merges two or more maps recursively.
merge([foo: [bar: "x", baz: "y"]], [foo: [baz: "z"]])
// [foo: [bar: "x", baz: "z"]]
Parses the given OCI image ref into constituent parts: (name, tag, digest). If the given string is an invalid ref pattern, null is returned.
ref
- Full image ref string.Returns a random alpha-numeric string that's length long.
length
- Desired length of string. Forces the given path to be relative and absent any parent directory
links (..
) that would resolve to a directory outside the
current one.
path
- Path to sanitize.Returns a timestamp suitable for use in image names, tags, etc.