Class CategoryDefinition.Builder
java.lang.Object
org.kuali.rice.krms.api.repository.category.CategoryDefinition.Builder
- All Implemented Interfaces:
Serializable,org.kuali.rice.core.api.mo.common.Identifiable,org.kuali.rice.core.api.mo.common.Versioned,org.kuali.rice.core.api.mo.ModelBuilder,CategoryDefinitionContract
- Enclosing class:
CategoryDefinition
public static class CategoryDefinition.Builder
extends Object
implements CategoryDefinitionContract, org.kuali.rice.core.api.mo.ModelBuilder, Serializable
This builder is used to construct instances of CategoryDefinition. It enforces the constraints of the
CategoryDefinitionContract.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds an instance of a CategoryDefinition based on the current state of the builder.static CategoryDefinition.BuilderCreates a builder from the given parameters.static CategoryDefinition.Buildercreate(CategoryDefinitionContract category) Creates a builder by populating it with data from the givenCategoryDefinition.getId()getName()Returns the name of the category definition.Returns the namespace of the category definition.voidSets the value of the id on this builder to the given value.voidSets the name for the category definition that will be returned by this builder.voidsetNamespace(String namespace) Sets the namespace code for the category definition that will be returned by this builder.voidsetVersionNumber(Long versionNumber) Sets the version number on this builder to the given value.
-
Method Details
-
create
Creates a builder from the given parameters.- Parameters:
id- the CategoryDefinition idname- the CategoryDefinition namenamespace- 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
Creates a builder by populating it with data from the givenCategoryDefinition.- Parameters:
category- the category from which to populate this builder- Returns:
- an instance of the builder populated with data from the contract
-
setId
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
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
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
Sets the version number on this builder to the given value.- Parameters:
versionNumber- the version number to set
-
getId
- Specified by:
getIdin interfaceorg.kuali.rice.core.api.mo.common.Identifiable
-
getName
Description copied from interface:CategoryDefinitionContractReturns 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:
getNamein interfaceCategoryDefinitionContract- Returns:
- the name of the category definition, should never be null or blank
-
getNamespace
Description copied from interface:CategoryDefinitionContractReturns 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:
getNamespacein interfaceCategoryDefinitionContract- Returns:
- the namespace of the category definition, should never be null or blank
-
getVersionNumber
- Specified by:
getVersionNumberin interfaceorg.kuali.rice.core.api.mo.common.Versioned
-
build
Builds an instance of a CategoryDefinition based on the current state of the builder.- Specified by:
buildin interfaceorg.kuali.rice.core.api.mo.ModelBuilder- Returns:
- the fully-constructed CampusType
-