Class AuditEvent.Builder
java.lang.Object
cloud.opencode.base.log.audit.AuditEvent.Builder
- Enclosing class:
AuditEvent
Builder for AuditEvent.
AuditEvent 的构建器。
- Since:
- JDK 25, opencode-base-log V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the audit event.Adds a detail.Adds multiple details.Sets the event ID.failure()Sets the result as failure.Sets the IP address.Sets the result.success()Sets the result as success.Sets the target.Sets the target ID.Sets the timestamp.Sets the user agent.Sets the user ID.
-
Method Details
-
eventId
Sets the event ID. 设置事件 ID。- Parameters:
eventId- the event ID - 事件 ID- Returns:
- this builder - 此构建器
-
timestamp
Sets the timestamp. 设置时间戳。- Parameters:
timestamp- the timestamp - 时间戳- Returns:
- this builder - 此构建器
-
userId
Sets the user ID. 设置用户 ID。- Parameters:
userId- the user ID - 用户 ID- Returns:
- this builder - 此构建器
-
target
Sets the target. 设置目标。- Parameters:
target- the target - 目标- Returns:
- this builder - 此构建器
-
targetId
Sets the target ID. 设置目标 ID。- Parameters:
targetId- the target ID - 目标 ID- Returns:
- this builder - 此构建器
-
result
Sets the result. 设置结果。- Parameters:
result- the result - 结果- Returns:
- this builder - 此构建器
-
success
Sets the result as success. 设置结果为成功。- Returns:
- this builder - 此构建器
-
failure
Sets the result as failure. 设置结果为失败。- Returns:
- this builder - 此构建器
-
ip
Sets the IP address. 设置 IP 地址。- Parameters:
ip- the IP address - IP 地址- Returns:
- this builder - 此构建器
-
userAgent
Sets the user agent. 设置用户代理。- Parameters:
userAgent- the user agent - 用户代理- Returns:
- this builder - 此构建器
-
detail
Adds a detail. 添加详情。- Parameters:
key- the detail key - 详情键value- the detail value - 详情值- Returns:
- this builder - 此构建器
-
details
Adds multiple details. 添加多个详情。- Parameters:
details- the details - 详情- Returns:
- this builder - 此构建器
-
build
-