public class IdUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
protected static org.slf4j.Logger |
logger
定义日志
|
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
getDebugId() |
static String |
getLastIp(int size) |
static List<String> |
getLocalAddress(boolean hasHostName,
boolean hasIPV6) |
static BigDecimal |
getNanoTimeId(String workerId) |
static BigDecimal |
getNanoTimeId(String identityName,
String workerId) |
static BigDecimal |
getShortNanoTimeId(String workerId) |
static BigDecimal |
getShortNanoTimeId(String identityName,
String workerId) |
static String |
getUUID()
封装JDK自带的UUID, 通过Random数字生成,中间有-分割
|
public static String getUUID()
public static BigDecimal getShortNanoTimeId(String workerId)
workerId - public static BigDecimal getShortNanoTimeId(String identityName, String workerId)
public static BigDecimal getNanoTimeId(String workerId)
public static BigDecimal getNanoTimeId(String identityName, String workerId)
identityName - 一般用表名workerId - public static String getDebugId()
public static List<String> getLocalAddress(boolean hasHostName, boolean hasIPV6)
hasHostName - hasIPV6 - public static String getLastIp(int size)
size - Copyright © 2023. All rights reserved.