@Test void testPrimitiveObjectPropertyField() throws Exception { PrimitiveClass instance = new PrimitiveClass(); Class<PrimitiveClass> clazz = PrimitiveClass.class; ObjectPropertyField field_iii = new ObjectPropertyField(clazz.getDeclaredField("iii"), propName); ObjectPropertyField field_ddd = new ObjectPropertyField(clazz.getDeclaredField("ddd"), propName); ObjectPropertyField field_bbb = new ObjectPropertyField(clazz.getDeclaredField("bbb"), propName); ObjectPropertyField field_lll = new ObjectPropertyField(clazz.getDeclaredField("lll"), propName); field_iii.applyValueParser(instance, "1"); field_ddd.applyValueParser(instance, "1E+7"); field_bbb.applyValueParser(instance, "false"); field_lll.applyValueParser(instance, "1"); assertEquals(1, instance.iii); assertEquals(1e7, instance.ddd); assertFalse(instance.bbb); assertEquals(1, instance.lll); }
void applyValueParser(Object instance, String value) { try { field.set(instance, valueParser.apply(value)); } catch (IllegalAccessException e) { throw ThrowableUtil.propagate(e); } }
ObjectPropertyField { void applyValueParser(Object instance, String value) { try { field.set(instance, valueParser.apply(value)); } catch (IllegalAccessException e) { throw ThrowableUtil.propagate(e); } } }
ObjectPropertyField { void applyValueParser(Object instance, String value) { try { field.set(instance, valueParser.apply(value)); } catch (IllegalAccessException e) { throw ThrowableUtil.propagate(e); } } ObjectPropertyField(Field field, String propertyName); }
ObjectPropertyField { void applyValueParser(Object instance, String value) { try { field.set(instance, valueParser.apply(value)); } catch (IllegalAccessException e) { throw ThrowableUtil.propagate(e); } } ObjectPropertyField(Field field, String propertyName);  }
ObjectPropertyField { void applyValueParser(Object instance, String value) { try { field.set(instance, valueParser.apply(value)); } catch (IllegalAccessException e) { throw ThrowableUtil.propagate(e); } } ObjectPropertyField(Field field, String propertyName);   }