Interface Record
Captures the differences between the previous and next version of a resource.
The maximum number of Records that can be stored and their retention period are subject to a limit.
Example to create an instance using the builder pattern
Record record = Record.builder()
.version(1)
.previousVersion(1)
.type("{type}")
.modifiedBy(modifiedByBuilder -> modifiedByBuilder)
.modifiedAt("{modifiedAt}")
.label(labelBuilder -> labelBuilder)
.previousLabel(previousLabelBuilder -> previousLabelBuilder)
.plusChanges(changesBuilder -> changesBuilder)
.resource(resourceBuilder -> resourceBuilder)
.plusStores(storesBuilder -> storesBuilder)
.withoutChanges(true)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic RecordBuilderbuilder()builder factory method for Recordstatic RecordBuildercreate builder for Record instancecopyDeep()static Recordfactory method to create a deep copy of Record@Valid KeyReferenceReference to the Business Unit associated with the Change.Shows the differences in the resource betweenpreviousVersionandversion.@NotNull @Valid LabelgetLabel()Information that describes the resource after the change.@NotNull StringDate and time (UTC) the change was made.@NotNull @Valid ModifiedByInformation about the user or API Client who performed the change.@NotNull @Valid LabelInformation that describes the resource before the change.@NotNull IntegerVersion of the resource before the change.@NotNull @Valid ResourceIdentifierResourceIdentifier of the changed resource.@NotNull @Valid List<KeyReference>@NotNull StringgetType()Indicates the type of change.@NotNull IntegerVersion of the resource after the change.@NotNull Booleantrueif no change was detected.static Recordof()factory methodstatic Recordfactory method to create a shallow copy RecordvoidsetBusinessUnit(KeyReference businessUnit) Reference to the Business Unit associated with the Change.voidsetChanges(Change... changes) Shows the differences in the resource betweenpreviousVersionandversion.voidsetChanges(List<Change> changes) Shows the differences in the resource betweenpreviousVersionandversion.voidInformation that describes the resource after the change.voidsetModifiedAt(String modifiedAt) Date and time (UTC) the change was made.voidsetModifiedBy(ModifiedBy modifiedBy) Information about the user or API Client who performed the change.voidsetPreviousLabel(Label previousLabel) Information that describes the resource before the change.voidsetPreviousVersion(Integer previousVersion) Version of the resource before the change.voidsetResource(ResourceIdentifier resource) ResourceIdentifier of the changed resource.voidsetStores(KeyReference... stores) voidsetStores(List<KeyReference> stores) voidIndicates the type of change.voidsetVersion(Integer version) Version of the resource after the change.voidsetWithoutChanges(Boolean withoutChanges) trueif no change was detected.static com.fasterxml.jackson.core.type.TypeReference<Record>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithRecord(Function<Record, T> helper) accessor map function
-
Method Details
-
getVersion
Version of the resource after the change.
For more information on how the version is incremented, see Optimistic Concurrency Control.
- Returns:
- version
-
getPreviousVersion
Version of the resource before the change.
- Returns:
- previousVersion
-
getType
Indicates the type of change. For creation, update, or deletion, the value is
"ResourceCreated","ResourceUpdated", or"ResourceDeleted"respectively.- Returns:
- type
-
getModifiedBy
Information about the user or API Client who performed the change.
- Returns:
- modifiedBy
-
getModifiedAt
Date and time (UTC) the change was made.
- Returns:
- modifiedAt
-
getLabel
Information that describes the resource after the change.
- Returns:
- label
-
getPreviousLabel
Information that describes the resource before the change.
- Returns:
- previousLabel
-
getChanges
Shows the differences in the resource between
previousVersionandversion.The value is not identical to the actual array of update actions sent and is not limited to update actions (see, for example, Optimistic Concurrency Control).
- Returns:
- changes
-
getResource
ResourceIdentifier of the changed resource.
- Returns:
- resource
-
getStores
- Returns:
- stores
-
getBusinessUnit
Reference to the Business Unit associated with the Change. Only available for B2B-enabled Projects.
- Returns:
- businessUnit
-
getWithoutChanges
trueif no change was detected.The version number of the resource can be increased even without any change in the resource.
- Returns:
- withoutChanges
-
setVersion
Version of the resource after the change.
For more information on how the version is incremented, see Optimistic Concurrency Control.
- Parameters:
version- value to be set
-
setPreviousVersion
Version of the resource before the change.
- Parameters:
previousVersion- value to be set
-
setType
Indicates the type of change. For creation, update, or deletion, the value is
"ResourceCreated","ResourceUpdated", or"ResourceDeleted"respectively.- Parameters:
type- value to be set
-
setModifiedBy
Information about the user or API Client who performed the change.
- Parameters:
modifiedBy- value to be set
-
setModifiedAt
Date and time (UTC) the change was made.
- Parameters:
modifiedAt- value to be set
-
setLabel
Information that describes the resource after the change.
- Parameters:
label- value to be set
-
setPreviousLabel
Information that describes the resource before the change.
- Parameters:
previousLabel- value to be set
-
setChanges
Shows the differences in the resource between
previousVersionandversion.The value is not identical to the actual array of update actions sent and is not limited to update actions (see, for example, Optimistic Concurrency Control).
- Parameters:
changes- values to be set
-
setChanges
Shows the differences in the resource between
previousVersionandversion.The value is not identical to the actual array of update actions sent and is not limited to update actions (see, for example, Optimistic Concurrency Control).
- Parameters:
changes- values to be set
-
setResource
ResourceIdentifier of the changed resource.
- Parameters:
resource- value to be set
-
setStores
- Parameters:
stores- values to be set
-
setStores
- Parameters:
stores- values to be set
-
setBusinessUnit
Reference to the Business Unit associated with the Change. Only available for B2B-enabled Projects.
- Parameters:
businessUnit- value to be set
-
setWithoutChanges
trueif no change was detected.The version number of the resource can be increased even without any change in the resource.
- Parameters:
withoutChanges- value to be set
-
of
factory method- Returns:
- instance of Record
-
of
factory method to create a shallow copy Record- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
Record copyDeep() -
deepCopy
factory method to create a deep copy of Record- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for Record- Returns:
- builder
-
builder
create builder for Record instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withRecord
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
-