Package io.wcm.caravan.hal.resource.util
Class HalUtil
- java.lang.Object
-
- io.wcm.caravan.hal.resource.util.HalUtil
-
@ProviderType public final class HalUtil extends Object
Utility class for HAL resources.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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.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.static List<Link>
getAllLinksForRelation(HalResource hal, String relation)
Returns all links in a HAL resource and its embedded resources fitting the supplied relation.
-
-
-
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 resourcepredicate
- 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 resourcerelation
- Link relation- Returns:
- List of all fitting links
-
-