Public function to query object type