Interface ApprovalRuleDraft

All Superinterfaces:
Draft<ApprovalRuleDraft>

public interface ApprovalRuleDraft extends Draft<ApprovalRuleDraft>
ApprovalRuleDraft
Example to create an instance using the builder pattern

     ApprovalRuleDraft approvalRuleDraft = ApprovalRuleDraft.builder()
             .name("{name}")
             .status(ApprovalRuleStatus.ACTIVE)
             .predicate("{predicate}")
             .approvers(approversBuilder -> approversBuilder)
             .plusRequesters(requestersBuilder -> requestersBuilder)
             .build()
 
  • Method Details

    • getKey

      String getKey()

      User-defined unique identifier of the Approval Rule. Uniqueness is enforced within the Business Unit.

      Returns:
      key
    • getName

      @NotNull @NotNull String getName()

      Name of the Approval Rule.

      Returns:
      name
    • getDescription

      String getDescription()

      Description of the Approval Rule.

      Returns:
      description
    • getStatus

      @NotNull @NotNull ApprovalRuleStatus getStatus()

      Indicates whether the Approval Rule should be matched against Orders or not.

      Returns:
      status
    • getPredicate

      @NotNull @NotNull String getPredicate()

      The predicate describing the Orders the Approval Rule should match against.

      Returns:
      predicate
    • getApprovers

      @NotNull @Valid @NotNull @Valid ApproverHierarchyDraft getApprovers()

      The hierarchy of approvers within the Approval Rule.

      Returns:
      approvers
    • getRequesters

      @NotNull @Valid @NotNull @Valid List<RuleRequesterDraft> getRequesters()

      The Associate Roles customers must hold for their Order to require approval.

      Returns:
      requesters
    • setKey

      void setKey(String key)

      User-defined unique identifier of the Approval Rule. Uniqueness is enforced within the Business Unit.

      Parameters:
      key - value to be set
    • setName

      void setName(String name)

      Name of the Approval Rule.

      Parameters:
      name - value to be set
    • setDescription

      void setDescription(String description)

      Description of the Approval Rule.

      Parameters:
      description - value to be set
    • setStatus

      void setStatus(ApprovalRuleStatus status)

      Indicates whether the Approval Rule should be matched against Orders or not.

      Parameters:
      status - value to be set
    • setPredicate

      void setPredicate(String predicate)

      The predicate describing the Orders the Approval Rule should match against.

      Parameters:
      predicate - value to be set
    • setApprovers

      void setApprovers(ApproverHierarchyDraft approvers)

      The hierarchy of approvers within the Approval Rule.

      Parameters:
      approvers - value to be set
    • setRequesters

      void setRequesters(RuleRequesterDraft... requesters)

      The Associate Roles customers must hold for their Order to require approval.

      Parameters:
      requesters - values to be set
    • setRequesters

      void setRequesters(List<RuleRequesterDraft> requesters)

      The Associate Roles customers must hold for their Order to require approval.

      Parameters:
      requesters - values to be set
    • of

      static ApprovalRuleDraft of()
      factory method
      Returns:
      instance of ApprovalRuleDraft
    • of

      static ApprovalRuleDraft of(ApprovalRuleDraft template)
      factory method to create a shallow copy ApprovalRuleDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      factory method to create a deep copy of ApprovalRuleDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static ApprovalRuleDraftBuilder builder()
      builder factory method for ApprovalRuleDraft
      Returns:
      builder
    • builder

      static ApprovalRuleDraftBuilder builder(ApprovalRuleDraft template)
      create builder for ApprovalRuleDraft instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withApprovalRuleDraft

      default <T> T withApprovalRuleDraft(Function<ApprovalRuleDraft,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<ApprovalRuleDraft> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference