Class BaseAttribute.Builder

java.lang.Object
org.kuali.rice.krms.api.repository.BaseAttribute.Builder
All Implemented Interfaces:
Serializable, org.kuali.rice.core.api.mo.common.Identifiable, org.kuali.rice.core.api.mo.ModelBuilder, BaseAttributeContract
Enclosing class:
BaseAttribute

public abstract static class BaseAttribute.Builder extends Object implements BaseAttributeContract, org.kuali.rice.core.api.mo.ModelBuilder, Serializable
This builder is used to construct the fields that BaseAttribute is responsible for. It is abstract, and intended to be subclassed by extenders of BaseAttribute.
See Also:
  • Constructor Details

    • Builder

      protected Builder(String id, String attributeDefinitionId, String value)
      Private constructor for creating a builder with all of it's required attributes.
    • Builder

      protected Builder(BaseAttributeContract attr)
  • Method Details

    • 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, may be null if attribute has not yet been stored in the repository
    • setAttributeDefinitionId

      public void setAttributeDefinitionId(String attributeDefinitionId)
      Sets the attibuteDefinitionId value.
      Parameters:
      attributeDefinitionId - ; must not be null or blank
      Throws:
      IllegalArgumentException - if the id is null or blank
    • setValue

      public void setValue(String value)
      Sets the value of the attribute
      Parameters:
      value - a String representing the value of the attribute
    • setAttributeDefinition

      public void setAttributeDefinition(KrmsAttributeDefinition.Builder attributeDefinition)
      Sets the attributeDefinition object related to the attribute.
      Parameters:
      attributeDefinition - the attribute definition
    • getId

      public String getId()
      Specified by:
      getId in interface org.kuali.rice.core.api.mo.common.Identifiable
    • getAttributeDefinitionId

      public String getAttributeDefinitionId()
      Description copied from interface: BaseAttributeContract
      Returns the id of the attribute definition.

      The attribute definition contains metadata about the attribute. This is a required field and may not be null or blank. Many attribute instances may share the same attribute definition.

      Specified by:
      getAttributeDefinitionId in interface BaseAttributeContract
      Returns:
      the attribute definition id
    • getValue

      public String getValue()
      Description copied from interface: BaseAttributeContract
      Returns the value of the attribute
      Specified by:
      getValue in interface BaseAttributeContract
      Returns:
      the value of the attribute
    • getAttributeDefinition

      public KrmsAttributeDefinition.Builder getAttributeDefinition()
      Description copied from interface: BaseAttributeContract
      Returns a KrmsAttributeDefinitionContract.

      This is the object referred to by the attributeDefinitionId. The full object is also kept here for performance purposes. This is because the name of the attribute is referenced often for resolving name / value attribute pairs.

      Specified by:
      getAttributeDefinition in interface BaseAttributeContract
      Returns:
      the attribute definition