Class ProblemDetail.Builder

java.lang.Object
cloud.opencode.base.web.problem.ProblemDetail.Builder
Enclosing class:
ProblemDetail

public static final class ProblemDetail.Builder extends Object
Builder for ProblemDetail ProblemDetail 构建器
Since:
JDK 25, opencode-base-web V1.0.3
Author:
Leon Soo www.LeonSoo.com
  • Method Details

    • type

      public ProblemDetail.Builder type(String type)
      Set the problem type URI. 设置问题类型 URI。
      Parameters:
      type - the type URI | 类型 URI
      Returns:
      this builder | 此构建器
    • title

      public ProblemDetail.Builder title(String title)
      Set the title. 设置标题。
      Parameters:
      title - the title | 标题
      Returns:
      this builder | 此构建器
    • status

      public ProblemDetail.Builder status(int status)
      Set the HTTP status code. 设置 HTTP 状态码。
      Parameters:
      status - the status code | 状态码
      Returns:
      this builder | 此构建器
    • detail

      public ProblemDetail.Builder detail(String detail)
      Set the detail message. 设置详细说明。
      Parameters:
      detail - the detail | 详细说明
      Returns:
      this builder | 此构建器
    • instance

      public ProblemDetail.Builder instance(String instance)
      Set the instance URI. 设置实例 URI。
      Parameters:
      instance - the instance URI | 实例 URI
      Returns:
      this builder | 此构建器
    • extension

      public ProblemDetail.Builder extension(String key, Object value)
      Add an extension property. 添加扩展属性。
      Parameters:
      key - the extension key | 扩展键
      value - the extension value | 扩展值
      Returns:
      this builder | 此构建器
      Throws:
      NullPointerException - if key is null | 如果键为 null
    • build

      public ProblemDetail build()
      Build the ProblemDetail. 构建 ProblemDetail。
      Returns:
      the problem detail | 问题详情