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, 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, Set<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 getId()
           
 Set<TermParameterDefinition.Builder> getParameters()
           
 TermSpecificationDefinition.Builder getSpecification()
           
 void setId(String id)
           
 void setParameters(Set<TermParameterDefinition.Builder> parameters)
           
 void setSpecification(TermSpecificationDefinition.Builder termSpecification)
           
 
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,
                                            Set<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.

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(Set<TermParameterDefinition.Builder> parameters)
Parameters:
parameters - the termParameters to set. May be null, or empty.

getId

public String getId()
Specified by:
getId in interface TermDefinitionContract
Returns:
the id

getSpecification

public TermSpecificationDefinition.Builder getSpecification()
Specified by:
getSpecification in interface TermDefinitionContract
Returns:
the termSpecification

getParameters

public Set<TermParameterDefinition.Builder> getParameters()
Specified by:
getParameters in interface TermDefinitionContract
Returns:
the termParameters

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 © 2004-2011 The Kuali Foundation. All Rights Reserved.