Interface HalComparisonContext


  • @ProviderType
    public interface HalComparisonContext
    The "relational" location of a resource (or property) within a tree of HalResources, constructed by concatenating the relations and JSON properties to follow from the API entry point.
    • Method Detail

      • getLastRelation

        String getLastRelation()
        Returns:
        the name of the last HAL relation in the path
      • getAllRelations

        List<String> getAllRelations()
        Returns:
        all relations that were followed to get to the context resource
      • getParentResourceWithRelation

        io.wcm.caravan.hal.resource.HalResource getParentResourceWithRelation​(String relation)
        Parameters:
        relation - that was used to embed/link to the resource which is to be found
        Returns:
        the nearest parent of the current context that was linked or embedded with that relation
      • getLastProperyName

        String getLastProperyName()
        Returns:
        the name of the JSON property where a difference was detected (or empty string, if the difference was not in a JSON property)
      • getAllPropertyNames

        List<String> getAllPropertyNames()
        Returns:
        the names of all JSON properties contained in the HAL path (as returned by toString()
      • getExpectedUrl

        String getExpectedUrl()
        Returns:
        the URL where the resource that contains the expected value can be loaded from
      • getActualUrl

        String getActualUrl()
        Returns:
        the URL where the resource that contains the actual value can be loaded from
      • toString

        String toString()
        Overrides:
        toString in class Object
        Returns:
        a string representation of the full HAL path (e.g. /section[1]/item[0] for the first item in the second section linked or embbedded from the entry point)