use of org.simpleflatmapper.csv.impl.primitive.IntDelayedCellSetter in project SimpleFlatMapper by arnaudroger.
the class PrimitivesDelayedCellSetterTest method testIntGetSetValue.
@Test
public void testIntGetSetValue() throws Exception {
Setter<DbPrimitiveObjectWithSetter, Integer> intSetter = objectSetterFactory.getSetter(DbPrimitiveObjectWithSetter.class, "pInt");
IntDelayedCellSetter<DbPrimitiveObjectWithSetter> setter = new IntDelayedCellSetter<DbPrimitiveObjectWithSetter>(ObjectSetterFactory.toIntSetter(intSetter), new IntegerCellValueReaderImpl());
setter.set("13".toCharArray(), 0, 2, null);
assertEquals(new Integer(13), setter.consumeValue());
setter.set("13".toCharArray(), 0, 2, null);
DbPrimitiveObjectWithSetter o = new DbPrimitiveObjectWithSetter();
setter.set(o);
assertEquals(13, o.getpInt());
setter.set("".toCharArray(), 0, 0, null);
assertNull(setter.consumeValue());
}
Aggregations