org.kuali.rice.krms.api.repository.category
Class CategoryDefinition.Builder

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

public static class CategoryDefinition.Builder
extends Object
implements CategoryDefinitionContract, ModelBuilder, Serializable

This builder is used to construct instances of CategoryDefinition. It enforces the constraints of the CategoryDefinitionContract.

See Also:
Serialized Form

Method Summary
 CategoryDefinition build()
          Builds an instance of a CategoryDefinition based on the current state of the builder.
static CategoryDefinition.Builder create(CategoryDefinitionContract category)
          Creates a builder by populating it with data from the given CategoryDefinition.
static CategoryDefinition.Builder create(String id, String name, String namespace)
          Creates a builder from the given parameters.
 String getId()
          The unique identifier for an object.
 String getName()
          Returns the name of the category definition.
 String getNamespace()
          Returns the namespace of the category definition.
 Long getVersionNumber()
          Returns the version number for this object.
 void setId(String id)
          Sets the value of the id on this builder to the given value.
 void setName(String name)
          Sets the name for the category definition that will be returned by this builder.
 void setNamespace(String namespace)
          Sets the namespace code for the category definition that will be returned by this builder.
 void setVersionNumber(Long versionNumber)
          Sets the version number on this builder to the given value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static CategoryDefinition.Builder create(String id,
                                                String name,
                                                String namespace)
Creates a builder from the given parameters.

Parameters:
id - the CategoryDefinition id
name - the CategoryDefinition name
namespace - the CategoryDefinition namespace
Returns:
an instance of the builder with the fields already populated
Throws:
IllegalArgumentException - if the either the id, name or namespace is null or blank

create

public static CategoryDefinition.Builder create(CategoryDefinitionContract category)
Creates a builder by populating it with data from the given CategoryDefinition.

Parameters:
category - the category from which to populate this builder
Returns:
an instance of the builder populated with data from the contract

setId

public void setId(String id)
Sets the value of the id on this builder to the given value.

Parameters:
id - the id value to set, must be null or non-blank
Throws:
IllegalArgumentException - if the id is non-null and blank

setName

public void setName(String name)
Sets the name for the category definition that will be returned by this builder. The name must not be null or blank.

Parameters:
name - the name to set on this builder, must not be null or blank
Throws:
IllegalArgumentException - if the given name is null or blank

setNamespace

public void setNamespace(String namespace)
Sets the namespace code for the category definition that will be returned by this builder. The namespace must not be null or blank.

Parameters:
namespace - the namespace code to set on this builder, must not be null or blank
Throws:
IllegalArgumentException - if the given namespace is null or blank

setVersionNumber

public void setVersionNumber(Long versionNumber)
Sets the version number on this builder to the given value.

Parameters:
versionNumber - the version number to 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 id

getName

public String getName()
Description copied from interface: CategoryDefinitionContract
Returns the name of the category definition. The combination of name and namespaceCode represent a unique business key for the category definition. The name should never be null or blank.

Specified by:
getName in interface CategoryDefinitionContract
Returns:
the name of the category definition, should never be null or blank

getNamespace

public String getNamespace()
Description copied from interface: CategoryDefinitionContract
Returns the namespace of the category definition. The combination of namespace and name represent a unique business key for the category definition. The namespace should never be null or blank.

Specified by:
getNamespace in interface CategoryDefinitionContract
Returns:
the namespace of the category definition, should never be null or blank

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, or null if one has not been assigned yet

build

public CategoryDefinition build()
Builds an instance of a CategoryDefinition based on the current state of the builder.

Specified by:
build in interface ModelBuilder
Returns:
the fully-constructed CampusType


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