Boredom as a defense mechanism?

I’ve seen boredom before being used as a way to detach from the world. Is there any material on boredom being used as a defense mechanism?