org.smartboot.http.client.HeaderWrapper Maven / Gradle / Ivy
package org.smartboot.http.client;
/**
* @author 三刀([email protected])
* @version V1.0 , 2023/2/13
*/
class HeaderWrapper implements Header {
private final T rest;
private final Header extends HttpRest> header;
public HeaderWrapper(T rest, Header extends HttpRest> header) {
this.rest = rest;
this.header = header;
}
@Override
public Header add(String headerName, String headerValue) {
header.add(headerName, headerValue);
return this;
}
@Override
public Header set(String headerName, String headerValue) {
header.set(headerName, headerValue);
return this;
}
@Override
public Header setContentType(String contentType) {
header.setContentType(contentType);
return this;
}
@Override
public Header setContentLength(int contentLength) {
header.setContentLength(contentLength);
return this;
}
@Override
public T done() {
return rest;
}
}