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
private  List<CategoryDefinition.Builder> categories
           
private  String contextId
           
private  String name
           
private static String NON_NULL_NON_EMPTY_ERROR
           
private static long serialVersionUID
           
private  String termSpecificationId
           
static BuilderUtils.Transformer<TermSpecificationDefinitionContract,TermSpecificationDefinition.Builder> toBuilder
          BuilderUtils.Transformer to ease converting lists to Builder types
private  String type
           
private  Long versionNumber
           
 
Constructor Summary
private TermSpecificationDefinition.Builder(String termSpecificationId, String contextId, String name, String type)
           
 
Method Summary
 TermSpecificationDefinition build()
          Constructs a TermSpecificationDefinition
static TermSpecificationDefinition.Builder create(String termSpecificationId, String contextId, String name, 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 getContextId()
           
 String getId()
          The unique identifier for an object.
 String getName()
           
 String getType()
           
 Long getVersionNumber()
          Returns the version number for this object.
 void setCategories(List<CategoryDefinition.Builder> categories)
           
 void setContextId(String contextId)
           
 void setId(String termSpecificationId)
           
 void setName(String name)
           
 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

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

termSpecificationId

private String termSpecificationId

contextId

private String contextId

name

private String name

type

private String type

versionNumber

private Long versionNumber

categories

private List<CategoryDefinition.Builder> categories

NON_NULL_NON_EMPTY_ERROR

private static final String NON_NULL_NON_EMPTY_ERROR
See Also:
Constant Field Values

toBuilder

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

Constructor Detail

TermSpecificationDefinition.Builder

private TermSpecificationDefinition.Builder(String termSpecificationId,
                                            String contextId,
                                            String name,
                                            String type)
Method Detail

create

public static TermSpecificationDefinition.Builder create(String termSpecificationId,
                                                         String contextId,
                                                         String name,
                                                         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.
contextId - key relates the TermSpecificationDefinition to a context.
name - the name for the TermSpecificationDefinition. Must be non-null;.
type - the type for the TermSpecificationDefinition
Returns:
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.

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.

setContextId

public void setContextId(String contextId)
Parameters:
contextId - the contextId 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

getContextId

public String getContextId()
Specified by:
getContextId in interface TermSpecificationDefinitionContract
Returns:
the contextId

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

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.