Package com.microsoft.kiota
Class ApiExceptionBuilder
java.lang.Object
com.microsoft.kiota.ApiExceptionBuilder
Builder class for ApiException.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs an empty ApiExceptionBuilderApiExceptionBuilder(Supplier<Parsable> builder) Constructs an ApiExceptionBuilder starting from a base ApiException -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build and return an instance of ApiExceptionwithMessage(String message) Assign the message to the builderwithResponseHeaders(ResponseHeaders responseHeaders) Assign the response headers to the builderwithResponseStatusCode(int responseStatusCode) Assign the response status code to the builderwithThrowable(Throwable exception) Assign the Throwable cause of the Exception to the builder
-
Constructor Details
-
ApiExceptionBuilder
public ApiExceptionBuilder()Constructs an empty ApiExceptionBuilder -
ApiExceptionBuilder
Constructs an ApiExceptionBuilder starting from a base ApiException- Parameters:
builder- A builder for the ApiException to be used as a base.
-
-
Method Details
-
withMessage
Assign the message to the builder- Parameters:
message- The message to be attached to this ApiException.- Returns:
- The builder object.
-
withThrowable
Assign the Throwable cause of the Exception to the builder- Parameters:
exception- The Throwable to be used as Cause for this ApiException.- Returns:
- The builder object.
-
withResponseStatusCode
Assign the response status code to the builder- Parameters:
responseStatusCode- an int representing the response status code.- Returns:
- The builder object.
-
withResponseHeaders
Assign the response headers to the builder- Parameters:
responseHeaders- the response headers to be added to this ApiException.- Returns:
- The builder object.
-
build
Build and return an instance of ApiException- Returns:
- The built ApiException.
-