Class PropositionParameter.Builder

java.lang.Object
org.kuali.rice.krms.api.repository.proposition.PropositionParameter.Builder
All Implemented Interfaces:
Serializable, Identifiable, Versioned, ModelBuilder, PropositionParameterContract
Enclosing class:
PropositionParameter

public static class PropositionParameter.Builder extends Object implements PropositionParameterContract, ModelBuilder, Serializable
This builder is used to construct instances of PropositionParameter. It enforces the constraints of the PropositionParameterContract.
See Also:
  • Method Details

    • create

      public static PropositionParameter.Builder create(String id, String propId, String value, String parameterType, Integer sequenceNumber)
      Create a builder using the given values
      Parameters:
      id - the id value to set, must not be null or blank
      propId - the propId value to set, must not be null or blank
      value - the value value to set, must not be null or blank
      parameterType - the value parameterType to set, must not be null or blank
      sequenceNumber - the value sequenceNumber to set, must not be null or blank
      Returns:
      Builder with the given values set
    • create

      Creates a builder by populating it with data from the given PropositionParameterContract.
      Parameters:
      contract - the contract from which to populate this builder
      Returns:
      an instance of the builder populated with data from the contract
    • create

      public static PropositionParameter.Builder create(PropositionParameter propositionParameter)
      Creates a builder by populating it with data from the given PropositionParameterContract.
      Parameters:
      propositionParameter - the contract from which to populate this builder
      Returns:
      an instance of the builder populated with data from the contract
    • create

      public static PropositionParameter.Builder create(PropositionParameter.Builder inputBuilder)
      Creates a builder by populating it with data from the given PropositionParameterContract.
      Parameters:
      inputBuilder - the contract 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 not be null or blank
      Throws:
      IllegalArgumentException - if the id is null or blank
    • setPropId

      public void setPropId(String propId)
      Sets the value of the propId on this builder to the given value.
      Parameters:
      propId - the propId value to set, must not be null or blank
      Throws:
      IllegalArgumentException - if the propId is null or blank
    • setValue

      public void setValue(String value)
      Sets the value of the value on this builder to the given value.
      Parameters:
      value - the value value to set, may be null, otherwise must contain non-whitespace
      Throws:
      IllegalArgumentException - if the value is all whitespace characters
    • setTermValue

      public void setTermValue(TermDefinition termValue)
      Sets the value of the termValue on this builder to the given value.
      Parameters:
      termValue - the termValue value to set, may be null
    • setParameterType

      public void setParameterType(String parameterType)
      Sets the value of the parameterType on this builder to the given value.
      Parameters:
      parameterType - the value parameterType to set, must not be null or blank
      Throws:
      IllegalArgumentException - if the parameterType is null, blank, or invalid
    • setSequenceNumber

      public void setSequenceNumber(Integer sequenceNumber)
      Sets the value of the sequenceNumber on this builder to the given value.
      Parameters:
      sequenceNumber - the value sequenceNumber to set, must not be null or blank
      Throws:
      IllegalArgumentException - if the sequenceNumber is null, blank, or invalid
    • setProposition

      public void setProposition(PropositionDefinition.Builder proposition)
      Sets the value of the proposition on this builder to the given value.
      Parameters:
      proposition - the value proposition to set
    • setVersionNumber

      public void setVersionNumber(Long versionNumber)
      Sets the value of the versionNumber on this builder to the given value.
      Parameters:
      versionNumber - the value versionNumber to set
    • getId

      public String getId()
      Specified by:
      getId in interface Identifiable
    • getPropId

      public String getPropId()
      Description copied from interface: PropositionParameterContract
      Returns the Id for the parent proposition.

      It is the Id of the parent proposition.

      Specified by:
      getPropId in interface PropositionParameterContract
      Returns:
      Id for parent parameter.
    • getValue

      public String getValue()
      Description copied from interface: PropositionParameterContract
      Returns the value of the proposition parameter

      It is the value of the parameter

      Specified by:
      getValue in interface PropositionParameterContract
      Returns:
      value of the parameter
    • getTermValue

      public TermDefinition getTermValue()
      Description copied from interface: PropositionParameterContract
      Returns the term value of the proposition parameter if the proposition parameter is a term.

      It is the term value of the parameter

      Specified by:
      getTermValue in interface PropositionParameterContract
      Returns:
      value of the term parameter
    • getParameterType

      public String getParameterType()
      Description copied from interface: PropositionParameterContract
      Returns the type of the parameter. Proposition parameters are one of the following types: Constant Values: numbers, strings, dates, etc. Terms: data available in the execution environment or provided by a term resolver Functions: custom functions that resolve to a value, or standard operators (equals, greater than, less than, ...)

      It identified the type of the parameter.

      Specified by:
      getParameterType in interface PropositionParameterContract
      Returns:
      the parameter type code. Valid values are C, T, and F.
    • getSequenceNumber

      public Integer getSequenceNumber()
      Description copied from interface: PropositionParameterContract
      Returns the sequence number of the proposition parameter. Proposition parameters are listed in Reverse Polish Notation. The sequence number (starting with 1) identifies the position of the parameter in the list.
      Specified by:
      getSequenceNumber in interface PropositionParameterContract
      Returns:
      the sequence number of the proposition parameter
    • getVersionNumber

      public Long getVersionNumber()
      Specified by:
      getVersionNumber in interface Versioned
    • build

      public PropositionParameter build()
      Builds an instance of a PropositionParameter based on the current state of the builder.
      Specified by:
      build in interface ModelBuilder
      Returns:
      the fully-constructed PropositionParameter