com.contrastsecurity.sarif.WebRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-sarif Show documentation
Show all versions of java-sarif Show documentation
POJOs generated from the JSON schema for Static Analysis Results Interchange Format (SARIF)
package com.contrastsecurity.sarif;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/**
* Describes an HTTP request.
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"index",
"protocol",
"version",
"target",
"method",
"headers",
"parameters",
"body",
"properties"
})
public class WebRequest {
/**
* The index within the run.webRequests array of the request object associated with this result.
*
*/
@JsonProperty("index")
@JsonPropertyDescription("The index within the run.webRequests array of the request object associated with this result.")
private Integer index = -1;
/**
* The request protocol. Example: 'http'.
*
*/
@JsonProperty("protocol")
@JsonPropertyDescription("The request protocol. Example: 'http'.")
private String protocol;
/**
* The request version. Example: '1.1'.
*
*/
@JsonProperty("version")
@JsonPropertyDescription("The request version. Example: '1.1'.")
private String version;
/**
* The target of the request.
*
*/
@JsonProperty("target")
@JsonPropertyDescription("The target of the request.")
private String target;
/**
* The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'.
*
*/
@JsonProperty("method")
@JsonPropertyDescription("The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'.")
private String method;
/**
* The request headers.
*
*/
@JsonProperty("headers")
@JsonPropertyDescription("The request headers.")
private Headers headers;
/**
* The request parameters.
*
*/
@JsonProperty("parameters")
@JsonPropertyDescription("The request parameters.")
private Parameters parameters;
/**
* Represents the contents of an artifact.
*
*/
@JsonProperty("body")
@JsonPropertyDescription("Represents the contents of an artifact.")
private ArtifactContent body;
/**
* Key/value pairs that provide additional information about the object.
*
*/
@JsonProperty("properties")
@JsonPropertyDescription("Key/value pairs that provide additional information about the object.")
private PropertyBag properties;
/**
* The index within the run.webRequests array of the request object associated with this result.
*
*/
@JsonProperty("index")
public Integer getIndex() {
return index;
}
/**
* The index within the run.webRequests array of the request object associated with this result.
*
*/
@JsonProperty("index")
public void setIndex(Integer index) {
this.index = index;
}
public WebRequest withIndex(Integer index) {
this.index = index;
return this;
}
/**
* The request protocol. Example: 'http'.
*
*/
@JsonProperty("protocol")
public String getProtocol() {
return protocol;
}
/**
* The request protocol. Example: 'http'.
*
*/
@JsonProperty("protocol")
public void setProtocol(String protocol) {
this.protocol = protocol;
}
public WebRequest withProtocol(String protocol) {
this.protocol = protocol;
return this;
}
/**
* The request version. Example: '1.1'.
*
*/
@JsonProperty("version")
public String getVersion() {
return version;
}
/**
* The request version. Example: '1.1'.
*
*/
@JsonProperty("version")
public void setVersion(String version) {
this.version = version;
}
public WebRequest withVersion(String version) {
this.version = version;
return this;
}
/**
* The target of the request.
*
*/
@JsonProperty("target")
public String getTarget() {
return target;
}
/**
* The target of the request.
*
*/
@JsonProperty("target")
public void setTarget(String target) {
this.target = target;
}
public WebRequest withTarget(String target) {
this.target = target;
return this;
}
/**
* The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'.
*
*/
@JsonProperty("method")
public String getMethod() {
return method;
}
/**
* The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'.
*
*/
@JsonProperty("method")
public void setMethod(String method) {
this.method = method;
}
public WebRequest withMethod(String method) {
this.method = method;
return this;
}
/**
* The request headers.
*
*/
@JsonProperty("headers")
public Headers getHeaders() {
return headers;
}
/**
* The request headers.
*
*/
@JsonProperty("headers")
public void setHeaders(Headers headers) {
this.headers = headers;
}
public WebRequest withHeaders(Headers headers) {
this.headers = headers;
return this;
}
/**
* The request parameters.
*
*/
@JsonProperty("parameters")
public Parameters getParameters() {
return parameters;
}
/**
* The request parameters.
*
*/
@JsonProperty("parameters")
public void setParameters(Parameters parameters) {
this.parameters = parameters;
}
public WebRequest withParameters(Parameters parameters) {
this.parameters = parameters;
return this;
}
/**
* Represents the contents of an artifact.
*
*/
@JsonProperty("body")
public ArtifactContent getBody() {
return body;
}
/**
* Represents the contents of an artifact.
*
*/
@JsonProperty("body")
public void setBody(ArtifactContent body) {
this.body = body;
}
public WebRequest withBody(ArtifactContent body) {
this.body = body;
return this;
}
/**
* Key/value pairs that provide additional information about the object.
*
*/
@JsonProperty("properties")
public PropertyBag getProperties() {
return properties;
}
/**
* Key/value pairs that provide additional information about the object.
*
*/
@JsonProperty("properties")
public void setProperties(PropertyBag properties) {
this.properties = properties;
}
public WebRequest withProperties(PropertyBag properties) {
this.properties = properties;
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(WebRequest.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("index");
sb.append('=');
sb.append(((this.index == null)?"":this.index));
sb.append(',');
sb.append("protocol");
sb.append('=');
sb.append(((this.protocol == null)?"":this.protocol));
sb.append(',');
sb.append("version");
sb.append('=');
sb.append(((this.version == null)?"":this.version));
sb.append(',');
sb.append("target");
sb.append('=');
sb.append(((this.target == null)?"":this.target));
sb.append(',');
sb.append("method");
sb.append('=');
sb.append(((this.method == null)?"":this.method));
sb.append(',');
sb.append("headers");
sb.append('=');
sb.append(((this.headers == null)?"":this.headers));
sb.append(',');
sb.append("parameters");
sb.append('=');
sb.append(((this.parameters == null)?"":this.parameters));
sb.append(',');
sb.append("body");
sb.append('=');
sb.append(((this.body == null)?"":this.body));
sb.append(',');
sb.append("properties");
sb.append('=');
sb.append(((this.properties == null)?"":this.properties));
sb.append(',');
if (sb.charAt((sb.length()- 1)) == ',') {
sb.setCharAt((sb.length()- 1), ']');
} else {
sb.append(']');
}
return sb.toString();
}
@Override
public int hashCode() {
int result = 1;
result = ((result* 31)+((this.headers == null)? 0 :this.headers.hashCode()));
result = ((result* 31)+((this.protocol == null)? 0 :this.protocol.hashCode()));
result = ((result* 31)+((this.method == null)? 0 :this.method.hashCode()));
result = ((result* 31)+((this.index == null)? 0 :this.index.hashCode()));
result = ((result* 31)+((this.body == null)? 0 :this.body.hashCode()));
result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode()));
result = ((result* 31)+((this.parameters == null)? 0 :this.parameters.hashCode()));
result = ((result* 31)+((this.properties == null)? 0 :this.properties.hashCode()));
result = ((result* 31)+((this.target == null)? 0 :this.target.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof WebRequest) == false) {
return false;
}
WebRequest rhs = ((WebRequest) other);
return ((((((((((this.headers == rhs.headers)||((this.headers!= null)&&this.headers.equals(rhs.headers)))&&((this.protocol == rhs.protocol)||((this.protocol!= null)&&this.protocol.equals(rhs.protocol))))&&((this.method == rhs.method)||((this.method!= null)&&this.method.equals(rhs.method))))&&((this.index == rhs.index)||((this.index!= null)&&this.index.equals(rhs.index))))&&((this.body == rhs.body)||((this.body!= null)&&this.body.equals(rhs.body))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.parameters == rhs.parameters)||((this.parameters!= null)&&this.parameters.equals(rhs.parameters))))&&((this.properties == rhs.properties)||((this.properties!= null)&&this.properties.equals(rhs.properties))))&&((this.target == rhs.target)||((this.target!= null)&&this.target.equals(rhs.target))));
}
}