Package com.atlassian.confluence.core
Interface ApiRestEntityFactory
- 
- All Known Implementing Classes:
- DefaultApiRestEntityFactory
 
 public interface ApiRestEntityFactoryFactory for producing REST entities for serialization to Json, and entity property enrichment.The produced REST entities should be serialized using an ObjectMapper produced by CustomSerializerModuleFactory- Since:
- 6.12.0
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static classApiRestEntityFactory.SchemaType
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description RestEntity<Content>buildRestEntityFrom(ContentEntityObject entity, Expansions expansions)Build a REST API entity from a ContentEntityObject.RestEntity<Space>buildRestEntityFrom(Space space, Expansions expansions)Build a REST API entity from a hibernate Space object.Iterable<RestEntity>buildRestEntityFromContent(Iterable<? extends ContentEntityObject> entities, Expansions expansions)Build a list of REST API entity objects from ContentEntityObject objects.Iterable<RestEntity>buildRestEntityFromSpaces(Iterable<Space> spaces, Expansions expansions)Build a list of REST API entity objects from hibernate Space objects.ObjectconvertAndEnrich(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.@NonNull Map<String,Type>getEnrichedPropertyTypes(Type type, boolean root)Get the types of the properties that may possibly be provided by the enrichers.booleanisEnrichableEntity(Class entityType)Get whether an object type can be enriched using a RestEntity.booleanisEnrichableList(Class listType)Get whether an object type can be enriched using a RestList.
 
- 
- 
- 
Method Detail- 
buildRestEntityFromRestEntity<Content> buildRestEntityFrom(ContentEntityObject entity, Expansions expansions) Build a REST API entity from a ContentEntityObject.- Parameters:
- entity- The entity object
- expansions- The expansions to apply to the returned data
- Returns:
- The REST API entity
 
 - 
buildRestEntityFromRestEntity<Space> buildRestEntityFrom(Space space, Expansions expansions) Build a REST API entity from a hibernate Space object.- Parameters:
- entity- The entity object
- expansions- The expansions to apply to the returned data
- Returns:
- The REST API entity
 
 - 
buildRestEntityFromContentIterable<RestEntity> buildRestEntityFromContent(Iterable<? extends ContentEntityObject> entities, Expansions expansions) Build a list of REST API entity objects from ContentEntityObject objects.- Parameters:
- entity- The entity objects
- expansions- The expansions to apply to the returned data
- Returns:
- The REST API entity list
 
 - 
buildRestEntityFromSpacesIterable<RestEntity> buildRestEntityFromSpaces(Iterable<Space> spaces, Expansions expansions) Build a list of REST API entity objects from hibernate Space objects.- Parameters:
- entity- The entity objects
- expansions- The expansions to apply to the returned data
- Returns:
- The REST API entity list
 
 - 
isEnrichableListboolean isEnrichableList(Class listType) Get whether an object type can be enriched using a RestList.
 - 
isEnrichableEntityboolean isEnrichableEntity(Class entityType) Get whether an object type can be enriched using a RestEntity.
 - 
getEnrichedPropertyTypes@NonNull Map<String,Type> getEnrichedPropertyTypes(Type type, boolean root) Get the types of the properties that may possibly be provided by the enrichers. This is used to populate the graph-ql schema.- Parameters:
- type- The type of the object being enriched
- Returns:
- A map of property names to property types
 
 - 
convertAndEnrichObject 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.- Parameters:
- entity- the entity to enrich
- schemaType- rest or graphql
- Returns:
- a converted rest entity or the entity that was given
 
 
- 
 
-