Source: Decades of backpacking in Yosemite.
There are no wolves or boars in Yosemite, so you can relax on that point. There are coyotes, but they pose no danger to you.
There are snakes, including rattlesnakes at the lower elevations. In decades of hiking in Yosemite, I have seen one snake, a harmless small one, crossing the trail at Tuolumne Meadows (about 8,600 feet). Once while I was in Yosemite, there was a mountain lion alert for the trail up Yosemite Falls, but the mountain lion did not appear, understandably, for that is a busy trail.
For snakes, keep your eyes open and, as @noah said stay on the trails where they are easy to spot. For mountain lions, if you are really worried, hike with one, preferably two other adults.
Neither snakes nor mountain lions will be above timberline, which is at about 10,000 feet.
You should worry more about homo sapiens, than mountain lions, especially in the Valley or at trailheads, where occasionally they break into cars and steal things.