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