public static Integer toInt(final JsonNode node, final Integer defaultValue) {
        return node == null || !node.isNumber() ? defaultValue : node.intValue();
    }
constructs a boolean value from a node. If node is null or not boolean, defaultValue is returned.
main/src/main/java/cgeo/geocaching/utils/JsonUtils.java