Class ExternalSystemResponseBuilder
- java.lang.Object
-
- org.openbravo.service.externalsystem.ExternalSystemResponseBuilder
-
public class ExternalSystemResponseBuilder extends Object
A builder of instances
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ExternalSystemResponse
build()
static ExternalSystemResponseBuilder
newBuilder()
ExternalSystemResponseBuilder
withData(Object data)
Sets the data received from the external system responseExternalSystemResponseBuilder
withError(Object error)
Sets the error information of the external system response.ExternalSystemResponseBuilder
withStatusCode(int statusCode)
Sets the status code of the external system responseExternalSystemResponseBuilder
withType(ExternalSystemResponse.Type type)
Sets the type of the external system response
-
-
-
Method Detail
-
newBuilder
public static ExternalSystemResponseBuilder newBuilder()
- Returns:
- a new ExternalSystemResponseBuilder
-
withData
public ExternalSystemResponseBuilder withData(Object data)
Sets the data received from the external system response- Parameters:
data
- the data received in the external system response
-
withStatusCode
public ExternalSystemResponseBuilder withStatusCode(int statusCode)
Sets the status code of the external system response- Parameters:
statusCode
- the status code of the response
-
withType
public ExternalSystemResponseBuilder withType(ExternalSystemResponse.Type type)
Sets the type of the external system response- Parameters:
type
- the response type- See Also:
ExternalSystemResponse.Type
-
withError
public ExternalSystemResponseBuilder withError(Object error)
Sets the error information of the external system response. It also sets the response type asExternalSystemResponse.Type.ERROR
.- Parameters:
error
- the error information
-
build
public ExternalSystemResponse build()
- Returns:
- the built
ExternalSystemResponse
-
-