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 ApprovalRuleBuilderbuilder()builder factory method for ApprovalRulestatic ApprovalRuleBuilderbuilder(ApprovalRule template) create builder for ApprovalRule instancecopyDeep()static ApprovalRuledeepCopy(ApprovalRule template) factory method to create a deep copy of ApprovalRule@NotNull @Valid ApproverHierarchyThe hierarchy of approvers within the Approval Rule.@NotNull @Valid BusinessUnitKeyReferenceThe Business Unit the Approval Rule belongs to.@NotNull ZonedDateTimeDate and time (UTC) the Approval Rule was initially created.@Valid CreatedByIDs and references that created the ApprovalRule.@Valid CustomFieldsCustom Fields on the Approval Rule.Description of the Approval Rule.@NotNull StringgetId()Unique identifier of the Approval Rule.getKey()User-defined unique identifier of the Approval Rule.@NotNull ZonedDateTimeDate and time (UTC) the Approval Rule was last updated.@Valid LastModifiedByIDs and references that last modified the ApprovalRule.@NotNull StringgetName()Name of the Approval Rule.@NotNull StringThe 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 ApprovalRuleStatusIndicates whether the Approval Rule should be matched against Orders or not.@NotNull LongCurrent version of the Approval Rule.static ApprovalRuleof()factory methodstatic ApprovalRuleof(ApprovalRule template) factory method to create a shallow copy ApprovalRulevoidsetApprovers(ApproverHierarchy approvers) The hierarchy of approvers within the Approval Rule.voidsetBusinessUnit(BusinessUnitKeyReference businessUnit) The Business Unit the Approval Rule belongs to.voidsetCreatedAt(ZonedDateTime createdAt) Date and time (UTC) the Approval Rule was initially created.voidsetCreatedBy(CreatedBy createdBy) IDs and references that created the ApprovalRule.voidsetCustom(CustomFields custom) Custom Fields on the Approval Rule.voidsetDescription(String description) Description of the Approval Rule.voidUnique identifier of the Approval Rule.voidUser-defined unique identifier of the Approval Rule.voidsetLastModifiedAt(ZonedDateTime lastModifiedAt) Date and time (UTC) the Approval Rule was last updated.voidsetLastModifiedBy(LastModifiedBy lastModifiedBy) IDs and references that last modified the ApprovalRule.voidName of the Approval Rule.voidsetPredicate(String predicate) The Order Predicate describing the Orders the Approval Rule should match against.voidsetRequesters(RuleRequester... requesters) The Associate Roles customers must hold for their Order to require approval.voidsetRequesters(List<RuleRequester> requesters) The Associate Roles customers must hold for their Order to require approval.voidsetStatus(ApprovalRuleStatus status) Indicates whether the Approval Rule should be matched against Orders or not.voidsetVersion(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> TwithApprovalRule(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:
getIdin interfaceBaseResource- Returns:
- id
-
getVersion
Current version of the Approval Rule.
- Specified by:
getVersionin interfaceBaseResource- Returns:
- version
-
getCreatedAt
Date and time (UTC) the Approval Rule was initially created.
- Specified by:
getCreatedAtin 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:
getLastModifiedAtin 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:
setIdin interfaceBaseResource- Parameters:
id- value to be set
-
setVersion
Current version of the Approval Rule.
- Specified by:
setVersionin interfaceBaseResource- Parameters:
version- value to be set
-
setCreatedAt
Date and time (UTC) the Approval Rule was initially created.
- Specified by:
setCreatedAtin 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:
setLastModifiedAtin 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
-
copyDeep
ApprovalRule copyDeep()- Specified by:
copyDeepin interfaceBaseResource
-
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
-