public static String toText(final JsonNode node, final String defaultValue) {
        if (node == null) {
            return defaultValue;
        }
        if (node.isTextual()) {
            return node.asText();
        }
        if (node.isInt()) {
            return "" + node.asInt();
        }
        if (node.isNumber()) {
            return "" + node.asDouble();
        }
        if (node.isBoolean()) {
            return "" + node.asBoolean();
        }
        return defaultValue;
    }
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