类 IdUtil


  • public class IdUtil
    extends Object
    版本:
    v1.0,Date:2012-4-7
    作者:
    zhongxuchen
    • 字段详细资料

      • logger

        protected static final org.slf4j.Logger logger
        定义日志
    • 方法详细资料

      • getUUID

        public static String getUUID()
        封装JDK自带的UUID, 通过Random数字生成,中间有-分割
      • getShortNanoTimeId

        public static BigDecimal getShortNanoTimeId​(String workerId)
        参数:
        workerId -
        返回:
      • getNanoTimeId

        public static BigDecimal getNanoTimeId​(String identityName,
                                               String workerId)
        参数:
        identityName - 一般用表名
        workerId -
        返回:
      • getDebugId

        public static String getDebugId()
        返回:
      • getLocalAddress

        public static List<String> getLocalAddress​(boolean hasHostName,
                                                   boolean hasIPV6)
        参数:
        hasHostName -
        hasIPV6 -
        返回:
      • getLastIp

        public static String getLastIp​(int size)
        参数:
        size -
        返回: