io.github.algomaster99.terminator.commons.cyclonedx.Patch Maven / Gradle / Ivy
package io.github.algomaster99.terminator.commons.cyclonedx;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonCreator;
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.annotation.JsonValue;
/**
* Patch
*
* Specifies an individual patch
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"type",
"diff",
"resolves"
})
@Generated("jsonschema2pojo")
public class Patch {
/**
* Type
*
* Specifies the purpose for the patch including the resolution of defects, security issues, or new behavior or functionality.
*
* * __unofficial__ = A patch which is not developed by the creators or maintainers of the software being patched. Refer to [https://en.wikipedia.org/wiki/Unofficial_patch](https://en.wikipedia.org/wiki/Unofficial_patch)
* * __monkey__ = A patch which dynamically modifies runtime behavior. Refer to [https://en.wikipedia.org/wiki/Monkey_patch](https://en.wikipedia.org/wiki/Monkey_patch)
* * __backport__ = A patch which takes code from a newer version of software and applies it to older versions of the same software. Refer to [https://en.wikipedia.org/wiki/Backporting](https://en.wikipedia.org/wiki/Backporting)
* * __cherry-pick__ = A patch created by selectively applying commits from other versions or branches of the same software.
* (Required)
*
*/
@JsonProperty("type")
@JsonPropertyDescription("Specifies the purpose for the patch including the resolution of defects, security issues, or new behavior or functionality.\n\n* __unofficial__ = A patch which is not developed by the creators or maintainers of the software being patched. Refer to [https://en.wikipedia.org/wiki/Unofficial_patch](https://en.wikipedia.org/wiki/Unofficial_patch)\n* __monkey__ = A patch which dynamically modifies runtime behavior. Refer to [https://en.wikipedia.org/wiki/Monkey_patch](https://en.wikipedia.org/wiki/Monkey_patch)\n* __backport__ = A patch which takes code from a newer version of software and applies it to older versions of the same software. Refer to [https://en.wikipedia.org/wiki/Backporting](https://en.wikipedia.org/wiki/Backporting)\n* __cherry-pick__ = A patch created by selectively applying commits from other versions or branches of the same software.")
private Patch.Type type;
/**
* Diff
*
* The patch file (or diff) that show changes. Refer to https://en.wikipedia.org/wiki/Diff
*
*/
@JsonProperty("diff")
@JsonPropertyDescription("The patch file (or diff) that show changes. Refer to https://en.wikipedia.org/wiki/Diff")
private Diff diff;
/**
* Resolves
*
* A collection of issues the patch resolves
*
*/
@JsonProperty("resolves")
@JsonPropertyDescription("A collection of issues the patch resolves")
private List resolves = new ArrayList();
/**
* Type
*
* Specifies the purpose for the patch including the resolution of defects, security issues, or new behavior or functionality.
*
* * __unofficial__ = A patch which is not developed by the creators or maintainers of the software being patched. Refer to [https://en.wikipedia.org/wiki/Unofficial_patch](https://en.wikipedia.org/wiki/Unofficial_patch)
* * __monkey__ = A patch which dynamically modifies runtime behavior. Refer to [https://en.wikipedia.org/wiki/Monkey_patch](https://en.wikipedia.org/wiki/Monkey_patch)
* * __backport__ = A patch which takes code from a newer version of software and applies it to older versions of the same software. Refer to [https://en.wikipedia.org/wiki/Backporting](https://en.wikipedia.org/wiki/Backporting)
* * __cherry-pick__ = A patch created by selectively applying commits from other versions or branches of the same software.
* (Required)
*
*/
@JsonProperty("type")
public Patch.Type getType() {
return type;
}
/**
* Type
*
* Specifies the purpose for the patch including the resolution of defects, security issues, or new behavior or functionality.
*
* * __unofficial__ = A patch which is not developed by the creators or maintainers of the software being patched. Refer to [https://en.wikipedia.org/wiki/Unofficial_patch](https://en.wikipedia.org/wiki/Unofficial_patch)
* * __monkey__ = A patch which dynamically modifies runtime behavior. Refer to [https://en.wikipedia.org/wiki/Monkey_patch](https://en.wikipedia.org/wiki/Monkey_patch)
* * __backport__ = A patch which takes code from a newer version of software and applies it to older versions of the same software. Refer to [https://en.wikipedia.org/wiki/Backporting](https://en.wikipedia.org/wiki/Backporting)
* * __cherry-pick__ = A patch created by selectively applying commits from other versions or branches of the same software.
* (Required)
*
*/
@JsonProperty("type")
public void setType(Patch.Type type) {
this.type = type;
}
/**
* Diff
*
* The patch file (or diff) that show changes. Refer to https://en.wikipedia.org/wiki/Diff
*
*/
@JsonProperty("diff")
public Diff getDiff() {
return diff;
}
/**
* Diff
*
* The patch file (or diff) that show changes. Refer to https://en.wikipedia.org/wiki/Diff
*
*/
@JsonProperty("diff")
public void setDiff(Diff diff) {
this.diff = diff;
}
/**
* Resolves
*
* A collection of issues the patch resolves
*
*/
@JsonProperty("resolves")
public List getResolves() {
return resolves;
}
/**
* Resolves
*
* A collection of issues the patch resolves
*
*/
@JsonProperty("resolves")
public void setResolves(List resolves) {
this.resolves = resolves;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(Patch.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("type");
sb.append('=');
sb.append(((this.type == null)?"":this.type));
sb.append(',');
sb.append("diff");
sb.append('=');
sb.append(((this.diff == null)?"":this.diff));
sb.append(',');
sb.append("resolves");
sb.append('=');
sb.append(((this.resolves == null)?"":this.resolves));
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.resolves == null)? 0 :this.resolves.hashCode()));
result = ((result* 31)+((this.diff == null)? 0 :this.diff.hashCode()));
result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof Patch) == false) {
return false;
}
Patch rhs = ((Patch) other);
return ((((this.resolves == rhs.resolves)||((this.resolves!= null)&&this.resolves.equals(rhs.resolves)))&&((this.diff == rhs.diff)||((this.diff!= null)&&this.diff.equals(rhs.diff))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))));
}
/**
* Type
*
* Specifies the purpose for the patch including the resolution of defects, security issues, or new behavior or functionality.
*
* * __unofficial__ = A patch which is not developed by the creators or maintainers of the software being patched. Refer to [https://en.wikipedia.org/wiki/Unofficial_patch](https://en.wikipedia.org/wiki/Unofficial_patch)
* * __monkey__ = A patch which dynamically modifies runtime behavior. Refer to [https://en.wikipedia.org/wiki/Monkey_patch](https://en.wikipedia.org/wiki/Monkey_patch)
* * __backport__ = A patch which takes code from a newer version of software and applies it to older versions of the same software. Refer to [https://en.wikipedia.org/wiki/Backporting](https://en.wikipedia.org/wiki/Backporting)
* * __cherry-pick__ = A patch created by selectively applying commits from other versions or branches of the same software.
*
*/
@Generated("jsonschema2pojo")
public enum Type {
UNOFFICIAL("unofficial"),
MONKEY("monkey"),
BACKPORT("backport"),
CHERRY_PICK("cherry-pick");
private final String value;
private final static Map CONSTANTS = new HashMap();
static {
for (Patch.Type c: values()) {
CONSTANTS.put(c.value, c);
}
}
Type(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
@JsonValue
public String value() {
return this.value;
}
@JsonCreator
public static Patch.Type fromValue(String value) {
Patch.Type constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
}