the convert from dictionary into a class