@Test public void testValueOfWhenValuerNotFoundButMethodIsFound() throws Exception { Object result = ReflectionUtilsExtension.valueOf(Byte.class, "12"); byte expected = 12; assertEquals(expected, result); }
public static Object valueOf(final Class<?> clazz, final String value) throws Exception { Object object = value; Valuer valuer = valuerMap.get(clazz); if (valuer != null) { object = valuer.valueOf(value); } else { object = tryToInvokeValueOf(clazz, value, object); } return object; }
ReflectionUtilsExtension { public static Object valueOf(final Class<?> clazz, final String value) throws Exception { Object object = value; Valuer valuer = valuerMap.get(clazz); if (valuer != null) { object = valuer.valueOf(value); } else { object = tryToInvokeValueOf(clazz, value, object); } return object; } }
ReflectionUtilsExtension { public static Object valueOf(final Class<?> clazz, final String value) throws Exception { Object object = value; Valuer valuer = valuerMap.get(clazz); if (valuer != null) { object = valuer.valueOf(value); } else { object = tryToInvokeValueOf(clazz, value, object); } return object; } private  ReflectionUtilsExtension(); }
ReflectionUtilsExtension { public static Object valueOf(final Class<?> clazz, final String value) throws Exception { Object object = value; Valuer valuer = valuerMap.get(clazz); if (valuer != null) { object = valuer.valueOf(value); } else { object = tryToInvokeValueOf(clazz, value, object); } return object; } private  ReflectionUtilsExtension(); static Object valueOf(final Class<?> clazz, final String value); }
ReflectionUtilsExtension { public static Object valueOf(final Class<?> clazz, final String value) throws Exception { Object object = value; Valuer valuer = valuerMap.get(clazz); if (valuer != null) { object = valuer.valueOf(value); } else { object = tryToInvokeValueOf(clazz, value, object); } return object; } private  ReflectionUtilsExtension(); static Object valueOf(final Class<?> clazz, final String value);  }