test.java 984 Bytes
package com.huaheng.test;

import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.huaheng.common.utils.StringUtils;
import com.huaheng.pc.srm.domain.FinishedProduct;
import org.apache.commons.collections.MapUtils;

import java.util.*;

public class test {
    public static void main(String[] args) throws JsonProcessingException {
        Map<String, Boolean> map = new HashMap<>();
        Boolean k1 = MapUtils.getBoolean(map, "k", false);
        System.out.println(k1);
        Boolean k2 = MapUtils.getBoolean(map, "k", false);
        System.out.println(k2);

        System.out.println("=[=======================================================]=");

        Map<String, Object> map2=new HashMap();
        map2.put("state",false);
        map2.put("msg","token失效");
        String s = new ObjectMapper().writeValueAsString(map2);
        System.out.println(s);

    }
}