工具类或连接

1.定时任务时间配置:
http://cron.qqe2.com/

2.校验正则表达式相等:
boolean boo = Pattern.compile("/pay/([0-9]+/){2,3}notify.htm").matcher("/pay/602/320/0/notify.htm").matches();
System.out.println(boo);


3.对象转map:
private static HashMap<String, String> toHashMap(Object object) {

       HashMap<String, String> data = new HashMap<String, String>();  
       // 将json字符串转换成jsonObject  
       JSONObject jsonObject = JSONObject.fromObject(object);  
       Iterator it = jsonObject.keys();  
       // 遍历jsonObject数据,添加到Map对象  
       while (it.hasNext())  
       {  
           String key = String.valueOf(it.next());  
           String value = jsonObject.get(key).toString();  
           data.put(key, value);  
       }  
       return data;  
}  

猜你喜欢

转载自572327713.iteye.com/blog/2384226