public class GenIdFactory extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
GenType_IntSerialIdReturnLong |
static String |
GenType_OneTimeSnowflakeId |
static String |
GenType_PearFlowerId |
static String |
GenType_SerialUniqueId |
| Modifier and Type | Method and Description |
|---|---|
static long |
get()
使用默认的命名key来获取id.
|
static long |
get(String bizType)
get id from factory.default GenType class is: SerialUniqueId.
|
static long |
get(String bizType,
String genType) |
static long[] |
getRangeId(int sizeOfIds)
获取一个范围的id.
|
static long[] |
getRangeId(String bizType,
int sizeOfIds)
获取一批id号
|
static long[] |
getRangeId(String bizType,
String genType,
int sizeOfIds)
获取一批id号
|
public static final String GenType_SerialUniqueId
public static final String GenType_OneTimeSnowflakeId
public static final String GenType_PearFlowerId
public static final String GenType_IntSerialIdReturnLong
public static long get()
public static long[] getRangeId(int sizeOfIds)
sizeOfIds - size of Idspublic static long get(String bizType)
bizType - bizType作为隔离的命名空间.bizType as namespace.public static long get(String bizType, String genType)
bizType - bizType作为隔离的命名空间.bizType as namespace.genType - The value is one of "SerialUniqueId","OneTimeSnowflakeId","PearFlowerId" or "IntSerialIdReturnLong".public static long[] getRangeId(String bizType, int sizeOfIds)
bizType - bizType作为隔离的命名空间.bizType as namespace.sizeOfIds - 一批次获取id号的数量. size of Ids.public static long[] getRangeId(String bizType, String genType, int sizeOfIds)
bizType - bizType作为隔离的命名空间.bizType as namespace.genType - The value is one of "SerialUniqueId","OneTimeSnowflakeId" or "PearFlowerId".sizeOfIds - 一批次获取id号的数量. size of Ids.Copyright © 2024. All rights reserved.