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

org.jboss.resteasy.reactive.client.impl.ClientRestResponseBuilderImpl Maven / Gradle / Ivy

There is a newer version: 3.17.5
Show newest version
package org.jboss.resteasy.reactive.client.impl;

import java.io.InputStream;
import java.net.URI;

import org.jboss.resteasy.reactive.RestResponse;
import org.jboss.resteasy.reactive.common.NotImplementedYet;
import org.jboss.resteasy.reactive.common.jaxrs.AbstractRestResponseBuilder;
import org.jboss.resteasy.reactive.common.jaxrs.RestResponseImpl;

public class ClientRestResponseBuilderImpl extends AbstractRestResponseBuilder { //TODO: should not extend the server version

    InputStream entityStream;
    RestClientRequestContext restClientRequestContext;

    public ClientRestResponseBuilderImpl invocationState(RestClientRequestContext restClientRequestContext) {
        this.restClientRequestContext = restClientRequestContext;
        return this;
    }

    public ClientRestResponseBuilderImpl entityStream(InputStream entityStream) {
        this.entityStream = entityStream;
        return this;
    }

    @Override
    protected AbstractRestResponseBuilder doClone() {
        return new ClientRestResponseBuilderImpl<>();
    }

    @Override
    public RestResponseImpl build() {
        ClientRestResponseImpl response = new ClientRestResponseImpl<>();
        populateResponse(response);
        response.restClientRequestContext = restClientRequestContext;
        response.setEntityStream(entityStream);
        return response;
    }

    @Override
    public RestResponse.ResponseBuilder contentLocation(URI location) {
        //TODO: needs some thinking
        throw new NotImplementedYet();
    }

    @Override
    public RestResponse.ResponseBuilder location(URI location) {
        throw new NotImplementedYet();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy