Package io.wcm.caravan.hal.comparison
Interface HalDifference
-
@ProviderType public interface HalDifference
Represents a single difference detected by theHalComparison
when comparing two trees ofHalResource
s.Some examples of changes that are represented by a
HalDifference
instance:- a JSON property in the resource state was added, removed or modified
- a link was added or removed
- an embedded resource was added or removed
- the order of links or embedded resource has changed
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
HalDifference.ChangeType
defines the different types of modifications that can be detectedstatic class
HalDifference.EntityType
defines the different kind of HAL/JSON elements that are compared
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description com.fasterxml.jackson.databind.JsonNode
getActualJson()
HalDifference.ChangeType
getChangeType()
String
getDescription()
HalDifference.EntityType
getEntityType()
com.fasterxml.jackson.databind.JsonNode
getExpectedJson()
HalComparisonContext
getHalContext()
Describes the "relational" location of the resource (or property) that was reported to be different.
-
-
-
Method Detail
-
getHalContext
HalComparisonContext getHalContext()
Describes the "relational" location of the resource (or property) that was reported to be different.- Returns:
- a
HalComparisonContext
that can be used to group or filter the results based on their relations and context
-
getChangeType
HalDifference.ChangeType getChangeType()
- Returns:
- what kind of modification was detected
-
getEntityType
HalDifference.EntityType getEntityType()
- Returns:
- what kind of HAL/JSON element was found to be different
-
getDescription
String getDescription()
- Returns:
- a text that describes why the difference was reported
-
getExpectedJson
com.fasterxml.jackson.databind.JsonNode getExpectedJson()
- Returns:
- a formatted JSON string of the resource, link, property or state object that was expected (or an empty string if the value only exists in the actual resource)
-
getActualJson
com.fasterxml.jackson.databind.JsonNode getActualJson()
- Returns:
- a formatted JSON string of the resource, link, property or state object that was actually found (or an empty string if the value only exists in the expected resource)
-
-