Interface ApprovalRule
- All Superinterfaces:
BaseResource
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()
-
Method Summary
Modifier and TypeMethodDescriptionstatic ApprovalRuleBuilder
builder()
builder factory method for ApprovalRulestatic ApprovalRuleBuilder
builder
(ApprovalRule template) create builder for ApprovalRule instancestatic ApprovalRule
deepCopy
(ApprovalRule template) factory method to create a deep copy of ApprovalRule@NotNull @Valid ApproverHierarchy
The hierarchy of approvers within the Approval Rule.@NotNull @Valid BusinessUnitKeyReference
The Business Unit the Approval Rule belongs to.@NotNull ZonedDateTime
Date and time (UTC) the Approval Rule was initially created.@Valid CreatedBy
IDs and references that created the ApprovalRule.@Valid CustomFields
Custom Fields on the Approval Rule.Description of the Approval Rule.@NotNull String
getId()
Unique identifier of the Approval Rule.getKey()
User-defined unique identifier of the Approval Rule.@NotNull ZonedDateTime
Date and time (UTC) the Approval Rule was last updated.@Valid LastModifiedBy
IDs and references that last modified the ApprovalRule.@NotNull String
getName()
Name of the Approval Rule.@NotNull String
The Order Predicate describing the Orders the Approval Rule should match against.@NotNull @Valid List<RuleRequester>
The Associate Roles customers must hold for their Order to require approval.@NotNull ApprovalRuleStatus
Indicates whether the Approval Rule should be matched against Orders or not.@NotNull Long
Current version of the Approval Rule.static ApprovalRule
of()
factory methodstatic ApprovalRule
of
(ApprovalRule template) factory method to create a shallow copy ApprovalRulevoid
setApprovers
(ApproverHierarchy approvers) The hierarchy of approvers within the Approval Rule.void
setBusinessUnit
(BusinessUnitKeyReference businessUnit) The Business Unit the Approval Rule belongs to.void
setCreatedAt
(ZonedDateTime createdAt) Date and time (UTC) the Approval Rule was initially created.void
setCreatedBy
(CreatedBy createdBy) IDs and references that created the ApprovalRule.void
setCustom
(CustomFields custom) Custom Fields on the Approval Rule.void
setDescription
(String description) Description of the Approval Rule.void
Unique identifier of the Approval Rule.void
User-defined unique identifier of the Approval Rule.void
setLastModifiedAt
(ZonedDateTime lastModifiedAt) Date and time (UTC) the Approval Rule was last updated.void
setLastModifiedBy
(LastModifiedBy lastModifiedBy) IDs and references that last modified the ApprovalRule.void
Name of the Approval Rule.void
setPredicate
(String predicate) The Order Predicate describing the Orders the Approval Rule should match against.void
setRequesters
(RuleRequester... requesters) The Associate Roles customers must hold for their Order to require approval.void
setRequesters
(List<RuleRequester> requesters) The Associate Roles customers must hold for their Order to require approval.void
setStatus
(ApprovalRuleStatus status) Indicates whether the Approval Rule should be matched against Orders or not.void
setVersion
(Long version) Current version of the Approval Rule.static com.fasterxml.jackson.core.type.TypeReference<ApprovalRule>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withApprovalRule
(Function<ApprovalRule, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.common.BaseResource
withBaseResource
-
Method Details
-
getId
Unique identifier of the Approval Rule.
- Specified by:
getId
in interfaceBaseResource
- Returns:
- id
-
getVersion
Current version of the Approval Rule.
- Specified by:
getVersion
in interfaceBaseResource
- Returns:
- version
-
getCreatedAt
Date and time (UTC) the Approval Rule was initially created.
- Specified by:
getCreatedAt
in interfaceBaseResource
- Returns:
- createdAt
-
getCreatedBy
IDs and references that created the ApprovalRule.
- Returns:
- createdBy
-
getLastModifiedAt
Date and time (UTC) the Approval Rule was last updated.
- Specified by:
getLastModifiedAt
in interfaceBaseResource
- Returns:
- lastModifiedAt
-
getLastModifiedBy
IDs and references that last modified the ApprovalRule.
- Returns:
- lastModifiedBy
-
getKey
String 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
String 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
-
setId
Unique identifier of the Approval Rule.
- Specified by:
setId
in interfaceBaseResource
- Parameters:
id
- value to be set
-
setVersion
Current version of the Approval Rule.
- Specified by:
setVersion
in interfaceBaseResource
- Parameters:
version
- value to be set
-
setCreatedAt
Date and time (UTC) the Approval Rule was initially created.
- Specified by:
setCreatedAt
in interfaceBaseResource
- Parameters:
createdAt
- value to be set
-
setCreatedBy
IDs and references that created the ApprovalRule.
- Parameters:
createdBy
- value to be set
-
setLastModifiedAt
Date and time (UTC) the Approval Rule was last updated.
- Specified by:
setLastModifiedAt
in interfaceBaseResource
- Parameters:
lastModifiedAt
- value to be set
-
setLastModifiedBy
IDs and references that last modified the ApprovalRule.
- Parameters:
lastModifiedBy
- value to be set
-
setKey
User-defined unique identifier of the Approval Rule. Must be unique within a Business Unit.
- Parameters:
key
- value to be set
-
setName
Name of the Approval Rule.
- Parameters:
name
- value to be set
-
setDescription
Description of the Approval Rule.
- Parameters:
description
- value to be set
-
setStatus
Indicates whether the Approval Rule should be matched against Orders or not.
- Parameters:
status
- value to be set
-
setPredicate
The Order Predicate describing the Orders the Approval Rule should match against.
- Parameters:
predicate
- value to be set
-
setApprovers
The hierarchy of approvers within the Approval Rule.
- Parameters:
approvers
- value to be set
-
setRequesters
The Associate Roles customers must hold for their Order to require approval.
- Parameters:
requesters
- values to be set
-
setRequesters
The Associate Roles customers must hold for their Order to require approval.
- Parameters:
requesters
- values to be set
-
setBusinessUnit
The Business Unit the Approval Rule belongs to.
- Parameters:
businessUnit
- value to be set
-
setCustom
Custom Fields on the Approval Rule.
- Parameters:
custom
- value to be set
-
of
factory method- Returns:
- instance of ApprovalRule
-
of
factory method to create a shallow copy ApprovalRule- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of ApprovalRule- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ApprovalRule- Returns:
- builder
-
builder
create builder for ApprovalRule instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withApprovalRule
accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-