com.hubspot.chrome.devtools.client.core.network.Request Maven / Gradle / Ivy
package com.hubspot.chrome.devtools.client.core.network;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.hubspot.chrome.devtools.client.core.security.MixedContentType;
/**
* HTTP request data.
*/
public final class Request {
private String url;
private String method;
private Headers headers;
private String postData;
private Boolean hasPostData;
private MixedContentType mixedContentType;
private ResourcePriority initialPriority;
private String referrerPolicy;
private Boolean isLinkPreload;
@JsonCreator
public Request(@JsonProperty("url") String url, @JsonProperty("method") String method,
@JsonProperty("headers") Headers headers, @JsonProperty("postData") String postData,
@JsonProperty("hasPostData") Boolean hasPostData,
@JsonProperty("mixedContentType") MixedContentType mixedContentType,
@JsonProperty("initialPriority") ResourcePriority initialPriority,
@JsonProperty("referrerPolicy") String referrerPolicy,
@JsonProperty("isLinkPreload") Boolean isLinkPreload) {
this.url = url;
this.method = method;
this.headers = headers;
this.postData = postData;
this.hasPostData = hasPostData;
this.mixedContentType = mixedContentType;
this.initialPriority = initialPriority;
this.referrerPolicy = referrerPolicy;
this.isLinkPreload = isLinkPreload;
}
public String getUrl() {
return url;
}
public String getMethod() {
return method;
}
public Headers getHeaders() {
return headers;
}
public String getPostData() {
return postData;
}
public Boolean getHasPostData() {
return hasPostData;
}
public MixedContentType getMixedContentType() {
return mixedContentType;
}
public ResourcePriority getInitialPriority() {
return initialPriority;
}
public String getReferrerPolicy() {
return referrerPolicy;
}
public Boolean getIsLinkPreload() {
return isLinkPreload;
}
public static Request.Builder builder() {
return new Request.Builder();
}
public static final class Builder {
private String url;
private String method;
private Headers headers;
private String postData;
private Boolean hasPostData;
private MixedContentType mixedContentType;
private ResourcePriority initialPriority;
private String referrerPolicy;
private Boolean isLinkPreload;
private Builder() {
}
public Request.Builder setUrl(String url) {
this.url = url;
return this;
}
public Request.Builder setMethod(String method) {
this.method = method;
return this;
}
public Request.Builder setHeaders(Headers headers) {
this.headers = headers;
return this;
}
public Request.Builder setPostData(String postData) {
this.postData = postData;
return this;
}
public Request.Builder setHasPostData(Boolean hasPostData) {
this.hasPostData = hasPostData;
return this;
}
public Request.Builder setMixedContentType(MixedContentType mixedContentType) {
this.mixedContentType = mixedContentType;
return this;
}
public Request.Builder setInitialPriority(ResourcePriority initialPriority) {
this.initialPriority = initialPriority;
return this;
}
public Request.Builder setReferrerPolicy(String referrerPolicy) {
this.referrerPolicy = referrerPolicy;
return this;
}
public Request.Builder setIsLinkPreload(Boolean isLinkPreload) {
this.isLinkPreload = isLinkPreload;
return this;
}
public Request build() {
return new Request(url, method, headers, postData, hasPostData, mixedContentType, initialPriority, referrerPolicy, isLinkPreload);
}
}
}