Class ApiErrorModel.Builder

java.lang.Object
net.ygbstudio.jbrave.core.domain.dto.error.ApiErrorModel.Builder
Enclosing class:
ApiErrorModel

public static final class ApiErrorModel.Builder extends Object
Builder for ApiErrorModel instances.
  • Constructor Details

    • Builder

      public Builder()
      Creates a new builder with all fields unset.
  • Method Details

    • id

      public ApiErrorModel.Builder id(String id)
      Sets the error identifier.
      Parameters:
      id - the error identifier
      Returns:
      this builder
    • code

      public ApiErrorModel.Builder code(String code)
      Sets the error code, converting the raw value to the BraveErrorCode enum.
      Parameters:
      code - the raw error code value
      Returns:
      this builder
    • detail

      public ApiErrorModel.Builder detail(String detail)
      Sets the error detail message.
      Parameters:
      detail - the detail message
      Returns:
      this builder
    • status

      public ApiErrorModel.Builder status(Integer status)
      Sets the HTTP status code associated with the error.
      Parameters:
      status - the status code
      Returns:
      this builder
    • meta

      public ApiErrorModel.Builder meta(ErrorMeta meta)
      Sets additional error metadata.
      Parameters:
      meta - the error metadata
      Returns:
      this builder
    • build

      @Contract(" -> new") @NotNull public @NotNull ApiErrorModel build()
      Builds a new ApiErrorModel from the current builder state.
      Returns:
      a new ApiErrorModel instance