use of org.simpleflatmapper.csv.impl.primitive.LongDelayedCellSetter in project SimpleFlatMapper by arnaudroger.
the class PrimitivesDelayedCellSetterTest method testLongGetSetValue.
@Test
public void testLongGetSetValue() throws Exception {
Setter<DbPrimitiveObjectWithSetter, Long> longSetter = objectSetterFactory.getSetter(DbPrimitiveObjectWithSetter.class, "pLong");
LongDelayedCellSetter<DbPrimitiveObjectWithSetter> setter = new LongDelayedCellSetter<DbPrimitiveObjectWithSetter>(ObjectSetterFactory.toLongSetter(longSetter), new LongCellValueReaderImpl());
setter.set("13".toCharArray(), 0, 2, null);
assertEquals(new Long(13), setter.consumeValue());
setter.set("13".toCharArray(), 0, 2, null);
DbPrimitiveObjectWithSetter o = new DbPrimitiveObjectWithSetter();
setter.set(o);
assertEquals(13, o.getpLong());
setter.set("".toCharArray(), 0, 0, null);
assertNull(setter.consumeValue());
}
Aggregations