Class KrmsTypeAttribute.Builder

java.lang.Object
org.kuali.rice.krms.api.repository.type.KrmsTypeAttribute.Builder
All Implemented Interfaces:
Serializable, org.kuali.rice.core.api.mo.common.active.Inactivatable, org.kuali.rice.core.api.mo.common.Identifiable, org.kuali.rice.core.api.mo.common.Versioned, org.kuali.rice.core.api.mo.ModelBuilder, KrmsTypeAttributeContract
Enclosing class:
KrmsTypeAttribute

public static class KrmsTypeAttribute.Builder extends Object implements KrmsTypeAttributeContract, org.kuali.rice.core.api.mo.ModelBuilder, Serializable
This builder is used to construct instances of KrmsTypeAttribute.
See Also:
  • Method Details

    • create

      public static KrmsTypeAttribute.Builder create(String typeId, String attributeDefinitionId, Integer sequenceNumber)
      Creates a builder from the given parameters.
      Parameters:
      typeId - the KrmsType Id
      attributeDefinitionId - The attributeDefinitionId
      sequenceNumber -
      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 KrmsTypeAttribute.Builder create(KrmsTypeAttributeContract contract)
      Creates a builder by populating it with data from the given KrmsTypeAttributeContract.
      Parameters:
      contract - the contract from which to populate this builder
      Returns:
      an instance of the builder populated with data from the contract
      Throws:
      IllegalArgumentException - if the contract is null
    • 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; can be null; a null id is an indicator the this has not yet been persisted to the database.
    • setTypeId

      public void setTypeId(String typeId)
      Sets the id of the KrmsTypeDefinition to which this attribute belongs.
      Parameters:
      typeId - the id of the KrmsTypeDefinition; may not be null or blank
      Throws:
      IllegalArgumentException - if the typeId is null or blank
    • setAttributeDefinitionId

      public void setAttributeDefinitionId(String attributeDefinitionId)
      Sets the id of the KrmsAttributeDefinition that describes this attribute.
      Parameters:
      attributeDefinitionId - id of the KrmsAttributeDefinition; may not be null or blank
      Throws:
      IllegalArgumentException - if the attributeDefinitionId is null or blank
    • setSequenceNumber

      public void setSequenceNumber(Integer sequenceNumber)
      Sets the sequence number. This represents the order of the attributes within the KrmsTypeDefinition.
      Parameters:
      sequenceNumber - the order of the attribute in the attribute list; cannot be null
      Throws:
      IllegalArgumentException - if the sequenceNumber is null
    • setActive

      public void setActive(boolean active)
      sets the active indicator value
      Parameters:
      active - boolean value to set
    • setVersionNumber

      public void setVersionNumber(Long versionNumber)
      Sets 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.

      Parameters:
      versionNumber - the version number, or null if one has not been assigned yet
    • getId

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

      public String getTypeId()
      Description copied from interface: KrmsTypeAttributeContract
      Returns the id of the KrmsTypeDefinition to which the attribute applies

      A KRMS type definition has zero or more attributes associated with it. The id field indicates which type definition this attribute is associated with. It is the id of a KrmsTypeDefinition related to the attribute. This required field may not be null or blank.

      Specified by:
      getTypeId in interface KrmsTypeAttributeContract
      Returns:
      id for KrmsTypeDefinition related to the attribute.
    • getAttributeDefinitionId

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

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

      Specified by:
      getAttributeDefinitionId in interface KrmsTypeAttributeContract
      Returns:
      the attribute definition id
    • getSequenceNumber

      public Integer getSequenceNumber()
      Description copied from interface: KrmsTypeAttributeContract
      Returns the sequence number of the attribute within the KrmsTypeDefinition collection.

      The list of attributes is an ordered list. This value represents the position in the list and cannot be null.

      Specified by:
      getSequenceNumber in interface KrmsTypeAttributeContract
      Returns:
      the sequence number of the attribute
    • isActive

      public boolean isActive()
      Specified by:
      isActive in interface org.kuali.rice.core.api.mo.common.active.Inactivatable
    • getVersionNumber

      public Long getVersionNumber()
      Specified by:
      getVersionNumber in interface org.kuali.rice.core.api.mo.common.Versioned
    • build

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