Interface IArguments
public interface IArguments
Encapsulation of the condition/function/validator arguments, as defined in
the workflow definition file. Provides convenience methods for retrieval of
different argument types, together with checking of argument presence.
- Author:
- dobisekm
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Deprecated.static final String
Deprecated.For backward compatibility only, useATTR_FIELD_NAME
instead in the configuration.static final String
Name of the field to check. -
Method Summary
Modifier and TypeMethodDescriptionReturns all the arguments asMap
.getArgumentsWithPrefix
(String prefix) Returns arguments started withprefix
asMap
.boolean
getAsBoolean
(String argName) Returns the value ofargName
asboolean
.boolean
getAsBoolean
(String argName, boolean defaultVal) Returns the value ofargName
asboolean
.int
Returns the value of a parameter asint
.int
Returns the value of a parameter asint
.Treats the given argument as comma-separated list ofString
s and turns such a representation into set.getAsSetOptional
(String argName) Same asgetAsSet(String)
, but in case of non existing argument an empty set is returned.getAsString
(String argName) Returns the value of a parameter asString
.getAsString
(String argName, String defaultVal) Returns the value of a parameter asString
.Returns the name of the argument the value of which is returned bygetFieldName()
.Returns the id of a filed to work with by checking several standard arguments.
-
Field Details
-
ATTR_FIELD_NAME
Name of the field to check.- See Also:
-
ATTR_FEATURE
Deprecated.For backward compatibility only, useATTR_FIELD_NAME
instead in the configuration.Name of the field to work with.- See Also:
-
ATTR_FIELD
Deprecated.For backward compatibility only, useATTR_FIELD_NAME
instead in the configuration.Name of the field to work with.- See Also:
-
-
Method Details
-
getAsString
Returns the value of a parameter asString
.- Parameters:
argName
- aString
object representing the name of the argument to get the value for- Returns:
- the value of
argName
asString
- Throws:
UserFriendlyRuntimeException
- if no such argument exists.
-
getAsString
Returns the value of a parameter asString
.- Parameters:
argName
- aString
object representing the name of the argument to get the value fordefaultVal
- aString
object representing the default value to use if the specified argument does not exist- Returns:
- a
String
object representing the argument value, if no such argument is defineddefaultVal
-
getAsInt
Returns the value of a parameter asint
.- Parameters:
argName
- aString
object representing the name of the argument to get the value for- Returns:
- an
int
value representing the argument value - Throws:
UserFriendlyRuntimeException
- if no such argument exists.
-
getAsInt
Returns the value of a parameter asint
. *- Parameters:
argName
- aString
object representing the name of the argument to get the value for *defaultVal
- aint
value representing the default value to use if the specified argument does not exist- Returns:
- an
int
value representing the argument value, if no such argument is defineddefaultVal
-
getAsBoolean
Returns the value ofargName
asboolean
.- Parameters:
argName
- aString
object representing the name of the argument to get the value for- Returns:
true
if given argument value is 'true' (ignoring case),false
otherwise- Throws:
UserFriendlyRuntimeException
- if no such argument exists.
-
getAsBoolean
Returns the value ofargName
asboolean
.- Parameters:
argName
- aString
object representing the name of the argument to get the value fordefaultVal
- aboolean
value representing the default value to use if the specified argument does not exist- Returns:
true
if given argument value istrue
(ignoring case), if argument is undefineddefaultVal
, otherwisefalse
-
getAsSet
Treats the given argument as comma-separated list ofString
s and turns such a representation into set.- Parameters:
argName
- aString
object representing the name of the argument to get the value for- Returns:
- a
Set
object containing the comma-separatedString
s in the argument value - Throws:
UserFriendlyRuntimeException
- if no such argument exists.
-
getAsSetOptional
Same asgetAsSet(String)
, but in case of non existing argument an empty set is returned.- Parameters:
argName
- aString
object representing the name of the argument to get the value for- Returns:
- a
Set
object containing the comma-separatedString
s in the argument value, if undefined an emptySet
-
getFieldName
Returns the id of a filed to work with by checking several standard arguments. For backward compatibility multiple attribute names are checked, in the following order:- Returns:
- a
String
object representing the name (id) of the field to work with - Throws:
UserFriendlyRuntimeException
- If the field id can not be found in either argument
-
getFieldArgumentName
Returns the name of the argument the value of which is returned bygetFieldName()
.- Since:
- 3.7.0
- See Also:
-
getArguments
Returns all the arguments asMap
.- Returns:
- a
Map
object containing all the arguments. - Since:
- 3.10.2
-
getArgumentsWithPrefix
Returns arguments started withprefix
asMap
.- Parameters:
prefix
- aString
object representing the prefix of the arguments to get the values for- Returns:
- a
Map
object containing all the arguments started withprefix
where keys are stripped of prefixes. - Since:
- 3.10.2
-
ATTR_FIELD_NAME
instead in the configuration.