Class DefaultDeltaResult
java.lang.Object
com.helixframework.delta.internal.DefaultDeltaResult
- All Implemented Interfaces:
DeltaResult
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultDeltaResult(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 TypeMethodDescriptionchanges()Returns the ordered atomic changes that make up this delta.Returns when the delta result was created.deltaId()Returns a generated identifier for this delta result.Returns the serialized delta format version.booleanReturns whether the compared documents differ.com.fasterxml.jackson.databind.JsonNodeReturns the minimal changed-only projection, or a null node when no projection is available.summary()Returns summary counts derived from the atomic change list.com.fasterxml.jackson.databind.JsonNodetoJson()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.
-
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
Description copied from interface:DeltaResultReturns the serialized delta format version.- Specified by:
formatVersionin interfaceDeltaResult- Returns:
- format version identifier
-
deltaId
Description copied from interface:DeltaResultReturns a generated identifier for this delta result.- Specified by:
deltaIdin interfaceDeltaResult- Returns:
- delta identifier
-
createdAt
Description copied from interface:DeltaResultReturns when the delta result was created.- Specified by:
createdAtin interfaceDeltaResult- Returns:
- creation timestamp
-
summary
Description copied from interface:DeltaResultReturns summary counts derived from the atomic change list.- Specified by:
summaryin interfaceDeltaResult- Returns:
- delta summary
-
projection
public com.fasterxml.jackson.databind.JsonNode projection()Description copied from interface:DeltaResultReturns the minimal changed-only projection, or a null node when no projection is available.- Specified by:
projectionin interfaceDeltaResult- Returns:
- changed-only projection
-
changes
Description copied from interface:DeltaResultReturns the ordered atomic changes that make up this delta.- Specified by:
changesin interfaceDeltaResult- Returns:
- immutable change list
-
toJsonPatch
Description copied from interface:DeltaResultReturns a JSON Patch representation when every change can be expressed as RFC 6902 add/remove/replace operations.- Specified by:
toJsonPatchin interfaceDeltaResult- Returns:
- optional JSON Patch document
-
toMergePatch
Description copied from interface:DeltaResultReturns a JSON Merge Patch representation when it can be produced without losing semantics.- Specified by:
toMergePatchin interfaceDeltaResult- Returns:
- optional JSON Merge Patch document
-
toJson
public com.fasterxml.jackson.databind.JsonNode toJson()Description copied from interface:DeltaResultSerializes this result into the stable Helix Delta JSON shape.- Specified by:
toJsonin interfaceDeltaResult- Returns:
- serialized delta JSON
-
hasChanges
public boolean hasChanges()Description copied from interface:DeltaResultReturns whether the compared documents differ.- Specified by:
hasChangesin interfaceDeltaResult- Returns:
truewhen at least one change exists
-