Class ApiExceptionBuilder

java.lang.Object
com.microsoft.kiota.ApiExceptionBuilder

public class ApiExceptionBuilder extends Object
Builder class for ApiException.
  • Constructor Details

    • ApiExceptionBuilder

      public ApiExceptionBuilder()
      Constructs an empty ApiExceptionBuilder
    • ApiExceptionBuilder

      public ApiExceptionBuilder(@Nonnull Supplier<Parsable> builder)
      Constructs an ApiExceptionBuilder starting from a base ApiException
      Parameters:
      builder - A builder for the ApiException to be used as a base.
  • Method Details

    • withMessage

      @Nonnull public ApiExceptionBuilder withMessage(@Nonnull String message)
      Assign the message to the builder
      Parameters:
      message - The message to be attached to this ApiException.
      Returns:
      The builder object.
    • withThrowable

      @Nonnull public ApiExceptionBuilder withThrowable(@Nonnull Throwable exception)
      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

      @Nonnull public ApiExceptionBuilder withResponseStatusCode(int responseStatusCode)
      Assign the response status code to the builder
      Parameters:
      responseStatusCode - an int representing the response status code.
      Returns:
      The builder object.
    • withResponseHeaders

      @Nonnull public ApiExceptionBuilder withResponseHeaders(@Nonnull ResponseHeaders responseHeaders)
      Assign the response headers to the builder
      Parameters:
      responseHeaders - the response headers to be added to this ApiException.
      Returns:
      The builder object.
    • build

      @Nonnull public ApiException build()
      Build and return an instance of ApiException
      Returns:
      The built ApiException.