If you want to store an object itself, it has to be serializable
If it is not possible for you to make it serializable, you have to store each and every state of an object into a file, and when you want the object back , you have to create a new object and flush tht object with stored states