use of org.simpleflatmapper.csv.impl.primitive.CharDelayedCellSetter in project SimpleFlatMapper by arnaudroger.
the class PrimitivesDelayedCellSetterTest method testCharGetSetValue.
@Test
public void testCharGetSetValue() throws Exception {
Setter<DbPrimitiveObjectWithSetter, Character> charSetter = objectSetterFactory.getSetter(DbPrimitiveObjectWithSetter.class, "pChar");
CharDelayedCellSetter<DbPrimitiveObjectWithSetter> setter = new CharDelayedCellSetter<DbPrimitiveObjectWithSetter>(ObjectSetterFactory.toCharacterSetter(charSetter), new CharCellValueReaderImpl());
setter.set("13".toCharArray(), 0, 2, null);
assertEquals(new Character((char) 13), setter.consumeValue());
setter.set("13".toCharArray(), 0, 2, null);
DbPrimitiveObjectWithSetter o = new DbPrimitiveObjectWithSetter();
setter.set(o);
assertEquals((char) 13, o.getpCharacter());
setter.set("".toCharArray(), 0, 0, null);
assertNull(setter.consumeValue());
}
Aggregations