private static java.lang.Object | doConvert(java.util.Map m)Of course there are more elaborate ways to do this, but given the small
number of conversions, this straightforward approach is best.
Object result = m; // don't convert, by default
final String interfaceName = (String)m.get(MAP_CAPABLE_CLASS_NAME_KEY);
if ( interfaceName != null )
{
if ( DEPLOYMENT_PROGRESS_CLASS_NAME.equals( interfaceName ) )
{
result = DeploymentSupport.mapToDeploymentProgress( m );
}
else if ( DEPLOYMENT_SOURCE_CLASS_NAME.equals( interfaceName ) )
{
result = DeploymentSupport.mapToDeploymentSource( m );
}
else if ( DEPLOYMENT_STATUS_CLASS_NAME.equals( interfaceName ) )
{
result = DeploymentSupport.mapToDeploymentStatus( m );
}
else if ( MessageTrace.CLASS_NAME.equals( interfaceName ) )
{
result = new MessageTraceImpl( m, MessageTrace.class.getName());
}
else
{
// That's OK, we just leave it as a Map
}
}
return result;
|