@Test public void testPopulate() { CustomizedConfig config = BeanUtils.populate(properties, CustomizedConfig.class); Assert.assertEquals(config.getRmqMaxRedeliveryTimes(), 120); Assert.assertEquals(config.getStringTest(), "kaka"); Assert.assertEquals(config.getRmqConsumerGroup(), "Default_Consumer_Group"); Assert.assertEquals(config.getRmqMessageConsumeTimeout(), 101); Assert.assertEquals(config.getLongTest(), 1234567890L); Assert.assertEquals(config.getDoubleTest(), 10.234, 0.000001); }
public static <T> T populate(final Properties properties, final Class<T> clazz) { T obj = null; try { obj = clazz.newInstance(); return populate(properties, obj); } catch (Throwable e) { log.warn("Error occurs !", e); } return obj; }
BeanUtils { public static <T> T populate(final Properties properties, final Class<T> clazz) { T obj = null; try { obj = clazz.newInstance(); return populate(properties, obj); } catch (Throwable e) { log.warn("Error occurs !", e); } return obj; } }
BeanUtils { public static <T> T populate(final Properties properties, final Class<T> clazz) { T obj = null; try { obj = clazz.newInstance(); return populate(properties, obj); } catch (Throwable e) { log.warn("Error occurs !", e); } return obj; }  }
BeanUtils { public static <T> T populate(final Properties properties, final Class<T> clazz) { T obj = null; try { obj = clazz.newInstance(); return populate(properties, obj); } catch (Throwable e) { log.warn("Error occurs !", e); } return obj; }  static T populate(final Properties properties, final Class<T> clazz); static T populate(final KeyValue properties, final Class<T> clazz); static Class<?> getMethodClass(Class<?> clazz, String methodName); static void setProperties(Class<?> clazz, Object obj, String methodName,
        Object value); static T populate(final Properties properties, final T obj); static T populate(final KeyValue properties, final T obj); }
BeanUtils { public static <T> T populate(final Properties properties, final Class<T> clazz) { T obj = null; try { obj = clazz.newInstance(); return populate(properties, obj); } catch (Throwable e) { log.warn("Error occurs !", e); } return obj; }  static T populate(final Properties properties, final Class<T> clazz); static T populate(final KeyValue properties, final Class<T> clazz); static Class<?> getMethodClass(Class<?> clazz, String methodName); static void setProperties(Class<?> clazz, Object obj, String methodName,
        Object value); static T populate(final Properties properties, final T obj); static T populate(final KeyValue properties, final T obj);  }