Represents a unique id generator. @author yutianbao
| 23 | * @author yutianbao |
| 24 | */ |
| 25 | public interface UidGenerator { |
| 26 | |
| 27 | /** |
| 28 | * Get a unique ID |
| 29 | * |
| 30 | * @return UID |
| 31 | * @throws UidGenerateException |
| 32 | */ |
| 33 | long getUID() throws UidGenerateException; |
| 34 | |
| 35 | /** |
| 36 | * Parse the UID into elements which are used to generate the UID. <br> |
| 37 | * Such as timestamp & workerId & sequence... |
| 38 | * |
| 39 | * @param uid |
| 40 | * @return Parsed info |
| 41 | */ |
| 42 | String parseUID(long uid); |
| 43 | |
| 44 | } |
no outgoing calls
no test coverage detected