org.kuali.rice.krms.api.repository.function
Class FunctionParameterDefinition.Builder

java.lang.Object
  extended by org.kuali.rice.krms.api.repository.function.FunctionParameterDefinition.Builder
All Implemented Interfaces:
Serializable, Identifiable, Versioned, ModelBuilder, FunctionParameterDefinitionContract
Enclosing class:
FunctionParameterDefinition

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

A builder which can be used to construct FunctionParameterDefinition instances. Enforces the constraints of the FunctionParameterDefinitionContract.

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
Serialized Form

Method Summary
 FunctionParameterDefinition build()
          Returns an instance of the object being built by this builder based on the current state of the builder.
static FunctionParameterDefinition.Builder create(FunctionParameterDefinitionContract contract)
          Creates and populates a builder with the data on the given FunctionParameterDefinitionContract.
static FunctionParameterDefinition.Builder create(String name, String type, Integer sequenceNumber)
          Creates a function parameter definition builder with the given required values.
 String getDescription()
          Returns the description of this parameter.
 String getFunctionId()
          Returns the ID of the function to which this parameter is associated.
 String getId()
          The unique identifier for an object.
 String getName()
          Returns the name of this parameters.
 String getParameterType()
          Returns the type of this function parameter.
 Integer getSequenceNumber()
          This is the sequence number of the function parameter.
 Long getVersionNumber()
          Returns the version number for this object.
 void setDescription(String description)
          Sets the description for the function parameter definition that will be returned by this builder.
 void setFunctionId(String functionId)
          Sets the type for the function id If provided, the function id must be non-blank.
 void setId(String id)
          Sets the id for the function parameter definition that will be returned by this builder.
 void setName(String name)
          Sets the name for the function parameter definition that will be returned by this builder.
 void setParameterType(String type)
          Sets the type for the function parameter definition that will be returned by this builder.
 void setSequenceNumber(Integer sequenceNumber)
          Sets the sequence number for the function parameter definition that will be returned by this builder.
 void setVersionNumber(Long versionNumber)
          Sets the version number for the function parameter definition that will be returned by this builder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static FunctionParameterDefinition.Builder create(String name,
                                                         String type,
                                                         Integer sequenceNumber)
Creates a function parameter definition builder with the given required values. This builder is the only means by which a FunctionParameterDefinition object should be created.

Parameters:
name - the name of the function parameter definition to create, must not be null or blank
type - the type of the function parameter definition to create, must not be null or blank
Returns:
a builder with the required values already initialized
Throws:
IllegalArgumentException - if any of the given arguments is null or blank

create

public static FunctionParameterDefinition.Builder create(FunctionParameterDefinitionContract contract)
Creates and populates a builder with the data on the given FunctionParameterDefinitionContract. This is similar in nature to a "copy constructor" for FunctionParameterDefinition.

Parameters:
contract - an object implementing the FunctionParameterDefinitionContract from which to copy property values
Returns:
a builder with the values from the contract already initialized
Throws:
IllegalArgumentException - if the given contract is null

build

public FunctionParameterDefinition 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

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

setId

public void setId(String id)
Sets the id for the function parameter definition that will be returned by this builder.

Parameters:
id - the function parameter definition id to set

getName

public String getName()
Description copied from interface: FunctionParameterDefinitionContract
Returns the name of this parameters. All parameters have a name and this value can never be null or blank. The parameter name must be unique within a given function definition.

Specified by:
getName in interface FunctionParameterDefinitionContract
Returns:
the name of this function parameter definition

setName

public void setName(String name)
Sets the name for the function parameter definition that will be returned by this builder. The name must not be null or blank.

Parameters:
name - the name to set on this builder, must not be null or blank

getDescription

public String getDescription()
Description copied from interface: FunctionParameterDefinitionContract
Returns the description of this parameter. The description is intended to provide more information about a parameter and it's appropriate usage. The description is optional and will be null if a description is not defined.

Specified by:
getDescription in interface FunctionParameterDefinitionContract
Returns:
the description of this function parameter definition, or null if this parameter has no description

setDescription

public void setDescription(String description)
Sets the description for the function parameter definition that will be returned by this builder.

Parameters:
description - the description to set on this builder

getParameterType

public String getParameterType()
Description copied from interface: FunctionParameterDefinitionContract
Returns the type of this function parameter. This can be one of a set of "built-in" data types or a custom data type represented as a fully qualified java class name. All parameters must have a valid type so this method should never return null or blank.

Specified by:
getParameterType in interface FunctionParameterDefinitionContract
Returns:
the type of this function parameter definition

setParameterType

public void setParameterType(String type)
Sets the type for the function parameter definition that will be returned by this builder. This can be one of a set of "built-in" data types or a custom datatype represented as a fully qualified java class name. The type must not be null or blank.

Parameters:
type - the type to set on this builder, must not be null or blank

getFunctionId

public String getFunctionId()
Description copied from interface: FunctionParameterDefinitionContract
Returns the ID of the function to which this parameter is associated.

Specified by:
getFunctionId in interface FunctionParameterDefinitionContract
Returns:
the ID of the corresponding function

setFunctionId

public void setFunctionId(String functionId)
Sets the type for the function id If provided, the function id must be non-blank. Must allow id to be null, to prevent chicken/egg problems.

Parameters:
functionId - the functionId to set on this builder, must be either null or non-blank

getSequenceNumber

public Integer getSequenceNumber()
Description copied from interface: FunctionParameterDefinitionContract
This is the sequence number of the function parameter. The sequence number identifies the position of the parameter in the function list.

Specified by:
getSequenceNumber in interface FunctionParameterDefinitionContract
Returns:
the sequence number of the function parameter

setSequenceNumber

public void setSequenceNumber(Integer sequenceNumber)
Sets the sequence number for the function parameter definition that will be returned by this builder. This is the position in the functions parameter list.

Parameters:
sequenceNumber - the position of the parameter in the function parameter list

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

setVersionNumber

public void setVersionNumber(Long versionNumber)
Sets the version number for the function parameter definition that will be returned by this builder.

In general, this value should not be manually set on the builder, but rather copied from an existing FunctionParameterDefinitionContract when invoking create(FunctionParameterDefinitionContract).

Parameters:
versionNumber - the version number to set


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