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

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

public static class TermSpecificationDefinition.Builder
extends Object
implements TermSpecificationDefinitionContract, ModelBuilder, Serializable

Builder for the TermSpecificationDefinition immutable DTO. Instantiate using static factory method(s).

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

Field Summary
static BuilderUtils.Transformer<TermSpecificationDefinitionContract,TermSpecificationDefinition.Builder> toBuilder
          BuilderUtils.Transformer to ease converting lists to Builder types
 
Method Summary
 TermSpecificationDefinition build()
          Constructs a TermSpecificationDefinition
static TermSpecificationDefinition.Builder create(String termSpecificationId, String name, String namespace, String type)
          static factory for a TermSpecificationDefinition.Builder from a complete set of field values for this object.
static TermSpecificationDefinition.Builder create(TermSpecificationDefinitionContract termSpecification)
          static factory for a TermSpecificationDefinition.Builder from a TermSpecificationDefinitionContract.
 List<CategoryDefinition.Builder> getCategories()
          Returns an ordered, immutable list of the categories which this term specification definition requires.
 String getDescription()
           
 String getId()
          The unique identifier for an object.
 String getName()
           
 String getNamespace()
          This is the namespace of the TermSpecificationDefinitionContract
 String getType()
           
 Long getVersionNumber()
          Returns the version number for this object.
 void setCategories(List<CategoryDefinition.Builder> categories)
           
 void setDescription(String description)
           
 void setId(String termSpecificationId)
           
 void setName(String name)
           
 void setNamespace(String namespace)
           
 void setType(String type)
           
 void setVersionNumber(Long versionNumber)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

toBuilder

public static final BuilderUtils.Transformer<TermSpecificationDefinitionContract,TermSpecificationDefinition.Builder> toBuilder
BuilderUtils.Transformer to ease converting lists to Builder types

Method Detail

create

public static TermSpecificationDefinition.Builder create(String termSpecificationId,
                                                         String name,
                                                         String namespace,
                                                         String type)
static factory for a TermSpecificationDefinition.Builder from a complete set of field values for this object.

Parameters:
termSpecificationId - the primary key field. Must be null for service methods that create TermSpecificationDefinitionContracts, and must be non-null & contain non-whitespace chars otherwise.
name - the name for the TermSpecificationDefinition. Must be non-null;.
namespace - the namespace for the TermSpecificationDefinition. Must be non-null & contain non-whitespace.
type - the type for the TermSpecificationDefinition @return a TermSpecificationDefinition.Builder object
Throws:
IllegalArgumentException - if invalid parameters are supplied.

create

public static TermSpecificationDefinition.Builder create(TermSpecificationDefinitionContract termSpecification)
static factory for a TermSpecificationDefinition.Builder from a TermSpecificationDefinitionContract.

Parameters:
termSpecification - may not be null;
Throws:
IllegalArgumentException - if termSpecification is null, or violates the field invariants of the TermSpecificationDefinition.Builder.

setDescription

public void setDescription(String description)

setId

public void setId(String termSpecificationId)
Parameters:
termSpecificationId - the key for this TermSpecificationDefinition. Must be null for service methods that create TermSpecificationDefinitionContracts, and otherwise must be non-null & contain non-whitespace chars.

setNamespace

public void setNamespace(String namespace)
Parameters:
namespace - the namespace to set. Must be non-null and contain non-whitespace chars;

setName

public void setName(String name)
Parameters:
name - the name to set. Must be non-null and contain non-whitespace chars;

setType

public void setType(String type)
Parameters:
type - the type to set. Must be non-null and contain non-whitespace chars;

setVersionNumber

public void setVersionNumber(Long versionNumber)
Parameters:
versionNumber - the versionNumber to set. May be null.

setCategories

public void setCategories(List<CategoryDefinition.Builder> categories)
Parameters:
categories - the categories to set. May not be null but can be an empty 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 termSpecificationId

getNamespace

public String getNamespace()
Description copied from interface: TermSpecificationDefinitionContract
This is the namespace of the TermSpecificationDefinitionContract

The namespace of the TermSpecificationDefinitionContract

Specified by:
getNamespace in interface TermSpecificationDefinitionContract
Returns:
the namespace

getName

public String getName()
Specified by:
getName in interface TermSpecificationDefinitionContract
Returns:
the name

getType

public String getType()
Specified by:
getType in interface TermSpecificationDefinitionContract
Returns:
the type

getDescription

public String getDescription()
Specified by:
getDescription in interface TermSpecificationDefinitionContract
Returns:
the description for this TermSpecificationDefinitionContract

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

getCategories

public List<CategoryDefinition.Builder> getCategories()
Description copied from interface: TermSpecificationDefinitionContract
Returns an ordered, immutable list of the categories which this term specification definition requires. This list can be empty (in the case of a term which has no arguments) but will never be null.

Specified by:
getCategories in interface TermSpecificationDefinitionContract
Returns:
the categories

build

public TermSpecificationDefinition build()
Constructs a TermSpecificationDefinition

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


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.