![JAR search and dependency download from the Maven repository](/logo.png)
io.github.pleuvoir.rabbit.utils.Generator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rabbitmq-plugin Show documentation
Show all versions of rabbitmq-plugin Show documentation
The project provide more reliability to use rabbitmq.
package io.github.pleuvoir.rabbit.utils;
import org.apache.commons.lang3.StringUtils;
import com.fasterxml.uuid.EthernetAddress;
import com.fasterxml.uuid.Generators;
import com.fasterxml.uuid.impl.TimeBasedGenerator;
/**
* 生成uuid并去掉 "-"
*
*/
public class Generator {
private static final String HORIZONTAL = "-";
private static TimeBasedGenerator timeBasedGenerator;
static {
timeBasedGenerator = Generators.timeBasedGenerator(EthernetAddress.fromInterface());
}
/**
* 生成下一个UUID
*/
public static String nextUUID() {
return timeBasedGenerator.generate().toString().replace(HORIZONTAL, StringUtils.EMPTY);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy