public Boolean getBoolean(String key) {
        Object value = super.get(key);

        if (value == null) {
            return null;
        }

        if (value instanceof Boolean) {
            return (Boolean) value;
        }

        if (value instanceof Number) {
            return ((Number) value).intValue() == 1;
        }

        if (value instanceof String) {
            String str = (String) value;

            if (str.isEmpty() || "null".equalsIgnoreCase(str)) {
                return null;
            }

            return "true".equalsIgnoreCase(str) || "1".equals(str);
        }

        throw new JSONException("Can not cast '" + value.getClass() + "' to boolean");
    }
Returns the {@link Boolean} of the associated keys in this {@link JSONObject}.

@param key the key whose associated value is to be returned
@return {@link Boolean} or null
@throws JSONException Unsupported type conversion to {@link Boolean}
core/src/main/java/com/alibaba/fastjson2/JSONObject.java