<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def getmessage(self) -> str: """ parse self into unicode string as message content """
   
        image = {}
        for key, default in vars(self.__class__).items():
            if not key.startswith('_') and key !='' and (not key in vars(QueueMessage).items()):                                      
                if isinstance(default, datetime.date):
                    image[key] = safe_cast(getattr(self, key, default), str, dformat=self._dateformat)
                if isinstance(default, datetime.datetime):
                    image[key] = safe_cast(getattr(self, key, default), str, dformat=self._datetimeformat)
                else:
                    image[key] = getattr(self, key, default)                              
        return str(image)