org.kuali.rice.krms.api.repository.term
Class TermDefinition.Builder

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

public static class TermDefinition.Builder
extends Object
implements TermDefinitionContract, ModelBuilder, Serializable

ModelBuilder for TermDefinitions.

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

Method Summary
 TermDefinition build()
          Builds the TermDefinition, or dies trying.
static TermDefinition.Builder create(String id, TermSpecificationDefinition.Builder termSpecification, List<TermParameterDefinition.Builder> termParameters)
          static factory for creating a TermDefinition.Builder.
static TermDefinition.Builder create(TermDefinitionContract term)
          static factory for creating a TermDefinition.Builder from a TermDefinitionContract.
 String getDescription()
          Get the description for this TermDefinitionContract.
 String getId()
          The unique identifier for an object.
 List<TermParameterDefinition.Builder> getParameters()
          Get any parameters specified on this TermDefinitionContract.
 TermSpecificationDefinition.Builder getSpecification()
          Get the associated TermSpecificationDefinitionContract which specifies some important details about the term.
 Long getVersionNumber()
          Returns the version number for this object.
 void setDescription(String description)
           
 void setId(String id)
           
 void setParameters(List<TermParameterDefinition.Builder> parameters)
           
 void setSpecification(TermSpecificationDefinition.Builder termSpecification)
           
 void setVersionNumber(Long versionNumber)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static TermDefinition.Builder create(String id,
                                            TermSpecificationDefinition.Builder termSpecification,
                                            List<TermParameterDefinition.Builder> termParameters)
static factory for creating a TermDefinition.Builder.

Parameters:
id - may be null.
termSpecification - must not be null.
termParameters - may be null.

create

public static TermDefinition.Builder create(TermDefinitionContract term)
static factory for creating a TermDefinition.Builder from a TermDefinitionContract.

Parameters:
term - must be non-null.

setDescription

public void setDescription(String description)

setId

public void setId(String id)
Parameters:
id - the id to set. Should be null to build TermDefinitions for creation operations.
Throws:
IllegalArgumentException - if the id is non-null and only contains whitespace

setSpecification

public void setSpecification(TermSpecificationDefinition.Builder termSpecification)
Parameters:
termSpecification - the termSpecification to set
Throws:
IllegalArgumentException - if termSpecification is null

setParameters

public void setParameters(List<TermParameterDefinition.Builder> parameters)
Parameters:
parameters - the termParameters to set. May be null, or empty.

setVersionNumber

public void setVersionNumber(Long versionNumber)
Parameters:
versionNumber - the versionNumber to set. May be 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

getSpecification

public TermSpecificationDefinition.Builder getSpecification()
Description copied from interface: TermDefinitionContract
Get the associated TermSpecificationDefinitionContract which specifies some important details about the term. Will not be null.

Specified by:
getSpecification in interface TermDefinitionContract
Returns:
the termSpecification

getDescription

public String getDescription()
Description copied from interface: TermDefinitionContract
Get the description for this TermDefinitionContract. May be null.

Specified by:
getDescription in interface TermDefinitionContract
Returns:
the description

getParameters

public List<TermParameterDefinition.Builder> getParameters()
Description copied from interface: TermDefinitionContract
Get any parameters specified on this TermDefinitionContract. May be empty, but never null.

Specified by:
getParameters in interface TermDefinitionContract
Returns:
the termParameters

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

build

public TermDefinition build()
Builds the TermDefinition, or dies trying.

Specified by:
build in interface ModelBuilder
Returns:
an instance of the object being built by this builder, should never return null
Throws:
IllegalStateException - if builder validation fails
See Also:
ModelBuilder.build()


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