Class HalUtil


  • @ProviderType
    public final class HalUtil
    extends Object
    Utility class for HAL resources.
    • Method Detail

      • getAllLinks

        public static com.google.common.collect.ListMultimap<String,​Link> getAllLinks​(HalResource hal)
        Returns all links in a HAL resource and its embedded resourcess except CURI links.
        Parameters:
        hal - HAL resource
        Returns:
        Map of Relations and Links
      • getAllLinks

        public static com.google.common.collect.ListMultimap<String,​Link> getAllLinks​(HalResource hal,
                                                                                            com.google.common.base.Predicate<org.apache.commons.lang3.tuple.Pair<String,​Link>> predicate)
        Returns all links in a HAL resource and its embedded resources except CURI links fitting the given predicate.
        Parameters:
        hal - HAL resource
        predicate - Predicate to filter
        Returns:
        Map of Relations and Links
      • getAllLinksForRelation

        public static List<Link> getAllLinksForRelation​(HalResource hal,
                                                        String relation)
        Returns all links in a HAL resource and its embedded resources fitting the supplied relation.
        Parameters:
        hal - HAL resource
        relation - Link relation
        Returns:
        List of all fitting links