Class ApprovalRuleBuilder
- All Implemented Interfaces:
Builder<ApprovalRule>
Example to create an instance using the builder pattern
ApprovalRule approvalRule = ApprovalRule.builder()
.id("{id}")
.version(0.3)
.createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.name("{name}")
.status(ApprovalRuleStatus.ACTIVE)
.predicate("{predicate}")
.approvers(approversBuilder -> approversBuilder)
.plusRequesters(requestersBuilder -> requestersBuilder)
.businessUnit(businessUnitBuilder -> businessUnitBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionThe Associate Roles customers must hold for their Order to require approval.approvers
(ApproverHierarchy approvers) The hierarchy of approvers within the Approval Rule.The hierarchy of approvers within the Approval Rule.build()
builds ApprovalRule with checking for non-null required valuesbuilds ApprovalRule without checking for non-null required valuesbusinessUnit
(BusinessUnitKeyReference businessUnit) The Business Unit the Approval Rule belongs to.The Business Unit the Approval Rule belongs to.createdAt
(ZonedDateTime createdAt) Date and time (UTC) the Approval Rule was initially created.IDs and references that created the ApprovalRule.createdBy
(Function<CreatedByBuilder, CreatedByBuilder> builder) IDs and references that created the ApprovalRule.custom
(CustomFields custom) Custom Fields on the Approval Rule.custom
(Function<CustomFieldsBuilder, CustomFieldsBuilder> builder) Custom Fields on the Approval Rule.description
(String description) Description of the Approval Rule.The hierarchy of approvers within the Approval Rule.The Business Unit the Approval Rule belongs to.Date and time (UTC) the Approval Rule was initially created.IDs and references that created the ApprovalRule.Custom Fields on the Approval Rule.Description of the Approval Rule.getId()
Unique identifier of the Approval Rule.getKey()
User-defined unique identifier of the Approval Rule.Date and time (UTC) the Approval Rule was last updated.IDs and references that last modified the ApprovalRule.getName()
Name of the Approval Rule.The Order 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.Current version of the Approval Rule.Unique identifier of the Approval Rule.User-defined unique identifier of the Approval Rule.lastModifiedAt
(ZonedDateTime lastModifiedAt) Date and time (UTC) the Approval Rule was last updated.lastModifiedBy
(LastModifiedBy lastModifiedBy) IDs and references that last modified the ApprovalRule.IDs and references that last modified the ApprovalRule.Name of the Approval Rule.static ApprovalRuleBuilder
of()
factory method for an instance of ApprovalRuleBuilderstatic ApprovalRuleBuilder
of
(ApprovalRule template) create builder for ApprovalRule instanceplusRequesters
(RuleRequester... 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 Order Predicate describing the Orders the Approval Rule should match against.requesters
(RuleRequester... requesters) The Associate Roles customers must hold for their Order to require approval.requesters
(List<RuleRequester> 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.Current version of the Approval Rule.The hierarchy of approvers within the Approval Rule.The Business Unit the Approval Rule belongs to.withCreatedBy
(Function<CreatedByBuilder, CreatedBy> builder) IDs and references that created the ApprovalRule.withCustom
(Function<CustomFieldsBuilder, CustomFields> builder) Custom Fields on the Approval Rule.IDs and references that last modified the ApprovalRule.The Associate Roles customers must hold for their Order to require approval.
-
Constructor Details
-
ApprovalRuleBuilder
public ApprovalRuleBuilder()
-
-
Method Details
-
id
Unique identifier of the Approval Rule.
- Parameters:
id
- value to be set- Returns:
- Builder
-
version
Current version of the Approval Rule.
- Parameters:
version
- value to be set- Returns:
- Builder
-
createdAt
Date and time (UTC) the Approval Rule was initially created.
- Parameters:
createdAt
- value to be set- Returns:
- Builder
-
lastModifiedAt
Date and time (UTC) the Approval Rule was last updated.
- Parameters:
lastModifiedAt
- value to be set- Returns:
- Builder
-
createdBy
IDs and references that created the ApprovalRule.
- Parameters:
builder
- function to build the createdBy value- Returns:
- Builder
-
withCreatedBy
IDs and references that created the ApprovalRule.
- Parameters:
builder
- function to build the createdBy value- Returns:
- Builder
-
createdBy
IDs and references that created the ApprovalRule.
- Parameters:
createdBy
- value to be set- Returns:
- Builder
-
lastModifiedBy
public ApprovalRuleBuilder lastModifiedBy(Function<LastModifiedByBuilder, LastModifiedByBuilder> builder) IDs and references that last modified the ApprovalRule.
- Parameters:
builder
- function to build the lastModifiedBy value- Returns:
- Builder
-
withLastModifiedBy
public ApprovalRuleBuilder withLastModifiedBy(Function<LastModifiedByBuilder, LastModifiedBy> builder) IDs and references that last modified the ApprovalRule.
- Parameters:
builder
- function to build the lastModifiedBy value- Returns:
- Builder
-
lastModifiedBy
IDs and references that last modified the ApprovalRule.
- Parameters:
lastModifiedBy
- value to be set- Returns:
- Builder
-
key
User-defined unique identifier of the Approval Rule. Must be unique within a 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 Order Predicate describing the Orders the Approval Rule should match against.
- Parameters:
predicate
- value to be set- Returns:
- Builder
-
approvers
public ApprovalRuleBuilder approvers(Function<ApproverHierarchyBuilder, ApproverHierarchyBuilder> builder) The hierarchy of approvers within the Approval Rule.
- Parameters:
builder
- function to build the approvers value- Returns:
- Builder
-
withApprovers
public ApprovalRuleBuilder withApprovers(Function<ApproverHierarchyBuilder, ApproverHierarchy> 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 ApprovalRuleBuilder plusRequesters(Function<RuleRequesterBuilder, RuleRequesterBuilder> 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 ApprovalRuleBuilder withRequesters(Function<RuleRequesterBuilder, RuleRequesterBuilder> builder) The Associate Roles customers must hold for their Order to require approval.
- Parameters:
builder
- function to build the requesters value- Returns:
- Builder
-
addRequesters
The Associate Roles customers must hold for their Order to require approval.
- Parameters:
builder
- function to build the requesters value- Returns:
- Builder
-
setRequesters
The Associate Roles customers must hold for their Order to require approval.
- Parameters:
builder
- function to build the requesters value- Returns:
- Builder
-
businessUnit
public ApprovalRuleBuilder businessUnit(Function<BusinessUnitKeyReferenceBuilder, BusinessUnitKeyReferenceBuilder> builder) The Business Unit the Approval Rule belongs to.
- Parameters:
builder
- function to build the businessUnit value- Returns:
- Builder
-
withBusinessUnit
public ApprovalRuleBuilder withBusinessUnit(Function<BusinessUnitKeyReferenceBuilder, BusinessUnitKeyReference> builder) The Business Unit the Approval Rule belongs to.
- Parameters:
builder
- function to build the businessUnit value- Returns:
- Builder
-
businessUnit
The Business Unit the Approval Rule belongs to.
- Parameters:
businessUnit
- value to be set- Returns:
- Builder
-
custom
Custom Fields on the Approval Rule.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
Custom Fields on the Approval Rule.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
custom
Custom Fields on the Approval Rule.
- Parameters:
custom
- value to be set- Returns:
- Builder
-
getId
Unique identifier of the Approval Rule.
- Returns:
- id
-
getVersion
Current version of the Approval Rule.
- Returns:
- version
-
getCreatedAt
Date and time (UTC) the Approval Rule was initially created.
- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) the Approval Rule was last updated.
- Returns:
- lastModifiedAt
-
getCreatedBy
IDs and references that created the ApprovalRule.
- Returns:
- createdBy
-
getLastModifiedBy
IDs and references that last modified the ApprovalRule.
- Returns:
- lastModifiedBy
-
getKey
User-defined unique identifier of the Approval Rule. Must be unique within a 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 Order 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
-
getBusinessUnit
The Business Unit the Approval Rule belongs to.
- Returns:
- businessUnit
-
getCustom
Custom Fields on the Approval Rule.
- Returns:
- custom
-
build
builds ApprovalRule with checking for non-null required values- Specified by:
build
in interfaceBuilder<ApprovalRule>
- Returns:
- ApprovalRule
-
buildUnchecked
builds ApprovalRule without checking for non-null required values- Returns:
- ApprovalRule
-
of
factory method for an instance of ApprovalRuleBuilder- Returns:
- builder
-
of
create builder for ApprovalRule instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-