public class DefaultApiRestEntityFactory extends Object implements ApiRestEntityFactory
ApiRestEntityFactory.SchemaType| Constructor and Description |
|---|
DefaultApiRestEntityFactory(ContentFactory contentFactory,
SpaceFactory spaceFactory,
RestEntityEnrichmentManager restEntityEnrichmentManager) |
| Modifier and Type | Method and Description |
|---|---|
RestEntity |
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.
|
public DefaultApiRestEntityFactory(ContentFactory contentFactory, SpaceFactory spaceFactory, RestEntityEnrichmentManager restEntityEnrichmentManager)
public RestEntity buildRestEntityFrom(ContentEntityObject entity, Expansions expansions)
ApiRestEntityFactorybuildRestEntityFrom in interface ApiRestEntityFactoryentity - The entity objectexpansions - The expansions to apply to the returned datapublic RestEntity<Space> buildRestEntityFrom(Space space, Expansions expansions)
ApiRestEntityFactorybuildRestEntityFrom in interface ApiRestEntityFactoryexpansions - The expansions to apply to the returned datapublic Iterable<RestEntity> buildRestEntityFromContent(Iterable<? extends ContentEntityObject> entities, Expansions expansions)
ApiRestEntityFactorybuildRestEntityFromContent in interface ApiRestEntityFactoryexpansions - The expansions to apply to the returned datapublic Iterable<RestEntity> buildRestEntityFromSpaces(Iterable<Space> spaces, Expansions expansions)
ApiRestEntityFactorybuildRestEntityFromSpaces in interface ApiRestEntityFactoryexpansions - The expansions to apply to the returned datapublic boolean isEnrichableList(Class listType)
ApiRestEntityFactoryisEnrichableList in interface ApiRestEntityFactorypublic boolean isEnrichableEntity(Class entityType)
ApiRestEntityFactoryisEnrichableEntity in interface ApiRestEntityFactorypublic @NonNull Map<String,Type> getEnrichedPropertyTypes(Type type, boolean root)
ApiRestEntityFactorygetEnrichedPropertyTypes in interface ApiRestEntityFactorytype - The type of the object being enrichedpublic Object convertAndEnrich(Object entity, ApiRestEntityFactory.SchemaType schemaType)
ApiRestEntityFactoryconvertAndEnrich in interface ApiRestEntityFactoryentity - the entity to enrichschemaType - rest or graphqlCopyright © 2003–2022 Atlassian. All rights reserved.