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, Inactivatable, 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()
          Gets an ordered list of the categories which this term specification definition belongs to.
 List<String> getContextIds()
          Gets a list of the IDs for the contexts this TermSpecification can be used in.
 String getDescription()
          Gets the description for this term specification, which will typically be a suitable description for any term having this specification as well.
 String getId()
          The unique identifier for an object.
 String getName()
          Gets the name for this TermSpecificationDefinitionContract.
 String getNamespace()
          Gets the namespace of this TermSpecificationDefinitionContract.
 String getType()
          Gets the fully qualified class name for the values of any term having this specification.
 Long getVersionNumber()
          Returns the version number for this object.
 boolean isActive()
          The active indicator for an object.
 void setActive(boolean active)
           
 void setCategories(List<CategoryDefinition.Builder> categories)
           
 void setContextIds(List<String> contextIds)
           
 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.

setActive

public void setActive(boolean active)

setCategories

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

setContextIds

public void setContextIds(List<String> contextIds)
Parameters:
contextIds - the contextIds to set. May not be null but may be empty.

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
Gets the namespace of this TermSpecificationDefinitionContract. Will not be null or empty.

Specified by:
getNamespace in interface TermSpecificationDefinitionContract
Returns:
the namespace

getName

public String getName()
Description copied from interface: TermSpecificationDefinitionContract
Gets the name for this TermSpecificationDefinitionContract. This is an important key that must be unique within a namespace, and is used to determine how to resolve any terms having this specification. Will not be null or empty.

Specified by:
getName in interface TermSpecificationDefinitionContract
Returns:
the name

getType

public String getType()
Description copied from interface: TermSpecificationDefinitionContract
Gets the fully qualified class name for the values of any term having this specification. E.g. if the type of the fact values for the "total dollar amount of a grant" term was BigDecimal, then the term specification's type would be the String "java.math.BigDecimal". Will never return null or the empty string.

Specified by:
getType in interface TermSpecificationDefinitionContract
Returns:
the type

getDescription

public String getDescription()
Description copied from interface: TermSpecificationDefinitionContract
Gets the description for this term specification, which will typically be a suitable description for any term having this specification as well. May return null if no description is specified for the term specification.

Specified by:
getDescription in interface TermSpecificationDefinitionContract
Returns:
the description for this term specification.

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

isActive

public boolean isActive()
Description copied from interface: Inactivatable
The active indicator for an object.

Specified by:
isActive in interface Inactivatable
Returns:
true if active false if not.

getCategories

public List<CategoryDefinition.Builder> getCategories()
Description copied from interface: TermSpecificationDefinitionContract
Gets an ordered list of the categories which this term specification definition belongs to. This list can be empty but will never be null.

Specified by:
getCategories in interface TermSpecificationDefinitionContract
Returns:
the categories

getContextIds

public List<String> getContextIds()
Description copied from interface: TermSpecificationDefinitionContract
Gets a list of the IDs for the contexts this TermSpecification can be used in.

Specified by:
getContextIds in interface TermSpecificationDefinitionContract
Returns:
the list of contexts for this term specification definition

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