@Test public void testDate() { Date testDate = new Date(); testDate = DateUtils.truncate(testDate, Calendar.SECOND); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S"); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); assertTrue(StringToObject.convertStringToObject(sdf.format(testDate)) instanceof Date); assertEquals(testDate, StringToObject.convertStringToObject(sdf.format(testDate))); sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); assertTrue(StringToObject.convertStringToObject(sdf.format(testDate)) instanceof Date); assertEquals(testDate, StringToObject.convertStringToObject(sdf.format(testDate))); sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); assertTrue(StringToObject.convertStringToObject(sdf.format(testDate)) instanceof Date); assertEquals(testDate, StringToObject.convertStringToObject(sdf.format(testDate))); }
public static Object convertStringToObject(String s) { return convertStringToObject(s, new Properties()); }
StringToObject { public static Object convertStringToObject(String s) { return convertStringToObject(s, new Properties()); } }
StringToObject { public static Object convertStringToObject(String s) { return convertStringToObject(s, new Properties()); } private  StringToObject(); }
StringToObject { public static Object convertStringToObject(String s) { return convertStringToObject(s, new Properties()); } private  StringToObject(); static Object convertStringToObject(String s); static Object convertStringToObject(String s, Properties config); }
StringToObject { public static Object convertStringToObject(String s) { return convertStringToObject(s, new Properties()); } private  StringToObject(); static Object convertStringToObject(String s); static Object convertStringToObject(String s, Properties config);  }