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 Details

    • 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()
      Specified by:
      getId in interface org.kuali.rice.core.api.mo.common.Identifiable
    • 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()
      Specified by:
      getVersionNumber in interface org.kuali.rice.core.api.mo.common.Versioned
    • build

      public CategoryDefinition build()
      Builds an instance of a CategoryDefinition based on the current state of the builder.
      Specified by:
      build in interface org.kuali.rice.core.api.mo.ModelBuilder
      Returns:
      the fully-constructed CampusType