Should't type be an Enumeration so you only do getType ?