use of org.simpleflatmapper.csv.impl.primitive.FloatDelayedCellSetter in project SimpleFlatMapper by arnaudroger.
the class PrimitivesDelayedCellSetterTest method testFloatGetSetValue.
@Test
public void testFloatGetSetValue() throws Exception {
Setter<DbPrimitiveObjectWithSetter, Float> floatSetter = objectSetterFactory.getSetter(DbPrimitiveObjectWithSetter.class, "pFloat");
FloatDelayedCellSetter<DbPrimitiveObjectWithSetter> setter = new FloatDelayedCellSetter<DbPrimitiveObjectWithSetter>(ObjectSetterFactory.toFloatSetter(floatSetter), new FloatCellValueReaderImpl());
setter.set("13".toCharArray(), 0, 2, null);
assertEquals(new Float(13), setter.consumeValue());
setter.set("13".toCharArray(), 0, 2, null);
DbPrimitiveObjectWithSetter o = new DbPrimitiveObjectWithSetter();
setter.set(o);
assertEquals(13, o.getpFloat(), 0);
setter.set("".toCharArray(), 0, 0, null);
assertNull(setter.consumeValue());
}
Aggregations