Record Class UlidConfig
java.lang.Object
java.lang.Record
cloud.opencode.base.id.ulid.UlidConfig
- Record Components:
monotonic- whether to use monotonic mode | 是否使用单调模式Security | 安全性:
- Thread-safe: Yes (immutable record) - 线程安全: 是(不可变记录)
- Null-safe: No - 空值安全: 否
ULID Configuration
ULID配置
Configuration for ULID generation including entropy source settings.
ULID生成配置,包括熵源设置。
Features | 主要功能:
- Monotonic mode configuration - 单调模式配置
- Entropy source selection - 熵源选择
Usage Examples | 使用示例:
UlidConfig config = UlidConfig.defaultConfig();
UlidConfig monotonic = UlidConfig.monotonic();
- Since:
- JDK 25, opencode-base-id V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final UlidConfigDefault configuration (monotonic) 默认配置(单调) -
Constructor Summary
ConstructorsConstructorDescriptionUlidConfig(boolean monotonic) Creates an instance of aUlidConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic UlidConfigCreates default configuration 创建默认配置final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of themonotonicrecord component.static UlidConfigCreates non-monotonic configuration 创建非单调配置final StringtoString()Returns a string representation of this record class.static UlidConfigCreates monotonic configuration 创建单调配置
-
Field Details
-
DEFAULT
Default configuration (monotonic) 默认配置(单调)
-
-
Constructor Details
-
UlidConfig
public UlidConfig(boolean monotonic) Creates an instance of aUlidConfigrecord class.- Parameters:
monotonic- the value for themonotonicrecord component
-
-
Method Details
-
defaultConfig
Creates default configuration 创建默认配置- Returns:
- default configuration | 默认配置
-
withMonotonic
Creates monotonic configuration 创建单调配置- Returns:
- monotonic configuration | 单调配置
-
nonMonotonic
Creates non-monotonic configuration 创建非单调配置- Returns:
- non-monotonic configuration | 非单调配置
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
monotonic
-