use of org.simpleflatmapper.csv.impl.primitive.DoubleDelayedCellSetter in project SimpleFlatMapper by arnaudroger.
the class PrimitivesDelayedCellSetterTest method testDoubleGetSetValue.
@Test
public void testDoubleGetSetValue() throws Exception {
Setter<DbPrimitiveObjectWithSetter, Double> doubleSetter = objectSetterFactory.getSetter(DbPrimitiveObjectWithSetter.class, "pDouble");
DoubleDelayedCellSetter<DbPrimitiveObjectWithSetter> setter = new DoubleDelayedCellSetter<DbPrimitiveObjectWithSetter>(ObjectSetterFactory.toDoubleSetter(doubleSetter), new DoubleCellValueReaderImpl());
setter.set("13".toCharArray(), 0, 2, null);
assertEquals(new Double(13), setter.consumeValue());
setter.set("13".toCharArray(), 0, 2, null);
DbPrimitiveObjectWithSetter o = new DbPrimitiveObjectWithSetter();
setter.set(o);
assertEquals(13, o.getpDouble(), 0);
setter.set("".toCharArray(), 0, 0, null);
assertNull(setter.consumeValue());
}
Aggregations