Class DefaultApiRestEntityFactory
java.lang.Object
com.atlassian.confluence.api.impl.DefaultApiRestEntityFactory
- All Implemented Interfaces:
ApiRestEntityFactory
- Since:
- 9.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.confluence.core.ApiRestEntityFactory
ApiRestEntityFactory.SchemaType
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultApiRestEntityFactory
(ContentFactory contentFactory, SpaceFactory spaceFactory, RestEntityEnrichmentManager restEntityEnrichmentManager) -
Method Summary
Modifier and TypeMethodDescriptionbuildRestEntityFrom
(ContentEntityObject entity, Expansions expansions) Build a REST API entity from a ContentEntityObject.buildRestEntityFrom
(Space space, Expansions expansions) Build a REST API entity from a hibernate Space object.buildRestEntityFromContent
(Iterable<? extends ContentEntityObject> entities, Expansions expansions) Build a list of REST API entity objects from ContentEntityObject objects.buildRestEntityFromSpaces
(Iterable<Space> spaces, Expansions expansions) Build a list of REST API entity objects from hibernate Space objects.convertAndEnrich
(Object entity, ApiRestEntityFactory.SchemaType schemaType) Converts the given entity into a RestEntity if the entity has the RestEnrichable annotation or is a PageResponse that contains RestEnrichable entities.getEnrichedPropertyTypes
(Type type, boolean root) Get the types of the properties that may possibly be provided by the enrichers.boolean
isEnrichableEntity
(Class entityType) Get whether an object type can be enriched using a RestEntity.boolean
isEnrichableList
(Class listType) Get whether an object type can be enriched using a RestList.
-
Constructor Details
-
DefaultApiRestEntityFactory
public DefaultApiRestEntityFactory(ContentFactory contentFactory, SpaceFactory spaceFactory, RestEntityEnrichmentManager restEntityEnrichmentManager)
-
-
Method Details
-
buildRestEntityFrom
Description copied from interface:ApiRestEntityFactory
Build a REST API entity from a ContentEntityObject.- Specified by:
buildRestEntityFrom
in interfaceApiRestEntityFactory
- Parameters:
entity
- The entity objectexpansions
- The expansions to apply to the returned data- Returns:
- The REST API entity
-
buildRestEntityFrom
Description copied from interface:ApiRestEntityFactory
Build a REST API entity from a hibernate Space object.- Specified by:
buildRestEntityFrom
in interfaceApiRestEntityFactory
expansions
- The expansions to apply to the returned data- Returns:
- The REST API entity
-
buildRestEntityFromContent
public Iterable<RestEntity> buildRestEntityFromContent(Iterable<? extends ContentEntityObject> entities, Expansions expansions) Description copied from interface:ApiRestEntityFactory
Build a list of REST API entity objects from ContentEntityObject objects.- Specified by:
buildRestEntityFromContent
in interfaceApiRestEntityFactory
expansions
- The expansions to apply to the returned data- Returns:
- The REST API entity list
-
buildRestEntityFromSpaces
public Iterable<RestEntity> buildRestEntityFromSpaces(Iterable<Space> spaces, Expansions expansions) Description copied from interface:ApiRestEntityFactory
Build a list of REST API entity objects from hibernate Space objects.- Specified by:
buildRestEntityFromSpaces
in interfaceApiRestEntityFactory
expansions
- The expansions to apply to the returned data- Returns:
- The REST API entity list
-
isEnrichableList
Description copied from interface:ApiRestEntityFactory
Get whether an object type can be enriched using a RestList.- Specified by:
isEnrichableList
in interfaceApiRestEntityFactory
-
isEnrichableEntity
Description copied from interface:ApiRestEntityFactory
Get whether an object type can be enriched using a RestEntity.- Specified by:
isEnrichableEntity
in interfaceApiRestEntityFactory
-
getEnrichedPropertyTypes
Description copied from interface:ApiRestEntityFactory
Get the types of the properties that may possibly be provided by the enrichers. This is used to populate the graph-ql schema.- Specified by:
getEnrichedPropertyTypes
in interfaceApiRestEntityFactory
- Parameters:
type
- The type of the object being enriched- Returns:
- A map of property names to property types
-
convertAndEnrich
Description copied from interface:ApiRestEntityFactory
Converts the given entity into a RestEntity if the entity has the RestEnrichable annotation or is a PageResponse that contains RestEnrichable entities.- Specified by:
convertAndEnrich
in interfaceApiRestEntityFactory
- Parameters:
entity
- the entity to enrichschemaType
- rest or graphql- Returns:
- a converted rest entity or the entity that was given
-