All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.geewit.snowflake.UidGenerator Maven / Gradle / Ivy

package io.geewit.snowflake;


import io.geewit.snowflake.exception.UidGenerateException;

/**
 * Represents a unique id generator.
 *
 * @author geewit
 */
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); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy