@Test void testMultimapObjectPropertyField() throws Exception { Map<String, List<Integer>> expectedMultimap = ImmutableMap.<String, List<Integer>>builder() .put("key1", ImmutableList.of(1)) .put("key2", ImmutableList.of(2, 3, 4)) .put("key3", ImmutableList.of(5)) .build(); TypedMultimapConfigClass instance = new TypedMultimapConfigClass(); Field target = instance.getClass().getDeclaredField("integerMultimap"); ObjectPropertyField fieldIntegerMultimap = new ObjectPropertyField(target, propName); fieldIntegerMultimap.applyValueParser(instance, "key1=1,key2=2,3,4,key3=5"); assertEquals(expectedMultimap, instance.integerMultimap); }
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);   }