Class ApiErrorModel.Builder
java.lang.Object
net.ygbstudio.jbrave.core.domain.dto.error.ApiErrorModel.Builder
- Enclosing class:
ApiErrorModel
Builder for
ApiErrorModel instances.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull ApiErrorModelbuild()Builds a newApiErrorModelfrom the current builder state.Sets the error code, converting the raw value to theBraveErrorCodeenum.Sets the error detail message.Sets the error identifier.Sets additional error metadata.Sets the HTTP status code associated with the error.
-
Constructor Details
-
Builder
public Builder()Creates a new builder with all fields unset.
-
-
Method Details
-
id
Sets the error identifier.- Parameters:
id- the error identifier- Returns:
- this builder
-
code
Sets the error code, converting the raw value to theBraveErrorCodeenum.- Parameters:
code- the raw error code value- Returns:
- this builder
-
detail
Sets the error detail message.- Parameters:
detail- the detail message- Returns:
- this builder
-
status
Sets the HTTP status code associated with the error.- Parameters:
status- the status code- Returns:
- this builder
-
meta
Sets additional error metadata.- Parameters:
meta- the error metadata- Returns:
- this builder
-
build
Builds a newApiErrorModelfrom the current builder state.- Returns:
- a new
ApiErrorModelinstance
-