public class AbstractLinkEnricher extends Object
Modifier and Type | Field and Description |
---|---|
protected GraphQL |
graphql |
protected RestNavigationService |
navigationService |
protected static String |
ORIGINAL_LINKS_PROPERTY |
protected static String |
SELF_LINK |
Modifier | Constructor and Description |
---|---|
protected |
AbstractLinkEnricher(RestNavigationService navigationService,
GraphQL graphql) |
Modifier and Type | Method and Description |
---|---|
protected void |
enrichLinks(RestObject entity,
SchemaType schemaType)
Removes the "links" Map<LinkType,Link> from a RestObject and replaces it with a "_links" Map<String,String>
containing the same set of urls.
|
protected void |
enrichWithLink(RestObject restObject,
String linkKey,
String linkUrl,
SchemaType schemaType)
Adds a link to an immutable _links map, creating the map if it doesn't already exist.
|
protected @NonNull Map<String,Type> |
getEnrichedPropertyTypes(String... linkTypes)
Get the 'links' property type that a link enricher provides.
|
RestNavigation |
navigation() |
protected static final String SELF_LINK
protected static final String ORIGINAL_LINKS_PROPERTY
protected final RestNavigationService navigationService
protected final GraphQL graphql
protected AbstractLinkEnricher(RestNavigationService navigationService, GraphQL graphql)
public RestNavigation navigation()
protected @NonNull Map<String,Type> getEnrichedPropertyTypes(String... linkTypes)
protected void enrichLinks(RestObject entity, SchemaType schemaType)
entity
- schemaType
- protected void enrichWithLink(RestObject restObject, String linkKey, String linkUrl, SchemaType schemaType)
restObject
- object to add a link tolinkKey
- key of the link which is being addedlinkUrl
- url of the link which is being added (to be successfully added, link must have non-null linkUrl)schemaType
- rest or graphqlCopyright © 2003–2019 Atlassian. All rights reserved.