if ( criteria.isSerialization() ) {
if ( criteria.isSingletonMapper() ) {
// warmup the mapper
mapperProvider.getMapper().write( datas );
}
operations.add( new Operation( criteria.getNbIterations(), result.getResultSer() ) {
@Override
protected void doExecute() {
mapperProvider.getMapper().write( datas );
}
} );
}
if ( criteria.isDeserialization() ) {
final String jsonInput = mapperProvider.getMapper().write( datas );
operations.add( new Operation( criteria.getNbIterations(), result.getResultDeser() ) {
@Override
protected void doExecute() {
mapperProvider.getMapper().read( jsonInput );
}
} );