public 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 Details

    • getVersion

      @NotNull @NotNull Integer getVersion()

      Version of the resource after the change.

      For more information on how the version is incremented, see Optimistic Concurrency Control.

      Returns:
      version
    • getPreviousVersion

      @NotNull @NotNull Integer getPreviousVersion()

      Version of the resource before the change.

      Returns:
      previousVersion
    • getType

      @NotNull @NotNull String getType()

      Indicates the type of change. For creation, update, or deletion, the value is "ResourceCreated", "ResourceUpdated", or "ResourceDeleted" respectively.

      Returns:
      type
    • getModifiedBy

      @NotNull @Valid @NotNull @Valid ModifiedBy getModifiedBy()

      Information about the user or API Client who performed the change.

      Returns:
      modifiedBy
    • getModifiedAt

      @NotNull @NotNull String getModifiedAt()

      Date and time (UTC) the change was made.

      Returns:
      modifiedAt
    • getLabel

      @NotNull @Valid @NotNull @Valid Label getLabel()

      Information that describes the resource after the change.

      Returns:
      label
    • getPreviousLabel

      @NotNull @Valid @NotNull @Valid Label getPreviousLabel()

      Information that describes the resource before the change.

      Returns:
      previousLabel
    • getChanges

      @NotNull @Valid @NotNull @Valid List<Change> getChanges()

      Shows the differences in the resource between previousVersion and version.

      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

      @NotNull @Valid @NotNull @Valid ResourceIdentifier getResource()

      ResourceIdentifier of the changed resource.

      Returns:
      resource
    • getStores

      @NotNull @Valid @NotNull @Valid List<KeyReference> getStores()

      References to the Stores associated with the Change.

      Returns:
      stores
    • getBusinessUnit

      @Valid @Valid KeyReference getBusinessUnit()

      Reference to the Business Unit associated with the Change.

      Returns:
      businessUnit
    • getWithoutChanges

      @NotNull @NotNull Boolean 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

      void setVersion(Integer version)

      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

      void setPreviousVersion(Integer previousVersion)

      Version of the resource before the change.

      Parameters:
      previousVersion - value to be set
    • setType

      void setType(String type)

      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

      void setModifiedBy(ModifiedBy modifiedBy)

      Information about the user or API Client who performed the change.

      Parameters:
      modifiedBy - value to be set
    • setModifiedAt

      void setModifiedAt(String modifiedAt)

      Date and time (UTC) the change was made.

      Parameters:
      modifiedAt - value to be set
    • setLabel

      void setLabel(Label label)

      Information that describes the resource after the change.

      Parameters:
      label - value to be set
    • setPreviousLabel

      void setPreviousLabel(Label previousLabel)

      Information that describes the resource before the change.

      Parameters:
      previousLabel - value to be set
    • setChanges

      void setChanges(Change... changes)

      Shows the differences in the resource between previousVersion and version.

      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

      void setChanges(List<Change> changes)

      Shows the differences in the resource between previousVersion and version.

      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

      void setResource(ResourceIdentifier resource)

      ResourceIdentifier of the changed resource.

      Parameters:
      resource - value to be set
    • setStores

      void setStores(KeyReference... stores)

      References to the Stores associated with the Change.

      Parameters:
      stores - values to be set
    • setStores

      void setStores(List<KeyReference> stores)

      References to the Stores associated with the Change.

      Parameters:
      stores - values to be set
    • setBusinessUnit

      void setBusinessUnit(KeyReference businessUnit)

      Reference to the Business Unit associated with the Change.

      Parameters:
      businessUnit - value to be set
    • setWithoutChanges

      void setWithoutChanges(Boolean withoutChanges)

      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

      static Record of()
      factory method
      Returns:
      instance of Record
    • of

      static Record of(Record template)
      factory method to create a shallow copy Record
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      @Nullable static Record deepCopy(@Nullable Record template)
      factory method to create a deep copy of Record
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static RecordBuilder builder()
      builder factory method for Record
      Returns:
      builder
    • builder

      static RecordBuilder builder(Record template)
      create builder for Record instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withRecord

      default <T> T withRecord(Function<Record,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<Record> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference