IntUtils.java
452 Bytes
package com.viontech.utils;
import java.util.concurrent.atomic.AtomicInteger;
/**
* .
*
* @author 谢明辉
* @date 2020/8/26
*/
public class IntUtils {
private static final AtomicInteger atomicInteger = new AtomicInteger();
public static synchronized Integer next() {
int num = atomicInteger.getAndIncrement();
if (num == Integer.MAX_VALUE) {
atomicInteger.set(0);
}
return num;
}
}