Interface IdGenerator<T>
- Type Parameters:
T- the type of ID generated | 生成的ID类型
- All Known Implementing Classes:
AtomicIdGenerator, KsuidGenerator, NanoIdGenerator, RandomIdGenerator, SafeJsSnowflakeGenerator, SegmentIdGenerator, SnowflakeGenerator, TimestampIdGenerator, TsidGenerator, TypedIdGenerator, UlidGenerator, UuidGenerator, UuidV4Generator, UuidV7Generator
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
ID Generator Interface
ID生成器接口
Unified interface for all ID generators in this library. Implementations must be thread-safe.
本库所有ID生成器的统一接口。实现必须是线程安全的。
Features | 主要功能:
- Single ID generation - 单个ID生成
- Batch ID generation - 批量ID生成
- Generator type identification - 生成器类型标识
Usage Examples | 使用示例:
IdGenerator<Long> snowflake = SnowflakeGenerator.create();
long id = snowflake.generate();
List<Long> ids = snowflake.generateBatch(100);
Security | 安全性:
- Thread-safe: Implementation dependent - 线程安全: 取决于实现
- Since:
- JDK 25, opencode-base-id V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Method Summary
-
Method Details
-
generate
-
generateBatch
-
getType
-