Class AbstractLinkEnricher
- java.lang.Object
-
- com.atlassian.confluence.plugins.restapi.enrich.AbstractLinkEnricher
-
- Direct Known Subclasses:
ContentEnricher,RestListLinkEnricher,SpaceEnricher
public class AbstractLinkEnricher extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected GraphQLgraphqlprotected RestNavigationServicenavigationServiceprotected static StringORIGINAL_LINKS_PROPERTYprotected static StringSELF_LINK
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractLinkEnricher(RestNavigationService navigationService, GraphQL graphql)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidenrichLinks(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 voidenrichWithLink(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.RestNavigationnavigation()
-
-
-
Field Detail
-
SELF_LINK
protected static final String SELF_LINK
- See Also:
- Constant Field Values
-
ORIGINAL_LINKS_PROPERTY
protected static final String ORIGINAL_LINKS_PROPERTY
- See Also:
- Constant Field Values
-
navigationService
protected final RestNavigationService navigationService
-
graphql
protected final GraphQL graphql
-
-
Constructor Detail
-
AbstractLinkEnricher
protected AbstractLinkEnricher(RestNavigationService navigationService, GraphQL graphql)
-
-
Method Detail
-
navigation
public RestNavigation navigation()
-
getEnrichedPropertyTypes
protected @NonNull Map<String,Type> getEnrichedPropertyTypes(String... linkTypes)
Get the 'links' property type that a link enricher provides.- Since:
- 6.12.0
-
enrichLinks
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.- Parameters:
entity-schemaType-- Since:
- 6.12.0
-
enrichWithLink
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. Will not add a link if linkUrl is null- Parameters:
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 graphql- Since:
- 6.12.0
-
-