Class ApprovalRuleDraftBuilder
- All Implemented Interfaces:
Builder<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()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionThe Associate Roles customers must hold for their Order to require approval.approvers
(ApproverHierarchyDraft approvers) The hierarchy of approvers within the Approval Rule.The hierarchy of approvers within the Approval Rule.build()
builds ApprovalRuleDraft with checking for non-null required valuesbuilds ApprovalRuleDraft without checking for non-null required valuesdescription
(String description) Description of the Approval Rule.The hierarchy of approvers within the Approval Rule.Description of the Approval Rule.getKey()
User-defined unique identifier of the Approval Rule.getName()
Name of the Approval Rule.The predicate describing the Orders the Approval Rule should match against.The Associate Roles customers must hold for their Order to require approval.Indicates whether the Approval Rule should be matched against Orders or not.User-defined unique identifier of the Approval Rule.Name of the Approval Rule.static ApprovalRuleDraftBuilder
of()
factory method for an instance of ApprovalRuleDraftBuilderstatic ApprovalRuleDraftBuilder
of
(ApprovalRuleDraft template) create builder for ApprovalRuleDraft instanceplusRequesters
(RuleRequesterDraft... requesters) The Associate Roles customers must hold for their Order to require approval.The Associate Roles customers must hold for their Order to require approval.The predicate describing the Orders the Approval Rule should match against.requesters
(RuleRequesterDraft... requesters) The Associate Roles customers must hold for their Order to require approval.requesters
(List<RuleRequesterDraft> requesters) The Associate Roles customers must hold for their Order to require approval.The Associate Roles customers must hold for their Order to require approval.status
(ApprovalRuleStatus status) Indicates whether the Approval Rule should be matched against Orders or not.The hierarchy of approvers within the Approval Rule.The Associate Roles customers must hold for their Order to require approval.
-
Constructor Details
-
ApprovalRuleDraftBuilder
public ApprovalRuleDraftBuilder()
-
-
Method Details
-
key
User-defined unique identifier of the Approval Rule. Uniqueness is enforced within the Business Unit.
- Parameters:
key
- value to be set- Returns:
- Builder
-
name
Name of the Approval Rule.
- Parameters:
name
- value to be set- Returns:
- Builder
-
description
Description of the Approval Rule.
- Parameters:
description
- value to be set- Returns:
- Builder
-
status
Indicates whether the Approval Rule should be matched against Orders or not.
- Parameters:
status
- value to be set- Returns:
- Builder
-
predicate
The predicate describing the Orders the Approval Rule should match against.
- Parameters:
predicate
- value to be set- Returns:
- Builder
-
approvers
public ApprovalRuleDraftBuilder approvers(Function<ApproverHierarchyDraftBuilder, ApproverHierarchyDraftBuilder> builder) The hierarchy of approvers within the Approval Rule.
- Parameters:
builder
- function to build the approvers value- Returns:
- Builder
-
withApprovers
public ApprovalRuleDraftBuilder withApprovers(Function<ApproverHierarchyDraftBuilder, ApproverHierarchyDraft> builder) The hierarchy of approvers within the Approval Rule.
- Parameters:
builder
- function to build the approvers value- Returns:
- Builder
-
approvers
The hierarchy of approvers within the Approval Rule.
- Parameters:
approvers
- value to be set- Returns:
- Builder
-
requesters
The Associate Roles customers must hold for their Order to require approval.
- Parameters:
requesters
- value to be set- Returns:
- Builder
-
requesters
The Associate Roles customers must hold for their Order to require approval.
- Parameters:
requesters
- value to be set- Returns:
- Builder
-
plusRequesters
The Associate Roles customers must hold for their Order to require approval.
- Parameters:
requesters
- value to be set- Returns:
- Builder
-
plusRequesters
public ApprovalRuleDraftBuilder plusRequesters(Function<RuleRequesterDraftBuilder, RuleRequesterDraftBuilder> builder) The Associate Roles customers must hold for their Order to require approval.
- Parameters:
builder
- function to build the requesters value- Returns:
- Builder
-
withRequesters
public ApprovalRuleDraftBuilder withRequesters(Function<RuleRequesterDraftBuilder, RuleRequesterDraftBuilder> builder) The Associate Roles customers must hold for their Order to require approval.
- Parameters:
builder
- function to build the requesters value- Returns:
- Builder
-
addRequesters
public ApprovalRuleDraftBuilder addRequesters(Function<RuleRequesterDraftBuilder, RuleRequesterDraft> builder) The Associate Roles customers must hold for their Order to require approval.
- Parameters:
builder
- function to build the requesters value- Returns:
- Builder
-
setRequesters
public ApprovalRuleDraftBuilder setRequesters(Function<RuleRequesterDraftBuilder, RuleRequesterDraft> builder) The Associate Roles customers must hold for their Order to require approval.
- Parameters:
builder
- function to build the requesters value- Returns:
- Builder
-
getKey
User-defined unique identifier of the Approval Rule. Uniqueness is enforced within the Business Unit.
- Returns:
- key
-
getName
Name of the Approval Rule.
- Returns:
- name
-
getDescription
Description of the Approval Rule.
- Returns:
- description
-
getStatus
Indicates whether the Approval Rule should be matched against Orders or not.
- Returns:
- status
-
getPredicate
The predicate describing the Orders the Approval Rule should match against.
- Returns:
- predicate
-
getApprovers
The hierarchy of approvers within the Approval Rule.
- Returns:
- approvers
-
getRequesters
The Associate Roles customers must hold for their Order to require approval.
- Returns:
- requesters
-
build
builds ApprovalRuleDraft with checking for non-null required values- Specified by:
build
in interfaceBuilder<ApprovalRuleDraft>
- Returns:
- ApprovalRuleDraft
-
buildUnchecked
builds ApprovalRuleDraft without checking for non-null required values- Returns:
- ApprovalRuleDraft
-
of
factory method for an instance of ApprovalRuleDraftBuilder- Returns:
- builder
-
of
create builder for ApprovalRuleDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-