Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static <T> T convert(Object o, Class<T> clazz) {
- ObjectMapper mapper = new ObjectMapper();
- try {
- return mapper.convertValue(o, clazz);
- } catch (IllegalArgumentException e) {
- // just can't be converted
- return null;
- }
- }
Add Comment
Please, Sign In to add comment