use of org.simpleflatmapper.csv.impl.primitive.ByteDelayedCellSetter in project SimpleFlatMapper by arnaudroger.
the class PrimitivesDelayedCellSetterTest method testByteGetSetValue.
@Test
public void testByteGetSetValue() throws Exception {
Setter<DbPrimitiveObjectWithSetter, Byte> byteSetter = objectSetterFactory.getSetter(DbPrimitiveObjectWithSetter.class, "pByte");
ByteDelayedCellSetter<DbPrimitiveObjectWithSetter> setter = new ByteDelayedCellSetter<DbPrimitiveObjectWithSetter>(ObjectSetterFactory.toByteSetter(byteSetter), new ByteCellValueReaderImpl());
setter.set("13".toCharArray(), 0, 2, null);
assertEquals(new Byte((byte) 13), setter.consumeValue());
setter.set("13".toCharArray(), 0, 2, null);
DbPrimitiveObjectWithSetter o = new DbPrimitiveObjectWithSetter();
setter.set(o);
assertEquals((byte) 13, o.getpByte());
setter.set("".toCharArray(), 0, 0, null);
assertNull(setter.consumeValue());
}
Aggregations