com.taotao.boot.idgenerator.uid.UidGenerator Maven / Gradle / Ivy
package com.taotao.boot.idgenerator.uid;
import com.taotao.boot.idgenerator.uid.exception.UidGenerateException;
import java.util.Map;
/**
* Represents a unique id generator.
*/
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);
Map parseUid(long uid);
}