title: Casting with unknown class
body: <p>I need to cast a value by an unknown class name. Here is an example of what I need to do :</p>
  
  <pre><code>Filter filter = session.getFilter(aName);
  for (Object key :filter.getFilterDefinition().getParameterTypes().keySet() ){
  filter.setParameter("param1",filter.getFilterDefinition().getParameterType(key.toString()).getReturnedClass()) 
  value )
  }
  </code></pre>
  
  <p>So as you can see, I need to cast with the parameter type of the map key</p>
  
  <p>Is it possible? Othewise, how can I do such a cast.</p>
  
  <p>thanks</p>