private static <T>T hashMapToObject(LinkedHashMap map,Class<T> type){
  try {
    return stringToObject(mapper.writeValueAsString(map),type);
  }
 catch (  IOException e) {
    log.warn("Could not create a object of the class " + type.getName() + " out of the map "+ map.toString()+ " :"+ e.getMessage());
    return null;
  }
}

private static < T > T hashMapToObject ( LinkedHashMap map , Class < T > type ) { try { return stringToObject ( mapper . writeValueAsString ( map ) , type ) ; } catch ( IOException e ) { log . warn ( "Could not create a object of the class " + type . getName ( ) + " out of the map " + map . toString ( ) + " :" + e . getMessage ( ) ) ; return null ; } }
takes a hashmap and creates an object . the hashmap should be created through jackson , so that jackson can deserialize it and instantiate an object .
