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 RecordBuilder
builder()
builder factory method for Recordstatic RecordBuilder
create builder for Record instancestatic Record
factory method to create a deep copy of Record@Valid KeyReference
Reference to the Business Unit associated with the Change.Shows the differences in the resource betweenpreviousVersion
andversion
.@NotNull @Valid Label
getLabel()
Information that describes the resource after the change.@NotNull String
Date and time (UTC) the change was made.@NotNull @Valid ModifiedBy
Information about the user or API Client who performed the change.@NotNull @Valid Label
Information that describes the resource before the change.@NotNull Integer
Version of the resource before the change.@NotNull @Valid ResourceIdentifier
ResourceIdentifier of the changed resource.@NotNull @Valid List<KeyReference>
References to the Stores associated with the Change.@NotNull String
getType()
Indicates the type of change.@NotNull Integer
Version of the resource after the change.@NotNull Boolean
true
if no change was detected.static Record
of()
factory methodstatic Record
factory method to create a shallow copy Recordvoid
setBusinessUnit
(KeyReference businessUnit) Reference to the Business Unit associated with the Change.void
setChanges
(Change... changes) Shows the differences in the resource betweenpreviousVersion
andversion
.void
setChanges
(List<Change> changes) Shows the differences in the resource betweenpreviousVersion
andversion
.void
Information that describes the resource after the change.void
setModifiedAt
(String modifiedAt) Date and time (UTC) the change was made.void
setModifiedBy
(ModifiedBy modifiedBy) Information about the user or API Client who performed the change.void
setPreviousLabel
(Label previousLabel) Information that describes the resource before the change.void
setPreviousVersion
(Integer previousVersion) Version of the resource before the change.void
setResource
(ResourceIdentifier resource) ResourceIdentifier of the changed resource.void
setStores
(KeyReference... stores) References to the Stores associated with the Change.void
setStores
(List<KeyReference> stores) References to the Stores associated with the Change.void
Indicates the type of change.void
setVersion
(Integer version) Version of the resource after the change.void
setWithoutChanges
(Boolean withoutChanges) true
if no change was detected.static com.fasterxml.jackson.core.type.TypeReference<Record>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withRecord
(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
previousVersion
andversion
.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
References to the Stores associated with the Change.
- Returns:
- stores
-
getBusinessUnit
Reference to the Business Unit associated with the Change.
- Returns:
- businessUnit
-
getWithoutChanges
true
if 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
previousVersion
andversion
.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
previousVersion
andversion
.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
References to the Stores associated with the Change.
- Parameters:
stores
- values to be set
-
setStores
References to the Stores associated with the Change.
- Parameters:
stores
- values to be set
-
setBusinessUnit
Reference to the Business Unit associated with the Change.
- Parameters:
businessUnit
- value to be set
-
setWithoutChanges
true
if 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
-
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
-