開發小工具

2021-09-26 19:28:35 字數 2264 閱讀 8382

獲取上級方法的資訊

* thread.currentthread().getstacktrace()[1]是你當前方法執行堆疊

* thread.currentthread().getstacktrace()[2]就是上一級的方法堆疊 以此類推

** @param content

* @return

*/public static string getmethodstr(string content)

return stringbuffer.tostring();

}

請求引數 按照字母排序並 md5 加密

* php  簽名

* @return

*/public static string getsign(sortedmapmap)

}string sign = stringutils.join(values,"&");

//自定義的金鑰

return commonutils.md5(sb.tostring()).tolowercase();

}/**

* md5常用工具類

** @param data

* @return

*/public static string md5(string data)

return sb.tostring().touppercase();

} catch (exception e)

return null;

}

當前時間的 前 多少天

* 當前日期的前?天       datanumber  天數

* @return

*/public static string getbeforeoneday(int datanumber)

/***

* 獲取?個小時之前的時間

*/public static string getlastfourhour(int hournumber)

時間戳轉時間(10位時間戳)

* 時間戳轉時間(10位時間戳)

** @return

*/public static string timestamptodate()

/*** string(yyyy-mm-dd hh:mm:ss)轉10位時間戳

** @param time

* @return

*/public static integer stringtotimestamp(string time) catch (exception e)

if (times == 0)

return times;

}/**

* string(yyyy-mm-dd hh:mm:ss)轉10位時間戳

** @param time

* @return

*/public static integer stringtotiamp(string time) catch (exception e)

if (times == 0)

return times;

}

時間比較

* @param newtime 較大的時間 (如果為空   預設當前時間 ,表示和當前時間相比)

* @return -1 :同一天. 0:昨天 . 1 :至少是前天.

* @throws parseexception 轉換異常

* @author luob.

* @param---oldtime 較小的時間

*/private static int isyeaterday(string newtime) throws parseexception else if ((today.gettime() - oldtime.gettime()) <= 0) else

}

不滿一年

*   1  不滿一年

* @param startday

* @param endday

* @return

*/public static int isoneyear(string startday, string endday) else

}

EAS開發小工具

系統選單 啟用系統選單快捷鍵 shift ctrl alt k 系統選單匯出 geninsert select from t bas sysmenuitem where 1 1 客戶化選單 客戶化選單匯出 geninsert select from t pm mainmenuitem where 1...

小工具 tree工具

wangyetao linux u1604 tree l 1 bin boot cdrom dev etc home initrd.img boot initrd.img 4.4.0 116 generic initrd.img.old boot initrd.img 4.4.0 112 gener...

幾個小工具

1 svn 輕量級的版本控制 2 incredibuild 分布式的編譯工具,對於大專案編譯很有好處,在團隊每個成員的機器上安裝一人,能極大的提高 編譯效率 3 dbg 中文幫助文件 http www.dbgtech.net windbghelp index.html 4 visualassit x...