Skip to content

Commit

Permalink
removing accept mime type - it's a header
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Kerwin committed May 25, 2021
1 parent a633311 commit acf29e1
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions src/main/java/com/synopsys/integration/rest/request/Request.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,22 @@
public class Request extends Stringable implements Buildable {
private final HttpUrl url;
private final HttpMethod method;
private final String acceptMimeType;
private final Charset bodyEncoding;
private final Map<String, Set<String>> queryParameters = new HashMap<>();
private final Map<String, String> headers = new HashMap<>();
private final BodyContent bodyContent;

public Request(HttpUrl url, HttpMethod method, String acceptMimeType, Charset bodyEncoding, Map<String, Set<String>> queryParameters, Map<String, String> headers, BodyContent bodyContent) {
public Request(HttpUrl url, HttpMethod method, Charset bodyEncoding, Map<String, Set<String>> queryParameters, Map<String, String> headers, BodyContent bodyContent) {
this.url = url;
this.method = method;
this.acceptMimeType = acceptMimeType;
this.bodyEncoding = null == bodyEncoding ? StandardCharsets.UTF_8 : bodyEncoding;
this.queryParameters.putAll(queryParameters);
this.headers.putAll(headers);
this.bodyContent = bodyContent;
}

public Request(Builder builder) {
this(builder.url, builder.method, builder.acceptMimeType, builder.bodyEncoding, builder.queryParameters, builder.headers, builder.bodyContent);
this(builder.url, builder.method, builder.bodyEncoding, builder.queryParameters, builder.headers, builder.bodyContent);
}

public Request.Builder createBuilder() {
Expand All @@ -62,10 +60,6 @@ public HttpMethod getMethod() {
return method;
}

public String getAcceptMimeType() {
return acceptMimeType;
}

public Charset getBodyEncoding() {
return bodyEncoding;
}
Expand All @@ -85,7 +79,6 @@ public BodyContent getBodyContent() {
public static class Builder extends IntegrationBuilder<Request> {
private HttpUrl url;
private HttpMethod method;
private String acceptMimeType;
private Charset bodyEncoding;
private Map<String, Set<String>> queryParameters = new HashMap<>();
private Map<String, String> headers = new HashMap<>();
Expand All @@ -94,7 +87,6 @@ public static class Builder extends IntegrationBuilder<Request> {
public Builder(Request request) {
url = request.url;
method = request.method;
acceptMimeType = request.acceptMimeType;
bodyEncoding = request.bodyEncoding;
queryParameters.putAll(request.queryParameters);
headers.putAll(request.headers);
Expand All @@ -104,7 +96,6 @@ public Builder(Request request) {
public Builder(Builder builder) {
url = builder.url;
method = builder.method;
acceptMimeType = builder.acceptMimeType;
bodyEncoding = builder.bodyEncoding;
queryParameters.putAll(builder.queryParameters);
headers.putAll(builder.headers);
Expand Down Expand Up @@ -135,7 +126,6 @@ protected Request buildWithoutValidation() {
return new Request(
getUrl(),
getMethod(),
getAcceptMimeType(),
getBodyEncoding(),
getQueryParameters(),
getHeaders(),
Expand All @@ -157,11 +147,6 @@ public Builder method(HttpMethod method) {
return this;
}

public Builder acceptMimeType(String acceptMimeType) {
this.acceptMimeType = acceptMimeType;
return this;
}

public Builder bodyEncoding(Charset bodyEncoding) {
this.bodyEncoding = bodyEncoding;
return this;
Expand Down Expand Up @@ -205,10 +190,6 @@ public HttpMethod getMethod() {
return method;
}

public String getAcceptMimeType() {
return acceptMimeType;
}

public Charset getBodyEncoding() {
return bodyEncoding;
}
Expand Down

0 comments on commit acf29e1

Please sign in to comment.