Interface LinkDiscoverer

All Superinterfaces:
org.springframework.plugin.core.Plugin<MediaType>
All Known Implementing Classes:
AlpsLinkDiscoverer, CollectionJsonLinkDiscoverer, HalFormsLinkDiscoverer, HalLinkDiscoverer, JsonPathLinkDiscoverer, UberLinkDiscoverer

public interface LinkDiscoverer extends org.springframework.plugin.core.Plugin<MediaType>
Interface to allow discovering links by relation type from some source.
Author:
Oliver Gierke
  • Method Details

    • findLinkWithRel

      Optional<Link> findLinkWithRel(LinkRelation relation, String representation)
      Finds a single link with the given LinkRelation in the given String representation.
      Parameters:
      relation - must not be null.
      representation - must not be null.
      Returns:
      the first link with the given relation type found, or Optional.empty() if none was found.
    • findLinkWithRel

      default Optional<Link> findLinkWithRel(String relation, String representation)
      Finds a single link with the given relation type in the given String representation.
      Parameters:
      relation - must not be null or empty.
      representation - must not be null.
      Returns:
      the first Link with the given link relation found, or Optional.empty() if none was found.
    • findRequiredLinkWithRel

      default Link findRequiredLinkWithRel(LinkRelation relation, String representation)
      Finds a single link with the given relation in the given String representation.
      Parameters:
      relation - must not be null.
      representation - must not be null.
      Returns:
      the first link with the given relation type found.
      Throws:
      IllegalArgumentException - if no Link for the given LinkRelation can be found.
    • findLinkWithRel

      Optional<Link> findLinkWithRel(LinkRelation relation, InputStream representation)
      Finds a single link with the given LinkRelation in the given InputStream representation.
      Parameters:
      relation - must not be null.
      representation - must not be null.
      Returns:
      the first Link with the given LinkRelation found, or Optional.empty() if none was found.
    • findLinkWithRel

      default Optional<Link> findLinkWithRel(String relation, InputStream representation)
      Finds a single link with the given relation type in the given InputStream representation.
      Parameters:
      relation - must not be null or empty.
      representation - must not be null.
      Returns:
      the first link with the given relation type found, or Optional.empty() if none was found.
    • findRequiredLinkWithRel

      default Link findRequiredLinkWithRel(LinkRelation relation, InputStream representation)
      Finds a single link with the given relation type in the given InputStream representation.
      Parameters:
      relation - must not be null or empty.
      representation - must not be null.
      Returns:
      the first link with the given relation type found.
      Throws:
      IllegalArgumentException - if no Link for the given LinkRelation can be found.
    • findLinksWithRel

      default Links findLinksWithRel(String relation, String representation)
      Returns all links with the given link relation found in the given String representation.
      Parameters:
      relation - must not be null or empty.
      representation - must not be null.
      Returns:
      will never be null.
    • findLinksWithRel

      Links findLinksWithRel(LinkRelation relation, String representation)
      Returns all links with the given LinkRelation found in the given String representation.
      Parameters:
      relation - must not be null.
      representation - must not be null.
      Returns:
      will never be null.
    • findLinksWithRel

      default Links findLinksWithRel(String relation, InputStream representation)
      Returns all links with the given link relation found in the given InputStream representation.
      Parameters:
      relation - must not be null or empty.
      representation - must not be null.
      Returns:
      will never be null.
    • findLinksWithRel

      Links findLinksWithRel(LinkRelation relation, InputStream representation)
      Returns all links with the given LinkRelation found in the given InputStream representation.
      Parameters:
      relation - must not be null.
      representation - must not be null.
      Returns:
      will never be null.