org.kuali.rice.kew.api.document.attribute
Class WorkflowAttributeDefinition.Builder

java.lang.Object
  extended by org.kuali.rice.kew.api.document.attribute.WorkflowAttributeDefinition.Builder
All Implemented Interfaces:
Serializable, ModelBuilder
Enclosing class:
WorkflowAttributeDefinition

public static final class WorkflowAttributeDefinition.Builder
extends Object
implements Serializable, ModelBuilder

A builder which can be used to construct instances of WorkflowAttributeDefinition.

See Also:
Serialized Form

Method Summary
 void addParameter(String parameter)
          Adds a parameter to the list of parameters maintained by this builder.
 void addPropertyDefinition(PropertyDefinition propertyDefinition)
          Adds the given property definition to the list of property definitions maintained by this builder.
 void addPropertyDefinition(String name, String value)
          Add a property definition constructed from the given name and value to the list of property definitions on this builder.
 WorkflowAttributeDefinition build()
          Returns an instance of the object being built by this builder based on the current state of the builder.
static WorkflowAttributeDefinition.Builder create(String attributeName)
          Constructs a builder which is initialized with the given attribute name.
static WorkflowAttributeDefinition.Builder create(WorkflowAttributeDefinition definition)
          Creates a new builder copying the properties from the given definition into it.
 String getAttributeName()
          Returns the attribute name that is set on this builder.
 List<String> getParameters()
          Returns a list of string parameters that have been set on this builder.
 PropertyDefinition getPropertyDefinition(String name)
          Returns the property definition on this build which has the given name if it exists.
 List<PropertyDefinition> getPropertyDefinitions()
          Returns a list of PropertyDefinition objects that have been set on this builder.
 void removeParameter(String parameter)
          Removes a parameter with the given value from the list of parameters maintained by this builder.
 void setAttributeName(String attributeName)
          Sets the attribute name on this builder to the given value.
 void setParameters(List<String> parameters)
          Sets the list of parameters on this builder.
 void setPropertyDefinitions(List<PropertyDefinition> propertyDefinitions)
          Sets the list of property definitions maintained by this build to the given list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static WorkflowAttributeDefinition.Builder create(WorkflowAttributeDefinition definition)
Creates a new builder copying the properties from the given definition into it.

Parameters:
definition - the definition from which to copy properties
Returns:
a builder initialized with the properties copied from the given definition

create

public static WorkflowAttributeDefinition.Builder create(String attributeName)
Constructs a builder which is initialized with the given attribute name.

Parameters:
attributeName - the attribute name to use when initializing this builder, cannot be a null or empty value
Returns:
an instance of a builder initialized with the given attribute name
Throws:
IllegalArgumentException - if attributeName is a null or blank value

build

public WorkflowAttributeDefinition build()
Description copied from interface: ModelBuilder
Returns an instance of the object being built by this builder based on the current state of the builder. It should be possible to invoke this method more than once on the same builder. It should never return null;

Specified by:
build in interface ModelBuilder
Returns:
an instance of the object being built by this builder, should never return null

getAttributeName

public String getAttributeName()
Returns the attribute name that is set on this builder.

Returns:
the attribute name this is set on this builder

getParameters

public List<String> getParameters()
Returns a list of string parameters that have been set on this builder.

Returns:
a list of string parameters that have been set on this builder

getPropertyDefinitions

public List<PropertyDefinition> getPropertyDefinitions()
Returns a list of PropertyDefinition objects that have been set on this builder.

Returns:
a list of property definitions that have been set on this builder

setAttributeName

public void setAttributeName(String attributeName)
Sets the attribute name on this builder to the given value. Must not be a null or blank value.

Parameters:
attributeName - the value of the attributeName to set
Throws:
IllegalArgumentException - if attributeName is a null or blank value

addParameter

public void addParameter(String parameter)
Adds a parameter to the list of parameters maintained by this builder.

Parameters:
parameter - the parameter value to add

removeParameter

public void removeParameter(String parameter)
Removes a parameter with the given value from the list of parameters maintained by this builder.

Parameters:
parameter - the parameter value to remove

setParameters

public void setParameters(List<String> parameters)
Sets the list of parameters on this builder.

Parameters:
parameters - the list of parameters to set

addPropertyDefinition

public void addPropertyDefinition(PropertyDefinition propertyDefinition)
Adds the given property definition to the list of property definitions maintained by this builder.

Parameters:
propertyDefinition - the property definition to set, should not be null
Throws:
IllegalArgumentException - if the given property definition is null

setPropertyDefinitions

public void setPropertyDefinitions(List<PropertyDefinition> propertyDefinitions)
Sets the list of property definitions maintained by this build to the given list.

Parameters:
propertyDefinitions - the list of property definitions to set

addPropertyDefinition

public void addPropertyDefinition(String name,
                                  String value)
Add a property definition constructed from the given name and value to the list of property definitions on this builder.

Parameters:
name - name of the property definition to add, must not be a null or blank value
value - value of the property definition to add
Throws:
IllegalArgumentException - if the given name is a null or blank value

getPropertyDefinition

public PropertyDefinition getPropertyDefinition(String name)
Returns the property definition on this build which has the given name if it exists. This method will return a null value if a definition with the given name cannot be found.

Parameters:
name - the name of the property definition to retrieve
Returns:
the property definition with the given name, or null if no such property definition is found
Throws:
IllegalArgumentException - if the given name is a null or blank value


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