public interface ApiRestEntityFactory
The produced REST entities should be serialized using an ObjectMapper produced by CustomSerializerModuleFactory
Modifier and Type | Interface and Description |
---|---|
static class |
ApiRestEntityFactory.SchemaType |
Modifier and Type | Method and 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.
|
Object |
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.
|
@NonNull Map<String,Type> |
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.
|
RestEntity<Content> buildRestEntityFrom(ContentEntityObject entity, Expansions expansions)
entity
- The entity objectexpansions
- The expansions to apply to the returned dataRestEntity<Space> buildRestEntityFrom(Space space, Expansions expansions)
entity
- The entity objectexpansions
- The expansions to apply to the returned dataIterable<RestEntity> buildRestEntityFromContent(Iterable<? extends ContentEntityObject> entities, Expansions expansions)
entity
- The entity objectsexpansions
- The expansions to apply to the returned dataIterable<RestEntity> buildRestEntityFromSpaces(Iterable<Space> spaces, Expansions expansions)
entity
- The entity objectsexpansions
- The expansions to apply to the returned databoolean isEnrichableList(Class listType)
boolean isEnrichableEntity(Class entityType)
@NonNull Map<String,Type> getEnrichedPropertyTypes(Type type, boolean root)
type
- The type of the object being enrichedObject convertAndEnrich(Object entity, ApiRestEntityFactory.SchemaType schemaType)
entity
- the entity to enrichschemaType
- rest or graphqlCopyright © 2003–2020 Atlassian. All rights reserved.