Package com.adobe.granite.rest.converter
Interface ResourceConverter<T>
- All Known Implementing Classes:
AbstractPageableSirenConverter,AbstractSirenConverter
ResourceConverter is an interface describing a Java class that can perform
Object-to-Object conversions between model data objects and a representation
T of those objects that is suitable for rendering.
Implementors should ensure that a ResourceConverter can be retrieved adapting
a Resource by implementing an
AdapterFactory.
-
Method Summary
Modifier and TypeMethodDescriptiontoEntity(ResourceConverterContext context) Converts aresourceinto an object of typeTto represent an entity.toSubEntity(ResourceConverterContext context) Converts aresourceto an object of typeTto represent a sub-entity.
-
Method Details
-
toEntity
Converts aresourceinto an object of typeTto represent an entity.- Parameters:
context- Converter context- Returns:
- Converted object of type T
- Throws:
ResourceConverterException- if an error occurs during conversion
-
toSubEntity
Converts aresourceto an object of typeTto represent a sub-entity. The sub-entity might only contain a subset of information and might be used to represent child elements of a collection.- Parameters:
context- Converter context- Returns:
- Converted sub-object of type T
- Throws:
ResourceConverterException- if an error occurs during conversion
-