Class AuthErrorResponseBuilder

java.lang.Object
com.commercetools.api.models.error.AuthErrorResponseBuilder
All Implemented Interfaces:
Builder<AuthErrorResponse>

public class AuthErrorResponseBuilder extends Object implements Builder<AuthErrorResponse>
AuthErrorResponseBuilder
Example to create an instance using the builder pattern

     AuthErrorResponse authErrorResponse = AuthErrorResponse.builder()
             .statusCode(1)
             .message("{message}")
             .plusErrors(errorsBuilder -> errorsBuilder)
             .error("{error}")
             .build()
 
  • Constructor Details

    • AuthErrorResponseBuilder

      public AuthErrorResponseBuilder()
  • Method Details

    • statusCode

      public AuthErrorResponseBuilder statusCode(Integer statusCode)

      HTTP status code corresponding to the error.

      Parameters:
      statusCode - value to be set
      Returns:
      Builder
    • message

      public AuthErrorResponseBuilder message(String message)

      First error message in the errors array.

      Parameters:
      message - value to be set
      Returns:
      Builder
    • errors

      public AuthErrorResponseBuilder errors(ErrorObject... errors)

      Authentication and authorization-related errors returned for a request.

      Parameters:
      errors - value to be set
      Returns:
      Builder
    • errors

      public AuthErrorResponseBuilder errors(List<ErrorObject> errors)

      Authentication and authorization-related errors returned for a request.

      Parameters:
      errors - value to be set
      Returns:
      Builder
    • plusErrors

      public AuthErrorResponseBuilder plusErrors(ErrorObject... errors)

      Authentication and authorization-related errors returned for a request.

      Parameters:
      errors - value to be set
      Returns:
      Builder
    • plusErrors

      public AuthErrorResponseBuilder plusErrors(Function<ErrorObjectBuilder,Builder<? extends ErrorObject>> builder)

      Authentication and authorization-related errors returned for a request.

      Parameters:
      builder - function to build the errors value
      Returns:
      Builder
    • withErrors

      public AuthErrorResponseBuilder withErrors(Function<ErrorObjectBuilder,Builder<? extends ErrorObject>> builder)

      Authentication and authorization-related errors returned for a request.

      Parameters:
      builder - function to build the errors value
      Returns:
      Builder
    • error

      public AuthErrorResponseBuilder error(String error)

      Error code as per the OAuth 2.0 specification. For example: "access_denied".

      Parameters:
      error - value to be set
      Returns:
      Builder
    • error_description

      public AuthErrorResponseBuilder error_description(@Nullable String error_description)

      Plain text description of the first error.

      Parameters:
      error_description - value to be set
      Returns:
      Builder
    • getStatusCode

      public Integer getStatusCode()

      HTTP status code corresponding to the error.

      Returns:
      statusCode
    • getMessage

      public String getMessage()

      First error message in the errors array.

      Returns:
      message
    • getErrors

      public List<ErrorObject> getErrors()

      Authentication and authorization-related errors returned for a request.

      Returns:
      errors
    • getError

      public String getError()

      Error code as per the OAuth 2.0 specification. For example: "access_denied".

      Returns:
      error
    • getError_description

      @Nullable public String getError_description()

      Plain text description of the first error.

      Returns:
      error_description
    • build

      public AuthErrorResponse build()
      builds AuthErrorResponse with checking for non-null required values
      Specified by:
      build in interface Builder<AuthErrorResponse>
      Returns:
      AuthErrorResponse
    • buildUnchecked

      public AuthErrorResponse buildUnchecked()
      builds AuthErrorResponse without checking for non-null required values
      Returns:
      AuthErrorResponse
    • of

      public static AuthErrorResponseBuilder of()
      factory method for an instance of AuthErrorResponseBuilder
      Returns:
      builder
    • of

      public static AuthErrorResponseBuilder of(AuthErrorResponse template)
      create builder for AuthErrorResponse instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder