@Test(expected = ConfigurationRuntimeException.class) public void require_that_invalid_builders_fail() { ConfigInstanceUtil.setValues(new FakeBuilder(), new FakeBuilder()); }
public static<BUILDER extends ConfigBuilder> void setValues(BUILDER destination, BUILDER source) { try { Method setter = destination.getClass().getDeclaredMethod("override", destination.getClass()); setter.setAccessible(true); setter.invoke(destination, source); setter.setAccessible(false); } catch (Exception e) { throw new ConfigurationRuntimeException("Could not set values on config builder." + destination.getClass().getName(), e); } }
ConfigInstanceUtil { public static<BUILDER extends ConfigBuilder> void setValues(BUILDER destination, BUILDER source) { try { Method setter = destination.getClass().getDeclaredMethod("override", destination.getClass()); setter.setAccessible(true); setter.invoke(destination, source); setter.setAccessible(false); } catch (Exception e) { throw new ConfigurationRuntimeException("Could not set values on config builder." + destination.getClass().getName(), e); } } }
ConfigInstanceUtil { public static<BUILDER extends ConfigBuilder> void setValues(BUILDER destination, BUILDER source) { try { Method setter = destination.getClass().getDeclaredMethod("override", destination.getClass()); setter.setAccessible(true); setter.invoke(destination, source); setter.setAccessible(false); } catch (Exception e) { throw new ConfigurationRuntimeException("Could not set values on config builder." + destination.getClass().getName(), e); } }  }
ConfigInstanceUtil { public static<BUILDER extends ConfigBuilder> void setValues(BUILDER destination, BUILDER source) { try { Method setter = destination.getClass().getDeclaredMethod("override", destination.getClass()); setter.setAccessible(true); setter.invoke(destination, source); setter.setAccessible(false); } catch (Exception e) { throw new ConfigurationRuntimeException("Could not set values on config builder." + destination.getClass().getName(), e); } }  static void setValues(BUILDER destination, BUILDER source); static T getNewInstance(Class<T> type, String configId, ConfigPayload payload); static Object getField(ConfigBuilder builder, String fieldName); }
ConfigInstanceUtil { public static<BUILDER extends ConfigBuilder> void setValues(BUILDER destination, BUILDER source) { try { Method setter = destination.getClass().getDeclaredMethod("override", destination.getClass()); setter.setAccessible(true); setter.invoke(destination, source); setter.setAccessible(false); } catch (Exception e) { throw new ConfigurationRuntimeException("Could not set values on config builder." + destination.getClass().getName(), e); } }  static void setValues(BUILDER destination, BUILDER source); static T getNewInstance(Class<T> type, String configId, ConfigPayload payload); static Object getField(ConfigBuilder builder, String fieldName);  }