public class HalLinker extends Object
| Modifier and Type | Field and Description | 
|---|---|
| protected Hal | hal | 
| protected HalResource<?> | resourceThe HalResource on which the links are constructed | 
| Constructor and Description | 
|---|
| HalLinker(Hal hal,
         HalResource<?> resource) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | createLink(HalRelation rel,
          String... pathParams)Creates a link in a given relation. | 
| Set<HalRelation> | getLinkedRelations() | 
| Set<String> | getLinkedResourceIdsByRelation(HalRelation relation) | 
| void | mergeLinks(HalResource<?> embedded)merge the links of an embedded resource into this linker. | 
| List<HalResource<?>> | resolve(HalRelation relation,
       ProcessEngine processEngine)Resolves a relation. | 
protected final Hal hal
protected final HalResource<?> resource
public HalLinker(Hal hal, HalResource<?> resource)
public void createLink(HalRelation rel, String... pathParams)
rel - the HalRelation for which a link should be constructedpathParams - the path params to populate the url template with.public Set<HalRelation> getLinkedRelations()
public Set<String> getLinkedResourceIdsByRelation(HalRelation relation)
public List<HalResource<?>> resolve(HalRelation relation, ProcessEngine processEngine)
relation - the relation to resolveprocessEngine - the process engine to useRuntimeException - if no HalLinkResolver can be found for the linked resource type.public void mergeLinks(HalResource<?> embedded)
embedded - the embedded resource for which the links should be merged into this linker.Copyright © 2018. All rights reserved.