package com.icexxx.util;
/**
* id生成器工具类,处理多线程问题
*
* @author IceWater
* @date 2017-02-24
* @version 1.0
*/
public class IceIdGenerator {
private static long index = 0L;
/**
* 初始化id生成器的起始id
*
* @param start 起始id
*/
public static synchronized void init(long start) {
index = start - 1;
}
/**
* 获取id生成器的下一个id
*
* @return id生成器产生的下一个id
*/
public static synchronized long next() {
index++;
return index;
}
}
最近下载更多
最近浏览更多
3334004690 LV11
2024年5月28日
1358849392 LV21
2022年11月11日
crosa_Don LV18
2022年3月31日
zuidaima_liuzg LV1
2021年5月13日
叽哩咕噜 LV2
2020年12月24日
dongzhan LV12
2020年12月9日
wkc LV21
2020年7月26日
Gyq灬ming LV11
2019年11月30日
小资李 LV13
2019年9月17日
497100512
2019年4月27日
暂无贡献等级

