Package org.dizitart.no2.common.mapper
Class SimpleNitriteMapper
java.lang.Object
org.dizitart.no2.common.mapper.SimpleNitriteMapper
- All Implemented Interfaces:
AutoCloseable,NitriteMapper,NitritePlugin
A
NitriteMapper based on EntityConverter implementation.
This mapper is used by default in nitrite. It uses EntityConverter to
convert an object and vice versa.
- Since:
- 4.0
- Author:
- Anindya Chatterjee.
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleNitriteMapper(Class<?>... valueTypes) Instantiates a newSimpleNitriteMapper. -
Method Summary
Modifier and TypeMethodDescriptionvoidinitialize(NitriteConfig nitriteConfig) Initializes the plugin instance.voidregisterEntityConverter(EntityConverter<?> entityConverter) Registers anEntityConverter.<Source,Target>
ObjecttryConvert(Source source, Class<Target> type) Tries to convert an object of typeSourceto an object of typeTarget.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.dizitart.no2.common.module.NitritePlugin
close
-
Constructor Details
-
SimpleNitriteMapper
Instantiates a newSimpleNitriteMapper.- Parameters:
valueTypes- the value types
-
-
Method Details
-
tryConvert
Description copied from interface:NitriteMapperTries to convert an object of typeSourceto an object of typeTarget. If the conversion is not possible, it will return the source object.- Specified by:
tryConvertin interfaceNitriteMapper- Type Parameters:
Source- the type parameterTarget- the type parameter- Parameters:
source- the sourcetype- the type- Returns:
- the target
-
registerEntityConverter
Registers anEntityConverter.- Parameters:
entityConverter- the entity converter
-
initialize
Description copied from interface:NitritePluginInitializes the plugin instance.- Specified by:
initializein interfaceNitritePlugin- Parameters:
nitriteConfig- the nitrite config
-