@Test public void shouldParseDateToDate() { Date date = new Date(); DateTime dateTime = new DateTime(date); LocalDate localDate = dateTime.toLocalDate(); Time time = new Time(dateTime.getHourOfDay(), dateTime.getMinuteOfHour()); assertEquals(dateTime, TypeHelper.parse(dateTime, DateTime.class)); assertEquals(date, TypeHelper.parse(dateTime, Date.class)); assertEquals(localDate, TypeHelper.parse(dateTime, LocalDate.class)); assertEquals(time, TypeHelper.parse(dateTime, Time.class)); assertEquals(dateTime, TypeHelper.parse(date, DateTime.class)); assertEquals(date, TypeHelper.parse(date, Date.class)); assertEquals(localDate, TypeHelper.parse(date, LocalDate.class)); assertEquals(time, TypeHelper.parse(date, Time.class)); }
public static Object parse(Object val, Class<?> toClass) { return parse(val, toClass.getName()); }
TypeHelper { public static Object parse(Object val, Class<?> toClass) { return parse(val, toClass.getName()); } }
TypeHelper { public static Object parse(Object val, Class<?> toClass) { return parse(val, toClass.getName()); } private  TypeHelper(); }
TypeHelper { public static Object parse(Object val, Class<?> toClass) { return parse(val, toClass.getName()); } private  TypeHelper(); static Object parse(Object val, Class<?> toClass); static Object parse(Object val, String toClass); static Object parse(Object val, String toClass, ClassLoader classLoader); static Object parse(Object val, String toClass, String genericType); static Object parse(Object val, String toClass, String genericType, ClassLoader classLoader); static Object parseString(String str, Class<?> toClass); static Object parseString(String str, String toClass); static Object parseString(String str, Class<?> toClass, Class<?> generic); static String buildStringFromList(List<String> items); static String[] breakString(String str); static String[] breakStringForCollection(String str); static String[] breakString(String str, String[] removes, String[] search,
                                       String[] replacement, String separator); static Map parseStringToMap(String str); static Map<K, V> parseStringToMap(Class<K> keyClass, Class<V> valueClass, String str); static Map parseStringToMap(String keyClass, String valueClass, String str); static Object parseStringToUUID(String val); static Object parseMapValue(Object valueToParse, String type, boolean isKey); static boolean isTypeSupportedInMap(String type, boolean isKey); static Object parseDateToDate(Object val, String toClass); static Collection parseCollection(Collection val, Class<?> toClassDefinition, Class<?> generic); static boolean parseIntToBool(Integer val); static String format(Object obj); static String format(Object obj, char collJoinChar); static Number parseNumber(Object val, String toClass); static boolean hasPrimitive(Class<?> clazz); static boolean isPrimitive(Class<?> clazz); static boolean isPrimitive(String className); static Class<?> getPrimitive(Class<?> clazz); static Class<?> getWrapperForPrimitive(Class<?> clazz); static String getClassNameForMdsType(Class<?> clazz); static Range toRange(Object object, String typeClass); static Set toSet(Object object, String typeClass, ClassLoader classLoader); static Class suggestCollectionImplementation(String collectionClass); static Class<? extends Collection> suggestCollectionImplementation(Class<? extends Collection> collectionClass); static Collection suggestAndCreateCollectionImplementation(Class<? extends Collection> collectionClass); static Collection<T> asCollection(Object value); static boolean isBaseEntity(String entitySuperClass); static boolean isSubclassOfMdsEntity(String entitySuperClass); static boolean isSubclassOfMdsVersionedEntity(String entitySuperClass); }
TypeHelper { public static Object parse(Object val, Class<?> toClass) { return parse(val, toClass.getName()); } private  TypeHelper(); static Object parse(Object val, Class<?> toClass); static Object parse(Object val, String toClass); static Object parse(Object val, String toClass, ClassLoader classLoader); static Object parse(Object val, String toClass, String genericType); static Object parse(Object val, String toClass, String genericType, ClassLoader classLoader); static Object parseString(String str, Class<?> toClass); static Object parseString(String str, String toClass); static Object parseString(String str, Class<?> toClass, Class<?> generic); static String buildStringFromList(List<String> items); static String[] breakString(String str); static String[] breakStringForCollection(String str); static String[] breakString(String str, String[] removes, String[] search,
                                       String[] replacement, String separator); static Map parseStringToMap(String str); static Map<K, V> parseStringToMap(Class<K> keyClass, Class<V> valueClass, String str); static Map parseStringToMap(String keyClass, String valueClass, String str); static Object parseStringToUUID(String val); static Object parseMapValue(Object valueToParse, String type, boolean isKey); static boolean isTypeSupportedInMap(String type, boolean isKey); static Object parseDateToDate(Object val, String toClass); static Collection parseCollection(Collection val, Class<?> toClassDefinition, Class<?> generic); static boolean parseIntToBool(Integer val); static String format(Object obj); static String format(Object obj, char collJoinChar); static Number parseNumber(Object val, String toClass); static boolean hasPrimitive(Class<?> clazz); static boolean isPrimitive(Class<?> clazz); static boolean isPrimitive(String className); static Class<?> getPrimitive(Class<?> clazz); static Class<?> getWrapperForPrimitive(Class<?> clazz); static String getClassNameForMdsType(Class<?> clazz); static Range toRange(Object object, String typeClass); static Set toSet(Object object, String typeClass, ClassLoader classLoader); static Class suggestCollectionImplementation(String collectionClass); static Class<? extends Collection> suggestCollectionImplementation(Class<? extends Collection> collectionClass); static Collection suggestAndCreateCollectionImplementation(Class<? extends Collection> collectionClass); static Collection<T> asCollection(Object value); static boolean isBaseEntity(String entitySuperClass); static boolean isSubclassOfMdsEntity(String entitySuperClass); static boolean isSubclassOfMdsVersionedEntity(String entitySuperClass);  }