Class ApiErrorModel

java.lang.Object
net.ygbstudio.jbrave.core.domain.dto.error.ApiErrorModel

public final class ApiErrorModel extends Object
Error model object that Brave Search API uses to communicate with the user and provide remediation steps. It deserialises the error code to a native enum constant to facilitate error handling strategies with switch statements.
  • Constructor Details

    • ApiErrorModel

      @Contract(pure=true) public ApiErrorModel(@NotNull @NotNull ApiErrorModel.Builder builder)
      Creates a new error model from the given builder.
      Parameters:
      builder - the builder carrying the error fields
  • Method Details

    • id

      public String id()
      Returns the error identifier.
      Returns:
      the error identifier
    • code

      public BraveErrorCode code()
      Returns the error code.
      Returns:
      the error code
    • detail

      public String detail()
      Returns the error detail message.
      Returns:
      the detail message
    • status

      public Integer status()
      Returns the HTTP status code associated with the error.
      Returns:
      the status code
    • meta

      public ErrorMeta meta()
      Returns additional error metadata.
      Returns:
      the error metadata
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object