We created soyuz-to library to simplify this problem (convert X to Y). It's just a set of SO answers for similar questions. This might be strange to use the library for such a simple problem, but it really helps in a lot of similar cases.
import io.thedocs.soyuz.to;
Boolean aBoolean = to.Boolean("true");
Please check it - it's very simple and has a lot of other useful features