Interface HalDifference


  • @ProviderType
    public interface HalDifference
    Represents a single difference detected by the HalComparison when comparing two trees of HalResources.

    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
    • 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
      • 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)