use of org.simpleflatmapper.csv.impl.primitive.BooleanDelayedCellSetter in project SimpleFlatMapper by arnaudroger.
the class PrimitivesDelayedCellSetterTest method testBooleanGetSetValue.
@Test
public void testBooleanGetSetValue() throws Exception {
Setter<DbPrimitiveObjectWithSetter, Boolean> setter = objectSetterFactory.getSetter(DbPrimitiveObjectWithSetter.class, "pBoolean");
BooleanDelayedCellSetter<DbPrimitiveObjectWithSetter> bSetter = new BooleanDelayedCellSetter<DbPrimitiveObjectWithSetter>(ObjectSetterFactory.toBooleanSetter(setter), new BooleanCellValueReaderImpl());
bSetter.set("true".toCharArray(), 0, 4, null);
assertTrue(bSetter.consumeValue());
bSetter.set("true".toCharArray(), 0, 4, null);
DbPrimitiveObjectWithSetter o = new DbPrimitiveObjectWithSetter();
bSetter.set(o);
assertTrue(o.ispBoolean());
bSetter.set("".toCharArray(), 0, 0, null);
assertNull(bSetter.consumeValue());
}
Aggregations