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)
ApiRestEntityFactory
buildRestEntityFrom
in interface ApiRestEntityFactory
entity
- The entity objectexpansions
- The expansions to apply to the returned datapublic RestEntity<Space> buildRestEntityFrom(Space space, Expansions expansions)
ApiRestEntityFactory
buildRestEntityFrom
in interface ApiRestEntityFactory
expansions
- The expansions to apply to the returned datapublic Iterable<RestEntity> buildRestEntityFromContent(Iterable<? extends ContentEntityObject> entities, Expansions expansions)
ApiRestEntityFactory
buildRestEntityFromContent
in interface ApiRestEntityFactory
expansions
- The expansions to apply to the returned datapublic Iterable<RestEntity> buildRestEntityFromSpaces(Iterable<Space> spaces, Expansions expansions)
ApiRestEntityFactory
buildRestEntityFromSpaces
in interface ApiRestEntityFactory
expansions
- The expansions to apply to the returned datapublic boolean isEnrichableList(Class listType)
ApiRestEntityFactory
isEnrichableList
in interface ApiRestEntityFactory
public boolean isEnrichableEntity(Class entityType)
ApiRestEntityFactory
isEnrichableEntity
in interface ApiRestEntityFactory
public @NonNull Map<String,Type> getEnrichedPropertyTypes(Type type, boolean root)
ApiRestEntityFactory
getEnrichedPropertyTypes
in interface ApiRestEntityFactory
type
- The type of the object being enrichedpublic Object convertAndEnrich(Object entity, ApiRestEntityFactory.SchemaType schemaType)
ApiRestEntityFactory
convertAndEnrich
in interface ApiRestEntityFactory
entity
- the entity to enrichschemaType
- rest or graphqlCopyright © 2003–2023 Atlassian. All rights reserved.
View cookie preferences