congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
SimpleResponse$Builder.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.atlassian.oai.validator.model.SimpleResponse$Builder
constructor

Best Java code snippets using com.atlassian.oai.validator.model.SimpleResponse$Builder.<init> (Showing top 9 results out of 315)

origin: com.atlassian.oai/swagger-request-validator-mockmvc

/**
 * Builds a {@link Response} for the OpenAPI validator out of the
 * original {@link MockHttpServletResponse}.
 *
 * @param originalResponse the original {@link MockHttpServletResponse}
 */
@Nonnull
public static Response of(@Nonnull final MockHttpServletResponse originalResponse) {
  requireNonNull(originalResponse, "An original response is required");
  final SimpleResponse.Builder builder = new SimpleResponse.Builder(originalResponse.getStatus())
      .withBody(getBody(originalResponse));
  originalResponse.getHeaderNames()
      .forEach(header -> builder.withHeader(header, originalResponse.getHeaders(header)));
  return builder.build();
}
origin: com.atlassian.oai/swagger-request-validator-wiremock

  /**
   * Builds a {@link Response} for the OpenAPI validator out of the
   * original {@link com.github.tomakehurst.wiremock.http.Response}.
   *
   * @param originalResponse the original {@link com.github.tomakehurst.wiremock.http.Response}
   */
  @Nonnull
  public static Response of(@Nonnull final com.github.tomakehurst.wiremock.http.Response originalResponse) {
    requireNonNull(originalResponse, "An original response is required");
    final SimpleResponse.Builder builder = new SimpleResponse.Builder(originalResponse.getStatus())
        .withBody(originalResponse.getBodyAsString());
    originalResponse.getHeaders().all().forEach(header -> builder.withHeader(header.key(), header.values()));
    return builder.build();
  }
}
origin: com.atlassian.oai/swagger-request-validator-restassured

  /**
   * Builds a {@link Response} for the OpenAPI validator out of the
   * original {@link io.restassured.response.Response}.
   *
   * @param originalResponse the original {@link io.restassured.response.Response}
   */
  @Nonnull
  public static Response of(@Nonnull final io.restassured.response.Response originalResponse) {
    requireNonNull(originalResponse, "An original response is required");
    final SimpleResponse.Builder builder = new SimpleResponse.Builder(originalResponse.getStatusCode())
        .withBody(originalResponse.getBody().asString());
    if (originalResponse.getHeaders() != null) {
      originalResponse.getHeaders().forEach(header -> builder.withHeader(header.getName(), header.getValue()));
    }
    return builder.build();
  }
}
origin: com.atlassian.oai/swagger-request-validator-core

/**
 * A convenience method for creating a {@link SimpleResponse.Builder} with
 * the HTTP status code 404.
 *
 * @return a prepared {@link SimpleResponse.Builder}
 */
public static Builder notFound() {
  return new Builder(404);
}
origin: com.atlassian.oai/swagger-request-validator-core

/**
 * A convenience method for creating a {@link SimpleResponse.Builder} with
 * the HTTP status code 204.
 *
 * @return a prepared {@link SimpleResponse.Builder}
 */
public static Builder noContent() {
  return new Builder(204);
}
origin: com.atlassian.oai/swagger-request-validator-core

/**
 * A convenience method for creating a {@link SimpleResponse.Builder} with
 * the HTTP status code 200.
 *
 * @return a prepared {@link SimpleResponse.Builder}
 */
public static Builder ok() {
  return new Builder(200);
}
origin: com.atlassian.oai/swagger-request-validator-core

/**
 * Creates a {@link SimpleResponse.Builder} with the given HTTP status code.
 *
 * @param status the responses HTTP status code
 * @return a prepared {@link SimpleResponse.Builder}
 */
public static Builder status(final int status) {
  return new Builder(status);
}
origin: com.atlassian.oai/swagger-request-validator-core

/**
 * A convenience method for creating a {@link SimpleResponse.Builder} with
 * the HTTP status code 400.
 *
 * @return a prepared {@link SimpleResponse.Builder}
 */
public static Builder badRequest() {
  return new Builder(400);
}
origin: com.atlassian.oai/swagger-request-validator-core

/**
 * A convenience method for creating a {@link SimpleResponse.Builder} with
 * the HTTP status code 500.
 *
 * @return a prepared {@link SimpleResponse.Builder}
 */
public static Builder serverError() {
  return new Builder(500);
}
com.atlassian.oai.validator.modelSimpleResponse$Builder<init>

Javadoc

Creates a SimpleResponse.Builder with the given HTTP status code.

Popular methods of SimpleResponse$Builder

  • build
    Builds a SimpleResponse out of this builder.
  • withBody
    Adds a response body to this builder.
  • withHeader
    Adds a response header to this builder. If there was already a header with this name the values will
  • status
    Creates a SimpleResponse.Builder with the given HTTP status code.

Popular in Java

  • Creating JSON documents from java classes using gson
  • addToBackStack (FragmentTransaction)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • ImageIO (javax.imageio)
  • Join (org.hibernate.mapping)
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now