Interface RestEntityFactory
-
- All Known Implementing Classes:
DefaultRestEntityFactory
@ExperimentalApi public interface RestEntityFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <T> RestEntity<T>
create(T entity)
Creates a RestEntity that wraps the provided entity.<T> RestEntity<T>
create(T entity, boolean graphql)
Creates a RestEntity that wraps the provided entity.
-
-
-
Method Detail
-
create
default <T> RestEntity<T> create(T entity)
Creates a RestEntity that wraps the provided entity. All of the fields on the entity that have been annotated with JsonProperty will be available in the resultant RestEntities properties map.Any fields referenced by the entity that have the RestEnrichable annotation will also be converted to RestEntities.
Fields annotated with JsonProperty that implement Iterable will have their contents converted to RestEntities if the content class has the RestEnrichable annotation. Likewise Maps will have their values converted.
- Parameters:
entity
- The entity to wrap- Returns:
- a RestEntity that wraps the entity exposing it fields in the properties map
- Since:
- 6.12.0
-
create
<T> RestEntity<T> create(T entity, boolean graphql)
Creates a RestEntity that wraps the provided entity. All of the fields on the entity that have been annotated with JsonProperty will be available in the resultant RestEntities properties map.Any fields referenced by the entity that have the RestEnrichable annotation will also be converted to RestEntities.
Fields annotated with JsonProperty that implement Iterable will have their contents converted to RestEntities if the content class has the RestEnrichable annotation. Likewise Maps will have their values converted.
- Parameters:
entity
- The entity to wrapgraphql
- True to include fields with the {@see GraphQLName} annotation- Returns:
- a RestEntity that wraps the entity exposing it fields in the properties map
- Since:
- 6.12.0
-
-