Package org.dizitart.no2.common.mapper
Interface EntityConverter<T>
- Type Parameters:
T- the type parameter
- All Superinterfaces:
AutoCloseable,NitritePlugin
The
EntityConverter interface is used to convert
an entity of type EntityConverter into a database Document
and vice versa.- Since:
- 4.0
- Author:
- Anindya Chatterjee
-
Method Summary
Modifier and TypeMethodDescriptionfromDocument(Document document, NitriteMapper nitriteMapper) Converts aDocumentto an entity of typeEntityConverter.Gets the entity type.default voidinitialize(NitriteConfig nitriteConfig) Initializes the plugin instance.toDocument(T entity, NitriteMapper nitriteMapper) Converts the entity to aDocument.Methods inherited from interface org.dizitart.no2.common.module.NitritePlugin
close
-
Method Details
-
getEntityType
Gets the entity type.- Returns:
- the entity type
-
toDocument
Converts the entity to aDocument.- Parameters:
entity- the entitynitriteMapper- the nitrite mapper- Returns:
- the document
-
fromDocument
Converts aDocumentto an entity of typeEntityConverter.- Parameters:
document- the documentnitriteMapper- the nitrite mapper- Returns:
- the t
-
initialize
Description copied from interface:NitritePluginInitializes the plugin instance.- Specified by:
initializein interfaceNitritePlugin- Parameters:
nitriteConfig- the nitrite config
-