Class AgentResponsesErrorResponseBuilder

java.lang.Object
com.commercetools.api.models.agent.AgentResponsesErrorResponseBuilder
All Implemented Interfaces:
Builder<AgentResponsesErrorResponse>

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

     AgentResponsesErrorResponse agentResponsesErrorResponse = AgentResponsesErrorResponse.builder()
             .statusCode(1)
             .message("{message}")
             .plusErrors(errorsBuilder -> errorsBuilder)
             .build()
 
  • Constructor Details

    • AgentResponsesErrorResponseBuilder

      public AgentResponsesErrorResponseBuilder()
  • Method Details

    • statusCode

      public AgentResponsesErrorResponseBuilder statusCode(Integer statusCode)

      HTTP status code corresponding to the error.

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

      public AgentResponsesErrorResponseBuilder message(String message)

      First error message in the errors array.

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

      Errors returned for a request.

      A single error response can contain multiple errors if the errors are related to the same HTTP status code such as 400.

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

      Errors returned for a request.

      A single error response can contain multiple errors if the errors are related to the same HTTP status code such as 400.

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

      public AgentResponsesErrorResponseBuilder plusErrors(ErrorObject... errors)

      Errors returned for a request.

      A single error response can contain multiple errors if the errors are related to the same HTTP status code such as 400.

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

      Errors returned for a request.

      A single error response can contain multiple errors if the errors are related to the same HTTP status code such as 400.

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

      Errors returned for a request.

      A single error response can contain multiple errors if the errors are related to the same HTTP status code such as 400.

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

      public AgentResponsesErrorResponseBuilder threadId(@Nullable String threadId)

      Identifier of the workflow run that raised the error. Present on errors raised once the workflow has started. Absent on errors raised while parsing the request, before the workflow starts.

      Parameters:
      threadId - 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()

      Errors returned for a request.

      A single error response can contain multiple errors if the errors are related to the same HTTP status code such as 400.

      Returns:
      errors
    • getThreadId

      @Nullable public String getThreadId()

      Identifier of the workflow run that raised the error. Present on errors raised once the workflow has started. Absent on errors raised while parsing the request, before the workflow starts.

      Returns:
      threadId
    • build

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

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

      factory method for an instance of AgentResponsesErrorResponseBuilder
      Returns:
      builder
    • of

      create builder for AgentResponsesErrorResponse instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder