Can't you say temp.getString to avoid casting?