Package com.adobe.granite.rest.converter
Interface ResourceConverter<T>
-
- All Known Implementing Classes:
AbstractPageableSirenConverter,AbstractSirenConverter
@ConsumerType public interface ResourceConverter<T>
ResourceConverteris an interface describing a Java class that can perform Object-to-Object conversions between model data objects and a representationTof those objects that is suitable for rendering.Implementors should ensure that a ResourceConverter can be retrieved adapting a
Resourceby implementing anAdapterFactory.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TtoEntity(ResourceConverterContext context)Converts aresourceinto an object of typeTto represent an entity.TtoSubEntity(ResourceConverterContext context)Converts aresourceto an object of typeTto represent a sub-entity.
-
-
-
Method Detail
-
toEntity
T toEntity(ResourceConverterContext context) throws ResourceConverterException
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
T toSubEntity(ResourceConverterContext context) throws ResourceConverterException
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
-
-