com.contrastsecurity.sarif.Fix 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 java.util.LinkedHashSet;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
/**
* A proposed fix for the problem represented by a result object. A fix specifies a set of artifacts to modify. For each artifact, it specifies a set of bytes to remove, and provides a set of new bytes to replace them.
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"description",
"artifactChanges",
"properties"
})
public class Fix {
/**
* Encapsulates a message intended to be read by the end user.
*
*/
@JsonProperty("description")
@JsonPropertyDescription("Encapsulates a message intended to be read by the end user.")
private Message description;
/**
* One or more artifact changes that comprise a fix for a result.
* (Required)
*
*/
@JsonProperty("artifactChanges")
@JsonDeserialize(as = java.util.LinkedHashSet.class)
@JsonPropertyDescription("One or more artifact changes that comprise a fix for a result.")
private Set artifactChanges = new LinkedHashSet();
/**
* 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;
/**
* Encapsulates a message intended to be read by the end user.
*
*/
@JsonProperty("description")
public Message getDescription() {
return description;
}
/**
* Encapsulates a message intended to be read by the end user.
*
*/
@JsonProperty("description")
public void setDescription(Message description) {
this.description = description;
}
public Fix withDescription(Message description) {
this.description = description;
return this;
}
/**
* One or more artifact changes that comprise a fix for a result.
* (Required)
*
*/
@JsonProperty("artifactChanges")
public Set getArtifactChanges() {
return artifactChanges;
}
/**
* One or more artifact changes that comprise a fix for a result.
* (Required)
*
*/
@JsonProperty("artifactChanges")
public void setArtifactChanges(Set artifactChanges) {
this.artifactChanges = artifactChanges;
}
public Fix withArtifactChanges(Set artifactChanges) {
this.artifactChanges = artifactChanges;
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 Fix withProperties(PropertyBag properties) {
this.properties = properties;
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(Fix.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("description");
sb.append('=');
sb.append(((this.description == null)?"":this.description));
sb.append(',');
sb.append("artifactChanges");
sb.append('=');
sb.append(((this.artifactChanges == null)?"":this.artifactChanges));
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.artifactChanges == null)? 0 :this.artifactChanges.hashCode()));
result = ((result* 31)+((this.description == null)? 0 :this.description.hashCode()));
result = ((result* 31)+((this.properties == null)? 0 :this.properties.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof Fix) == false) {
return false;
}
Fix rhs = ((Fix) other);
return ((((this.artifactChanges == rhs.artifactChanges)||((this.artifactChanges!= null)&&this.artifactChanges.equals(rhs.artifactChanges)))&&((this.description == rhs.description)||((this.description!= null)&&this.description.equals(rhs.description))))&&((this.properties == rhs.properties)||((this.properties!= null)&&this.properties.equals(rhs.properties))));
}
}