Class ObjectIdGenerators

java.lang.Object
cloud.opencode.base.json.identity.ObjectIdGenerators

public final class ObjectIdGenerators extends Object
Object ID Generators - Common Object Identity Generator Implementations 对象 ID 生成器集合 - 常用对象身份生成器实现

Provides built-in generator implementations for common identity strategies: auto-incrementing integers, UUIDs, property-based IDs, and string IDs.

提供常用身份策略的内置生成器实现:自增整数、UUID、基于属性的 ID 和字符串 ID。

Example | 示例:

@JsonIdentityInfo(generator = ObjectIdGenerators.IntSequenceGenerator.class)
public class Node {
    private String name;
    private List<Node> children;
}

Security | 安全性:

  • Thread-safe: IntSequenceGenerator uses AtomicInteger - 线程安全: IntSequenceGenerator 使用 AtomicInteger
  • Null-safe: Generators accept null forPojo where applicable - 空值安全: 生成器在适用时接受空 forPojo
Since:
JDK 25, opencode-base-json V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also: