Package org.kuali.rice.krms.api.engine
Class ExecutionOptions
java.lang.Object
org.kuali.rice.krms.api.engine.ExecutionOptions
The ExecutionOptions contain a set of options that can be passed to the KRMS
engine to control certain aspects related to it's execution. It supports
two different types of options:
- flags - a map of pre-defined boolean
ExecutionFlaginstances which can be either true or false - options - a general-purpose map of Strings which can be used to define optinos that have non-boolen values
The options map can be used to pass user-defined or provider-specific options. The ExecutionOptions are made
available as part of the ExecutionEnvironment during engine execution.
Instances of ExecutionOptions are not safe for use by multiple threads.
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct an empty set of execution options.ExecutionOptions(ExecutionOptions executionOptions) Constructs a new set of execution options, initialized with all options and flags copied from the given set of execution options. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetFlag(ExecutionFlag flag) Returns the value the given flag.getFlags()Returns an immutable map of the flags that have been set on this object.Returns the value for the option with the given name, or null if the option is not set.Returns an immutable map of the options that have been set on this object.booleanisFlagSet(ExecutionFlag flag) Checks whether or not the given flag is set.booleanisOptionSet(String optionName) Checks whether or not the option with the given name has been set.removeFlag(ExecutionFlag flag) Removes the specified flag (if it has been set) from the set of execution options.removeOption(String optionName) Removes the option with the specified name (if it has been set) from the set of execution options.setFlag(ExecutionFlag flag, boolean value) Sets the value for the given flag to the given boolean value.Sets the value for the given option name to the given value.
-
Constructor Details
-
ExecutionOptions
public ExecutionOptions()Construct an empty set of execution options. -
ExecutionOptions
Constructs a new set of execution options, initialized with all options and flags copied from the given set of execution options.- Parameters:
executionOptions- the execution options from which to copy into the newly created instance. If the given execution options are null, then this constructor is equivalent toExecutionOptions()
-
-
Method Details
-
setFlag
Sets the value for the given flag to the given boolean value.- Parameters:
flag- the flag to setvalue- the flag value to set- Returns:
- a reference to this object
- Throws:
IllegalArgumentException- if the given flag is null
-
setOption
Sets the value for the given option name to the given value.- Parameters:
optionName- the name of the option to setvalue- the value of the option to set- Returns:
- a reference to this object
- Throws:
IllegalArgumentException- if the given optionName is blank
-
removeFlag
Removes the specified flag (if it has been set) from the set of execution options. If the flag is not currently set, this method will do nothing.- Parameters:
flag- the flag to remove- Returns:
- a reference to this object
- Throws:
IllegalArgumentException- if the given flag is null
-
removeOption
Removes the option with the specified name (if it has been set) from the set of execution options. If the option is not currently set, this method will do nothing.- Parameters:
optionName- the name of the option to remove- Returns:
- a reference to this object
- Throws:
IllegalArgumentException- if the given optionName is blank
-
getFlag
Returns the value the given flag. If the specified flag has not been set on this object, thenExecutionFlag.getDefaultValue()will be returned.- Parameters:
flag- the flag to check- Returns:
- the value of the flag, or the flag's default value if the flag value is not currently set on this object
- Throws:
IllegalArgumentException- if the given flag is null
-
getOption
Returns the value for the option with the given name, or null if the option is not set.- Parameters:
optionName- the name of the option for which to retrieve the value- Returns:
- the value of the option, or null if the option is not set
- Throws:
IllegalArgumentException- if the given optionName is blank
-
isFlagSet
Checks whether or not the given flag is set.- Parameters:
flag- the flag to check- Returns:
- true if the flag is set, false if not
- Throws:
IllegalArgumentException- if the given flag is null
-
isOptionSet
Checks whether or not the option with the given name has been set.- Parameters:
optionName- the name of the option to check- Returns:
- true if the option is set, false if not
- Throws:
IllegalArgumentException- if the given optionName is blank
-
getFlags
Returns an immutable map of the flags that have been set on this object.- Returns:
- the flags that have been set, this map be empty but will never be null
-
getOptions
Returns an immutable map of the options that have been set on this object.- Returns:
- the options that have been set, this map be empty but will never be null
-