Class FunctionParameterDefinition.Builder

java.lang.Object
org.kuali.rice.krms.api.repository.function.FunctionParameterDefinition.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, FunctionParameterDefinitionContract
Enclosing class:
FunctionParameterDefinition

public static final class FunctionParameterDefinition.Builder extends Object implements FunctionParameterDefinitionContract, org.kuali.rice.core.api.mo.ModelBuilder, Serializable
A builder which can be used to construct FunctionParameterDefinition instances. Enforces the constraints of the FunctionParameterDefinitionContract.
Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
  • Method Details

    • create

      public static FunctionParameterDefinition.Builder create(String name, String type, Integer sequenceNumber)
      Creates a function parameter definition builder with the given required values. This builder is the only means by which a FunctionParameterDefinition object should be created.
      Parameters:
      name - the name of the function parameter definition to create, must not be null or blank
      type - the type of the function parameter definition to create, must not be null or blank
      Returns:
      a builder with the required values already initialized
      Throws:
      IllegalArgumentException - if any of the given arguments is null or blank
    • create

      Creates and populates a builder with the data on the given FunctionParameterDefinitionContract. This is similar in nature to a "copy constructor" for FunctionParameterDefinition.
      Parameters:
      contract - an object implementing the FunctionParameterDefinitionContract from which to copy property values
      Returns:
      a builder with the values from the contract already initialized
      Throws:
      IllegalArgumentException - if the given contract is null
    • build

      Specified by:
      build in interface org.kuali.rice.core.api.mo.ModelBuilder
    • getId

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

      public void setId(String id)
      Sets the id for the function parameter definition that will be returned by this builder.
      Parameters:
      id - the function parameter definition id to set
    • getName

      public String getName()
      Description copied from interface: FunctionParameterDefinitionContract
      Returns the name of this parameters. All parameters have a name and this value can never be null or blank. The parameter name must be unique within a given function definition.
      Specified by:
      getName in interface FunctionParameterDefinitionContract
      Returns:
      the name of this function parameter definition
    • setName

      public void setName(String name)
      Sets the name for the function parameter 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
    • getDescription

      public String getDescription()
      Description copied from interface: FunctionParameterDefinitionContract
      Returns the description of this parameter. The description is intended to provide more information about a parameter and it's appropriate usage. The description is optional and will be null if a description is not defined.
      Specified by:
      getDescription in interface FunctionParameterDefinitionContract
      Returns:
      the description of this function parameter definition, or null if this parameter has no description
    • setDescription

      public void setDescription(String description)
      Sets the description for the function parameter definition that will be returned by this builder.
      Parameters:
      description - the description to set on this builder
    • getParameterType

      public String getParameterType()
      Description copied from interface: FunctionParameterDefinitionContract
      Returns the type of this function parameter. This can be one of a set of "built-in" data types or a custom data type represented as a fully qualified java class name. All parameters must have a valid type so this method should never return null or blank.
      Specified by:
      getParameterType in interface FunctionParameterDefinitionContract
      Returns:
      the type of this function parameter definition
    • setParameterType

      public void setParameterType(String type)
      Sets the type for the function parameter definition that will be returned by this builder. This can be one of a set of "built-in" data types or a custom datatype represented as a fully qualified java class name. The type must not be null or blank.
      Parameters:
      type - the type to set on this builder, must not be null or blank
    • getFunctionId

      public String getFunctionId()
      Description copied from interface: FunctionParameterDefinitionContract
      Returns the ID of the function to which this parameter is associated.
      Specified by:
      getFunctionId in interface FunctionParameterDefinitionContract
      Returns:
      the ID of the corresponding function
    • setFunctionId

      public void setFunctionId(String functionId)
      Sets the type for the function id If provided, the function id must be non-blank. Must allow id to be null, to prevent chicken/egg problems.
      Parameters:
      functionId - the functionId to set on this builder, must be either null or non-blank
    • getSequenceNumber

      public Integer getSequenceNumber()
      Description copied from interface: FunctionParameterDefinitionContract
      This is the sequence number of the function parameter. The sequence number identifies the position of the parameter in the function list.
      Specified by:
      getSequenceNumber in interface FunctionParameterDefinitionContract
      Returns:
      the sequence number of the function parameter
    • setSequenceNumber

      public void setSequenceNumber(Integer sequenceNumber)
      Sets the sequence number for the function parameter definition that will be returned by this builder. This is the position in the functions parameter list.
      Parameters:
      sequenceNumber - the position of the parameter in the function parameter list
    • getVersionNumber

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

      public void setVersionNumber(Long versionNumber)
      Sets the version number for the function parameter definition that will be returned by this builder.

      In general, this value should not be manually set on the builder, but rather copied from an existing FunctionParameterDefinitionContract when invoking create(FunctionParameterDefinitionContract).

      Parameters:
      versionNumber - the version number to set