It seems like, Databricks notebooks currently do not offer a built in way to collapse all cells.
But you can manually collapse cells, you click on the little triangle on the left of a cell, it collapses that block.
Also, you can split the large class into smaller modules and save them as .py files. Then import them into your notebook using %run or through Databricks Repos if you are working with Git.