Class KrmsTypeDefinition.Builder

java.lang.Object
org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition.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, KrmsTypeDefinitionContract
Enclosing class:
KrmsTypeDefinition

public static class KrmsTypeDefinition.Builder extends Object implements KrmsTypeDefinitionContract, org.kuali.rice.core.api.mo.ModelBuilder, Serializable
This builder is used to construct instances of KrmsTypeDefinition. It enforces the constraints of the KrmsTypeDefinitionContract.
See Also:
  • Method Details

    • serviceName

      public KrmsTypeDefinition.Builder serviceName(String serviceName)
      fluent interface that sets the serviceName field of the Builder.
      Parameters:
      serviceName - the service used to resolve attribute values
      Returns:
      a Builder object with the serviceName field set
    • attributes

      fluent interface that sets the attributes of KrmsTypeDefinition builder.
      Parameters:
      attributes - List of KrmsTypeAttribute builder objects. KrmsTypeAttribute.Builder
      Returns:
      a Builder object with the attributes collection set.
    • create

      public static KrmsTypeDefinition.Builder create(String name, String namespace)
      Creates a KrmsTypeDefinition builder from the given parameters.
      Parameters:
      name - of the KrmsTypeDefinition
      namespace - to which the KrmsTypeDefinition belongs
      Returns:
      an instance of the builder with the fields already populated
      Throws:
      IllegalArgumentException - if the either the name or namespace is null or blank
    • create

      public static KrmsTypeDefinition.Builder create(KrmsTypeDefinitionContract contract)
      Creates a builder by populating it with data from the given KrmsTypeDefinitionContract.
      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.
      Throws:
      IllegalArgumentException - if the id is blank
    • setName

      public void setName(String name)
      Sets the name of the KrmsTypeDefinition
      Parameters:
      name - string value to assign to the name; cannot be null or blank
      Throws:
      IllegalArgumentException - if the name is null or blank
    • setNamespace

      public void setNamespace(String namespace)
      Sets the namespace of the KrmsTypeDefinition
      Parameters:
      namespace - string value to assign to the namespace; cannot be null or blank
      Throws:
      IllegalArgumentException - if the name is null or blank
    • setServiceName

      public void setServiceName(String serviceName)
      Sets the name of the KRMS type service
      Parameters:
      serviceName - can be null.
    • setAttributes

      public void setAttributes(List<KrmsTypeAttribute.Builder> attributes)
      sets the List of attributes related to this KrmsTypeDefinition.
      Parameters:
      attributes - list of KrmsTypeAttribute.Builder representing the attributes assigned to this KrmsTypeDefinition; List may be empty, but not 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
    • getName

      public String getName()
      Description copied from interface: KrmsTypeDefinitionContract
      Returns the name of the KrmsTypeDefinition. All KrmsTypeDefinitions have a name, so this value can not be null or blank. The combination of name and namespace must be unique within the entire KRMS system.
      Specified by:
      getName in interface KrmsTypeDefinitionContract
      Returns:
      the name of this KrmsTypeDefinition
    • getNamespace

      public String getNamespace()
      Description copied from interface: KrmsTypeDefinitionContract
      Returns the namespace to which the KrmsTypeDefinition belongs. All type definitions exist within a namespace. This value can not be null or blank. The combination of name and namespace must be unique within the entire KRMS system.
      Specified by:
      getNamespace in interface KrmsTypeDefinitionContract
      Returns:
      the namespace of this KrmsTypeDefinition
    • getServiceName

      public String getServiceName()
      Description copied from interface: KrmsTypeDefinitionContract
      Returns the name of the service used to resolve attribute values. The service name may be null or blank.
      Specified by:
      getServiceName in interface KrmsTypeDefinitionContract
      Returns:
      the service name of this KrmsTypeDefinition
    • getAttributes

      public List<KrmsTypeAttribute.Builder> getAttributes()
      Description copied from interface: KrmsTypeDefinitionContract
      Returns a list of attributes associated with the KRMS type definition. This can be empty, but will never be null. If no attribute definitions are associated with the KRMS type then this will return an empty collection.
      Specified by:
      getAttributes in interface KrmsTypeDefinitionContract
      Returns:
      the list of KrmsTypeAttributeContract attribute definition contracts
    • 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 KrmsTypeDefinition build()
      Builds an instance of a KrmsTypeDefinition based on the current state of the builder.
      Specified by:
      build in interface org.kuali.rice.core.api.mo.ModelBuilder
      Returns:
      the fully-constructed KrmsTypeDefinition