In these Middle Age Christian texts, he is referred to as Josaphat or Joasaph. Effectively, he is a Christian version of Siddhartha Gautama, or Buddha. As the legend goes, King Abenner of India persecuted the Christian Church founded by the Apostle Thomas. Astrologers predicted that Abenner’s son would become a Christian, so Abenner had his son, Josaphat, isolated.
Despite the isolation, Josaphat met the hermit Saint Barlaam and converted to Christianity. The legend goes on to say that when Abenner found out, he was furious with his son, but Josaphat kept his faith until his father also converted to Christianity, at which point he gave Josaphat the throne.
Josaphat later joined Barlaam as a hermit, and was canonized as a saint. Today, this story is considered to be one of many versions of the life story of Buddha, in no small part due to the similarities and historical context.