Hazrat Imam Mahdi (as) bears the special characteristics and more from the previous prophets. He is the embodiment of their virtues and qualities. He carries their signs and is the inheritor of all that they stood for and what was revealed upon them. The following article mentions the similarity between Hazrat Yusuf (as) and Imam Mahdi (as).
Hazrat Yusuf (as) was the most handsome person of his time.
Imam Mahdi (as) would also be the most handsome person of his time as mentioned in discussions about his appearance and elegance.
Occultation from people
Hazrat Yusuf (as) disappeared for a long time while he walked among them and recognized them but they did not recognize him. (Surah Yusuf verse 88)
Imam Mahdi (as) also disappeared from the sight of the people in such a way that he walks among them and recognizes them but they do not recognize him. (Refer discussion about Ghaybat)
Reformation of affairs
Almighty Allah reformed the affairs of Hazrat Yusuf (as) overnight when the king of Egypt saw the dream and Hazrat Yusuf (as) interpreted it for him.
In the same manner, Almighty Allah will also improve the affairs of Imam Mahdi (as) overnight. Thus on that single night He will gather the companions of Imam Mahdi (as) from far off lands.
Shaykh Sadooq has narrated in Kamaluddin from Imam Baqir (as) that he said, “In the Master of this affair there is a resemblance to Yusuf (as) and it is that Allah, the Mighty and Sublime would improve and reform his affairs overnight.” (Kamaluddin volume 1 page 329)
And it is narrated from the Holy Prophet (sawa) that he said, “Mahdi is from us, Ahle Bayt. Almighty Allah would improve and reform his affairs overnight.” (Beharul Anwar volume 52, page 280)
Distress in imprisonment
Hazrat Yusuf (as) was distressed by being imprisoned and he said as follows, “He said, My Lord! the prison house is dearer to me than that to which they invite me…” (Chapter 18 verse 33)
In the same way Imam Mahdi (as) has also the same situation as mentioned in the tradition of Imam Baqir (as), “In the Master of this affair there is a resemblance to Musa, a resemblance to Isa, a resemblance to Yusuf and a resemblance to Mohammed (sawa)” – till he said – “and as for the resemblance to Yusuf, it is the prison and occultation…” (Kamaluddin volume 1 page 329)
The author of Mikyalul Makarem says, O ardent follower of the Ahle Bayt! Take heed from these statements and imagine the distress and hardship of your Maula (Imam Mahdi), that the world, in spite of its vastness and the earth in spite of its extent is a prison for him in such a way that he is not secure from the oppression and opposition of the enemies. We pray to the Almighty Allah to hasten his reappearance and ease his advent. Ameen!
Yusuf (as) remained in the prison for some years.
Regarding Imam Mahdi (as), if only we could know how long he would have to remain in the prison of occultation and when he would come out of it!
Occultation from people
Hazrat Yusuf (as) had gone into occultation from the general public as well as his near and dear ones and he remained hidden from his brothers and his disappearance was very tough upon his father, Yaqub, in spite of the fact that there was not much distance between him and his followers, as mentioned in traditions.
The conditions for Imam Mahdi (as) also – as mentioned in other traditions – are like that. In Kamaluddin it is narrated from Imam Baqir (as) in the discussion of the resemblance to some prophets it has come as follows, “And as for his resemblance to Yusuf bin Yaqub (as), it is occultation from his near and near ones as well as from the general populace and being hidden from his brothers; and the concealment of his affair from his father Yaqub (as).” (Kamaluddin volume 1 page 327)
The author says, There are a large number of reports that prove that Imam Mahdi (as) is with us and is aware of our affairs. In Dua Nudbah, while addressing Imam Mahdi (as), we say, “May my soul be sacrificed upon you; for although you are hidden from us, you have never forsaken us. May my soul be sacrificed for you; for although you are away, you have never been away from us.”
(The above article was taken and adapted from the book Mikyalul Makarim Fee Fawaedid Dua Lil Qaem)