com.github.azbh111.utils.java.uid.UidGenerator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of utils-java Show documentation
Show all versions of utils-java Show documentation
com.github.azbh111:utils-java
The newest version!
package com.github.azbh111.utils.java.uid;
/**
* @author: zyp
* @date: 2020/8/24 4:51 下午
*/
public interface UidGenerator {
/**
* Get a unique ID
*
* @return UID
* @throws UidGenerateException
*/
long getUID() throws UidGenerateException;
/**
* Parse the UID into elements which are used to generate the UID.
* Such as timestamp & workerId & sequence...
*
* @param uid
* @return Parsed info
*/
String parseUID(long uid);
/**
* 创建DefaultUidGenerator
*
* @return
*/
static DefaultUidGenerator.DefaultUidGeneratorBuilder defaultUidGeneratorBuilder() {
return new DefaultUidGenerator.DefaultUidGeneratorBuilder();
}
}