Parameter

1 minute readReferenceExtensibilityDeveloper productivity

This class provides methods to process the following two types of parameters that are often used in plugins.

  • Configuration Parameters

  • Procedure Parameters

This is an example usage.

Parameter parameter = stepParameters.getParameter('query') println("Parameter: $parameter")

getName()

Retrieves a name from the Parameter object.

Parameters

None

Returns

(String) Name of the parameter.

Usage

String parameterName = parameter.getName()

getValue()

Returns a value of the current parameter.

Parameters

None

Returns

(String) Value of the parameter

Usage

def parameterValue = parameter.getValue()

This method gets applied by default, if Parameter object is used in string context**:

// getValue is being applied automatically in string context. Following 2 lines of code are doing the same: println("Query: ${query}") printf("Query: %s", query.getValue())

setName(String name)

Sets the name of a parameter.

Parameters

(Required) (String) Parameter Name

Returns

Nothing

Usage

parameter.setName('myNewName')

setValue(Object value)

Sets the value of a parameter.

Parameters

(Required)(Object) Parameter Value

Returns

Nothing

Usage

parameter.setValue('MyNewValue')