use of org.simpleflatmapper.map.property.FormatProperty in project SimpleFlatMapper by arnaudroger.
the class FieldMapperToAppendableFactoryTest method testDoubleWithFormatterAppender.
@Test
public void testDoubleWithFormatterAppender() throws Exception {
MappingContextFactoryBuilder<DbPrimitiveObjectWithSetter, CsvColumnKey> builder = getMappingContextBuilder();
FieldMapperColumnDefinition<CsvColumnKey> format = FieldMapperColumnDefinition.<CsvColumnKey>identity().add(new FormatProperty(new DecimalFormat("0.0")));
FieldMapper<DbPrimitiveObjectWithSetter, Appendable> fieldMapper = defaultFieldAppenderFactory.newFieldMapper(newPropertyMapping("pDouble", dbPrimitiveObjectClassMeta, format), builder, null);
testFieldMapper("3.1", fieldMapper, dbPrimitiveObject, builder.newFactory());
}
Aggregations