// check elements
for (Entry<String, Type> entry : mElements.entrySet())
{
if (!map.containsKey(entry.getKey()))
{
throw new TypeMismatchException(this, value);
}
Object val = map.get(entry.getKey());
{
try
{
entry.getValue().cast(val);
}
catch (TypeMismatchException e)
{
throw new TypeMismatchException(this, value);
}
}
}
return value;
}
throw new TypeMismatchException(this, value);
}