package com.boman.web.core.utils;

import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author shiqian
 * @date 2021年04月29日 15:21
 **/
public class JSONObjectUtils {

    private static final Logger LOGGER = LoggerFactory.getLogger(JSONObjectUtils.class);

    public static boolean containsKeyIgnoreCase(JSONObject json, String key) {
        return json.containsKey(key.toLowerCase()) || json.containsKey(key.toUpperCase());
    }

    public static JSONObject putValue(String key, Object value) {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put(key, value);
        return jsonObject;
    }

    public static JSONObject putValue(String key1, Object value1, String key2, Object value2) {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put(key1, value1);
        jsonObject.put(key2, value2);
        return jsonObject;
    }


}
