Class ActionDefinition.Builder
java.lang.Object
org.kuali.rice.krms.api.repository.action.ActionDefinition.Builder
- All Implemented Interfaces:
Serializable,Identifiable,Versioned,ModelBuilder,ActionDefinitionContract
- Enclosing class:
ActionDefinition
public static class ActionDefinition.Builder
extends Object
implements ActionDefinitionContract, ModelBuilder, Serializable
This builder is used to construct instances of KRMS Repository Action. It enforces the constraints of the
ActionDefinitionContract.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds an instance of a Action based on the current state of the builder.static ActionDefinition.Buildercreate(String actionId, String name, String namespace, String typeId, String ruleId, Integer sequenceNumber) Create a builder with the given parametersstatic ActionDefinition.Buildercreate(ActionDefinitionContract contract) Creates a builder by populating it with data from the givenActionDefinitionContract.Returns a set of attributes associated with the Action.Returns the description for what the parameter is used for.getId()getName()Returns the name of the ActionReturns the namespace of the ActionReturns the id of the rule associated with the actionReturns the sequence number of the actionReturns the KrmsType of the ActionvoidsetAttributes(Map<String, String> attributes) Sets the value of the attributes on this builder to the given value.voidsetDescription(String desc) Sets the value of the description on this builder to the given value.voidSets the value of the id on this builder to the given value.voidSets the value of the name on this builder to the given value.voidsetNamespace(String namespace) Sets the value of the namespace on this builder to the given value.voidSets the value of the ruleId on this builder to the given value.voidsetSequenceNumber(Integer sequenceNumber) Sets the value of the sequenceNumber on this builder to the given value.voidSets the value of the typeId on this builder to the given value.voidsetVersionNumber(Long versionNumber) Sets the value of the versionNumber on this builder to the given value.
-
Method Details
-
create
public static ActionDefinition.Builder create(String actionId, String name, String namespace, String typeId, String ruleId, Integer sequenceNumber) Create a builder with the given parameters- Parameters:
actionId- the actionId value to set, must no tbe null or blankname- the name value to set, must not be null or blanknamespace- the namespace value to set, must not be null or blanktypeId- the typeId value to setruleId- the ruleId value to set, must not be null or blanksequenceNumber- the sequenceNumber value to set, must not be null or blank- Returns:
- an instance of the builder populated with given data
-
create
Creates a builder by populating it with data from the givenActionDefinitionContract.- Parameters:
contract- the contract from which to populate this builder- Returns:
- an instance of the builder populated with data from the contract
- Throws:
IllegalArgumentException- if the contract is null
-
setId
Sets the value of the id on this builder to the given value.- Parameters:
actionId- the actionId value to set, must no tbe null or blank- Throws:
IllegalArgumentException- if the actionId is non-null and blank
-
setName
Sets the value of the name on this builder to the given value.- Parameters:
name- the name value to set, must not be null or blank- Throws:
IllegalArgumentException- if the name is non-null and blank
-
setNamespace
Sets the value of the namespace on this builder to the given value.- Parameters:
namespace- the namespace value to set, must not be null or blank- Throws:
IllegalArgumentException- if the namespace is non-null and blank
-
setDescription
Sets the value of the description on this builder to the given value.- Parameters:
desc- the description value to set
-
setTypeId
Sets the value of the typeId on this builder to the given value.- Parameters:
typeId- the typeId value to set, must not be null or blank.- Throws:
IllegalArgumentException- if the typeId is null or blank
-
setRuleId
Sets the value of the ruleId on this builder to the given value.- Parameters:
ruleId- the ruleId value to set, may be null but must not blank- Throws:
IllegalArgumentException- if the ruleId is blank
-
setSequenceNumber
Sets the value of the sequenceNumber on this builder to the given value.- Parameters:
sequenceNumber- the sequenceNumber value to set, must not be null or blank- Throws:
IllegalArgumentException- if the sequenceNumber is null or blank
-
setAttributes
Sets the value of the attributes on this builder to the given value.- Parameters:
attributes- the attributes value to set, can be null
-
setVersionNumber
Sets the value of the versionNumber on this builder to the given value.- Parameters:
versionNumber- the versionNumber value to set
-
getId
- Specified by:
getIdin interfaceIdentifiable
-
getName
Description copied from interface:ActionDefinitionContractReturns the name of the Actionname - the name of the Action
- Specified by:
getNamein interfaceActionDefinitionContract- Returns:
- the name of the Action
-
getNamespace
Description copied from interface:ActionDefinitionContractReturns the namespace of the ActionThe namespace of the Action
- Specified by:
getNamespacein interfaceActionDefinitionContract- Returns:
- the namespace of the Action
-
getDescription
Description copied from interface:ActionDefinitionContractReturns the description for what the parameter is used for. This can be null or a blank string.- Specified by:
getDescriptionin interfaceActionDefinitionContract- Returns:
- the description of the Action
-
getTypeId
Description copied from interface:ActionDefinitionContractReturns the KrmsType of the Action- Specified by:
getTypeIdin interfaceActionDefinitionContract- Returns:
- id for KRMS type related of the Action
-
getRuleId
Description copied from interface:ActionDefinitionContractReturns the id of the rule associated with the action- Specified by:
getRuleIdin interfaceActionDefinitionContract- Returns:
- id for the Rule associated with the action.
-
getSequenceNumber
Description copied from interface:ActionDefinitionContractReturns the sequence number of the action- Specified by:
getSequenceNumberin interfaceActionDefinitionContract- Returns:
- sequence number of the action.
-
getAttributes
Description copied from interface:ActionDefinitionContractReturns a set of attributes associated with the Action. The attributes are represented as name/value pairs.- Specified by:
getAttributesin interfaceActionDefinitionContract- Returns:
- a set of ActionAttribute objects.
-
getVersionNumber
- Specified by:
getVersionNumberin interfaceVersioned
-
build
Builds an instance of a Action based on the current state of the builder.- Specified by:
buildin interfaceModelBuilder- Returns:
- the fully-constructed Action
-