org.kuali.rice.krms.api.repository.action
Class ActionDefinition.Builder

java.lang.Object
  extended by 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:
Serialized Form

Method Summary
 ActionDefinition build()
          Builds an instance of a Action based on the current state of the builder.
static ActionDefinition.Builder create(ActionDefinitionContract contract)
          Creates a builder by populating it with data from the given ActionDefinitionContract.
static ActionDefinition.Builder create(String actionId, String name, String namespace, String typeId, String ruleId, Integer sequenceNumber)
          Create a builder with the given parameters
 Map<String,String> getAttributes()
          Returns a set of attributes associated with the Action.
 String getDescription()
          Returns the description for what the parameter is used for.
 String getId()
          The unique identifier for an object.
 String getName()
          Returns the name of the Action
 String getNamespace()
          Returns the namespace of the Action
 String getRuleId()
          Returns the id of the rule associated with the action
 Integer getSequenceNumber()
          Returns the sequence number of the action
 String getTypeId()
          Returns the KrmsType of the Action
 Long getVersionNumber()
          Returns the version number for this object.
 void setAttributes(Map<String,String> attributes)
          Sets the value of the attributes on this builder to the given value.
 void setDescription(String desc)
          Sets the value of the description on this builder to the given value.
 void setId(String actionId)
          Sets the value of the id on this builder to the given value.
 void setName(String name)
          Sets the value of the name on this builder to the given value.
 void setNamespace(String namespace)
          Sets the value of the namespace on this builder to the given value.
 void setRuleId(String ruleId)
          Sets the value of the ruleId on this builder to the given value.
 void setSequenceNumber(Integer sequenceNumber)
          Sets the value of the sequenceNumber on this builder to the given value.
 void setTypeId(String typeId)
          Sets the value of the typeId on this builder to the given value.
 void setVersionNumber(Long versionNumber)
          Sets the value of the versionNumber on this builder to the given value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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 blank
name - the name value to set, must not be null or blank
namespace - the namespace value to set, must not be null or blank
typeId - the typeId value to set
ruleId - the ruleId value to set, must not be null or blank
sequenceNumber - the sequenceNumber value to set, must not be null or blank
Returns:
an instance of the builder populated with given data

create

public static ActionDefinition.Builder create(ActionDefinitionContract contract)
Creates a builder by populating it with data from the given ActionDefinitionContract.

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

public void setId(String actionId)
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

public void setName(String name)
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

public void setNamespace(String namespace)
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

public void setDescription(String desc)
Sets the value of the description on this builder to the given value.

Parameters:
desc - the description value to set

setTypeId

public void setTypeId(String typeId)
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

public void setRuleId(String ruleId)
Sets the value of the ruleId on this builder to the given value.

Parameters:
ruleId - the ruleId value to set, must not be null or blank
Throws:
IllegalArgumentException - if the ruleId is null or blank

setSequenceNumber

public void setSequenceNumber(Integer sequenceNumber)
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

public void setAttributes(Map<String,String> attributes)
Sets the value of the attributes on this builder to the given value.

Parameters:
attributes - the attributes value to set, can be null

setVersionNumber

public void setVersionNumber(Long versionNumber)
Sets the value of the versionNumber on this builder to the given value.

Parameters:
versionNumber - the versionNumber value to set

getId

public String getId()
Description copied from interface: Identifiable
The unique identifier for an object. This can be null.

Specified by:
getId in interface Identifiable
Returns:
the id

getName

public String getName()
Description copied from interface: ActionDefinitionContract
Returns the name of the Action

name - the name of the Action

Specified by:
getName in interface ActionDefinitionContract
Returns:
the name of the Action

getNamespace

public String getNamespace()
Description copied from interface: ActionDefinitionContract
Returns the namespace of the Action

The namespace of the Action

Specified by:
getNamespace in interface ActionDefinitionContract
Returns:
the namespace of the Action

getDescription

public String getDescription()
Description copied from interface: ActionDefinitionContract
Returns the description for what the parameter is used for. This can be null or a blank string.

Specified by:
getDescription in interface ActionDefinitionContract
Returns:
the description of the Action

getTypeId

public String getTypeId()
Description copied from interface: ActionDefinitionContract
Returns the KrmsType of the Action

Specified by:
getTypeId in interface ActionDefinitionContract
Returns:
id for KRMS type related of the Action

getRuleId

public String getRuleId()
Description copied from interface: ActionDefinitionContract
Returns the id of the rule associated with the action

Specified by:
getRuleId in interface ActionDefinitionContract
Returns:
id for the Rule associated with the action.

getSequenceNumber

public Integer getSequenceNumber()
Description copied from interface: ActionDefinitionContract
Returns the sequence number of the action

Specified by:
getSequenceNumber in interface ActionDefinitionContract
Returns:
sequence number of the action.

getAttributes

public Map<String,String> getAttributes()
Description copied from interface: ActionDefinitionContract
Returns a set of attributes associated with the Action. The attributes are represented as name/value pairs.

Specified by:
getAttributes in interface ActionDefinitionContract
Returns:
a set of ActionAttribute objects.

getVersionNumber

public Long getVersionNumber()
Description copied from interface: Versioned
Returns the version number for this object. In general, this value should only be null if the object has not yet been stored to a persistent data store. This version number is generally used for the purposes of optimistic locking.

Specified by:
getVersionNumber in interface Versioned
Returns:
the version number, or null if one has not been assigned yet

build

public ActionDefinition build()
Builds an instance of a Action based on the current state of the builder.

Specified by:
build in interface ModelBuilder
Returns:
the fully-constructed Action


Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.