小工具

一、打印对象内容

@Autowired
private Gson gson;
String prettyJsonString = gson.toJson(entity);
LOGGER.info(prettyJsonString);
打印对象内容

二、查看key-value的方法

public void getSystemKey(){
    File sysFile = new File("d:/study","sysFile.properties");
    Properties sysPro = System.getProperties();
    try {
        sysPro.store(new FileOutputStream(sysFile), "Properties ClASS(描述)");
    } catch (FileNotFoundException e1) {
        e1.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }
}            
查看key

 

posted @ 2019-08-23 00:56  洁瑞小弟  阅读(90)  评论(0编辑  收藏  举报