Class DefaultDeltaResult

java.lang.Object
com.helixframework.delta.internal.DefaultDeltaResult
All Implemented Interfaces:
DeltaResult

public final class DefaultDeltaResult extends Object implements DeltaResult
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultDeltaResult(com.fasterxml.jackson.databind.ObjectMapper mapper, String deltaId, Instant createdAt, DeltaSummary summary, com.fasterxml.jackson.databind.JsonNode projection, List<DeltaChange> changes, com.fasterxml.jackson.databind.JsonNode afterDocument)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the ordered atomic changes that make up this delta.
    Returns when the delta result was created.
    Returns a generated identifier for this delta result.
    Returns the serialized delta format version.
    boolean
    Returns whether the compared documents differ.
    com.fasterxml.jackson.databind.JsonNode
    Returns the minimal changed-only projection, or a null node when no projection is available.
    Returns summary counts derived from the atomic change list.
    com.fasterxml.jackson.databind.JsonNode
    Serializes this result into the stable Helix Delta JSON shape.
    Optional<com.fasterxml.jackson.databind.JsonNode>
    Returns a JSON Patch representation when every change can be expressed as RFC 6902 add/remove/replace operations.
    Optional<com.fasterxml.jackson.databind.JsonNode>
    Returns a JSON Merge Patch representation when it can be produced without losing semantics.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DefaultDeltaResult

      public DefaultDeltaResult(com.fasterxml.jackson.databind.ObjectMapper mapper, String deltaId, Instant createdAt, DeltaSummary summary, com.fasterxml.jackson.databind.JsonNode projection, List<DeltaChange> changes, com.fasterxml.jackson.databind.JsonNode afterDocument)
  • Method Details

    • formatVersion

      public String formatVersion()
      Description copied from interface: DeltaResult
      Returns the serialized delta format version.
      Specified by:
      formatVersion in interface DeltaResult
      Returns:
      format version identifier
    • deltaId

      public String deltaId()
      Description copied from interface: DeltaResult
      Returns a generated identifier for this delta result.
      Specified by:
      deltaId in interface DeltaResult
      Returns:
      delta identifier
    • createdAt

      public Instant createdAt()
      Description copied from interface: DeltaResult
      Returns when the delta result was created.
      Specified by:
      createdAt in interface DeltaResult
      Returns:
      creation timestamp
    • summary

      public DeltaSummary summary()
      Description copied from interface: DeltaResult
      Returns summary counts derived from the atomic change list.
      Specified by:
      summary in interface DeltaResult
      Returns:
      delta summary
    • projection

      public com.fasterxml.jackson.databind.JsonNode projection()
      Description copied from interface: DeltaResult
      Returns the minimal changed-only projection, or a null node when no projection is available.
      Specified by:
      projection in interface DeltaResult
      Returns:
      changed-only projection
    • changes

      public List<DeltaChange> changes()
      Description copied from interface: DeltaResult
      Returns the ordered atomic changes that make up this delta.
      Specified by:
      changes in interface DeltaResult
      Returns:
      immutable change list
    • toJsonPatch

      public Optional<com.fasterxml.jackson.databind.JsonNode> toJsonPatch()
      Description copied from interface: DeltaResult
      Returns a JSON Patch representation when every change can be expressed as RFC 6902 add/remove/replace operations.
      Specified by:
      toJsonPatch in interface DeltaResult
      Returns:
      optional JSON Patch document
    • toMergePatch

      public Optional<com.fasterxml.jackson.databind.JsonNode> toMergePatch()
      Description copied from interface: DeltaResult
      Returns a JSON Merge Patch representation when it can be produced without losing semantics.
      Specified by:
      toMergePatch in interface DeltaResult
      Returns:
      optional JSON Merge Patch document
    • toJson

      public com.fasterxml.jackson.databind.JsonNode toJson()
      Description copied from interface: DeltaResult
      Serializes this result into the stable Helix Delta JSON shape.
      Specified by:
      toJson in interface DeltaResult
      Returns:
      serialized delta JSON
    • hasChanges

      public boolean hasChanges()
      Description copied from interface: DeltaResult
      Returns whether the compared documents differ.
      Specified by:
      hasChanges in interface DeltaResult
      Returns:
      true when at least one change exists