Class LinkUtil


  • public class LinkUtil
    extends Object
    Utility class for links
    Author:
    vanderw
    • Constructor Detail

      • LinkUtil

        public LinkUtil()
    • Method Detail

      • filterSelf

        public static List<org.springframework.hateoas.Link> filterSelf​(List<org.springframework.hateoas.Link> links)
        Filters self from the links
        Parameters:
        links - a list of the links
        Returns:
        a list of filtered links
      • removeLink

        public static List<org.springframework.hateoas.Link> removeLink​(List<org.springframework.hateoas.Link> links,
                                                                        String name)
      • getSelf

        public static org.springframework.hateoas.Link getSelf​(List<org.springframework.hateoas.Link> links)
        Gets the self link
        Parameters:
        links - a list of links
        Returns:
        the link containing the self
      • getSelf

        public static org.springframework.hateoas.Link getSelf​(org.springframework.hateoas.EntityModel<?> model)
        Gets the self
        Parameters:
        model - the entitymodel
        Returns:
        the Link identifying the self
      • getSelfHref

        public static String getSelfHref​(org.springframework.hateoas.EntityModel<?> model)
      • removeProjectionReference

        public static String removeProjectionReference​(String href)
        Removes the projection reference fron the href ( {?projection}
        Parameters:
        href - the href given
        Returns:
        a string with projections removed