All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.rapidapi.p.wordsapiv1.CompatibilityFactoryImpl Maven / Gradle / Ivy

/*
 * WordsAPILib
 *
 * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
 */

package com.rapidapi.p.wordsapiv1;

import com.rapidapi.p.wordsapiv1.http.Headers;
import com.rapidapi.p.wordsapiv1.http.client.HttpContext;
import com.rapidapi.p.wordsapiv1.http.request.HttpBodyRequest;
import com.rapidapi.p.wordsapiv1.http.request.HttpMethod;
import com.rapidapi.p.wordsapiv1.http.request.HttpRequest;
import com.rapidapi.p.wordsapiv1.http.response.HttpResponse;
import com.rapidapi.p.wordsapiv1.http.response.HttpStringResponse;
import io.apimatic.coreinterfaces.compatibility.CompatibilityFactory;
import io.apimatic.coreinterfaces.http.Context;
import io.apimatic.coreinterfaces.http.HttpHeaders;
import io.apimatic.coreinterfaces.http.Method;
import io.apimatic.coreinterfaces.http.request.Request;
import io.apimatic.coreinterfaces.http.response.ApiResponseType;
import io.apimatic.coreinterfaces.http.response.DynamicType;
import io.apimatic.coreinterfaces.http.response.Response;
import java.io.InputStream;
import java.util.AbstractMap.SimpleEntry;
import java.util.List;
import java.util.Map;

public class CompatibilityFactoryImpl implements CompatibilityFactory {

    @Override
    public Context createHttpContext(Request request, Response response) {
        return new HttpContext((HttpRequest) request, (HttpResponse) response);
    }

    @Override
    public Request createHttpRequest(Method httpMethod,
            StringBuilder queryUrlBuilder, HttpHeaders headers, Map queryParameters,
            List> formParameters) {
        return new HttpRequest(HttpMethod.valueOf(httpMethod.toString()), queryUrlBuilder,
                (Headers) headers, queryParameters, formParameters);
    }

    @Override
    public Request createHttpRequest(Method httpMethod,
            StringBuilder queryUrlBuilder, HttpHeaders headers, Map queryParameters,
            Object body) {
        return new HttpBodyRequest(HttpMethod.valueOf(httpMethod.toString()), queryUrlBuilder,
                (Headers) headers, queryParameters, body);
    }

    @Override
    public Response createHttpResponse(int code, HttpHeaders headers, InputStream rawBody) {
        return new HttpResponse(code, (Headers) headers, rawBody);
    }

    @Override
    public Response createHttpResponse(int code, HttpHeaders headers, InputStream rawBody,
            String body) {
        return new HttpStringResponse(code, (Headers) headers, rawBody, body);
    }

    @Override
    public HttpHeaders createHttpHeaders(Map> headers) {
        return new Headers(headers);
    }

    @Override
    public HttpHeaders createHttpHeaders(HttpHeaders headers) {
        return new Headers((Headers) headers);
    }

    @Override
    public HttpHeaders createHttpHeaders() {
        return new Headers();
    }

    @Override
    public DynamicType createDynamicResponse(Response httpResponse) {
          return null;
    }

    @Override
    public  ApiResponseType createApiResponse(int statusCode, HttpHeaders headers, T result) {
          return null;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy