All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.algomaster99.terminator.commons.cyclonedx.Compositions Maven / Gradle / Ivy


package io.github.algomaster99.terminator.commons.cyclonedx;

import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
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;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;


/**
 * Compositions
 * 

* * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "bom-ref", "aggregate", "assemblies", "dependencies", "vulnerabilities", "signature" }) @Generated("jsonschema2pojo") public class Compositions { /** * Identifier for referable and therefore interlink-able elements.value SHOULD not start with the BOM-Link intro 'urn:cdx:' * */ @JsonProperty("bom-ref") @JsonPropertyDescription("Identifier for referable and therefore interlink-able elements.") private String bomRef; /** * * (Required) * */ @JsonProperty("aggregate") private Compositions.AggregateType aggregate = Compositions.AggregateType.fromValue("not_specified"); /** * BOM references *

* The bom-ref identifiers of the components or services being described. Assemblies refer to nested relationships whereby a constituent part may include other constituent parts. References do not cascade to child parts. References are explicit for the specified constituent part only. * */ @JsonProperty("assemblies") @JsonDeserialize(as = java.util.LinkedHashSet.class) @JsonPropertyDescription("The bom-ref identifiers of the components or services being described. Assemblies refer to nested relationships whereby a constituent part may include other constituent parts. References do not cascade to child parts. References are explicit for the specified constituent part only.") private Set assemblies = new LinkedHashSet(); /** * BOM references *

* The bom-ref identifiers of the components or services being described. Dependencies refer to a relationship whereby an independent constituent part requires another independent constituent part. References do not cascade to transitive dependencies. References are explicit for the specified dependency only. * */ @JsonProperty("dependencies") @JsonDeserialize(as = java.util.LinkedHashSet.class) @JsonPropertyDescription("The bom-ref identifiers of the components or services being described. Dependencies refer to a relationship whereby an independent constituent part requires another independent constituent part. References do not cascade to transitive dependencies. References are explicit for the specified dependency only.") private Set dependencies = new LinkedHashSet(); /** * BOM references *

* The bom-ref identifiers of the vulnerabilities being described. * */ @JsonProperty("vulnerabilities") @JsonDeserialize(as = java.util.LinkedHashSet.class) @JsonPropertyDescription("The bom-ref identifiers of the vulnerabilities being described.") private Set vulnerabilities = new LinkedHashSet(); /** * Signature *

* * */ @JsonProperty("signature") private Signature signature; /** * Identifier for referable and therefore interlink-able elements.value SHOULD not start with the BOM-Link intro 'urn:cdx:' * */ @JsonProperty("bom-ref") public String getBomRef() { return bomRef; } /** * Identifier for referable and therefore interlink-able elements.value SHOULD not start with the BOM-Link intro 'urn:cdx:' * */ @JsonProperty("bom-ref") public void setBomRef(String bomRef) { this.bomRef = bomRef; } /** * * (Required) * */ @JsonProperty("aggregate") public Compositions.AggregateType getAggregate() { return aggregate; } /** * * (Required) * */ @JsonProperty("aggregate") public void setAggregate(Compositions.AggregateType aggregate) { this.aggregate = aggregate; } /** * BOM references *

* The bom-ref identifiers of the components or services being described. Assemblies refer to nested relationships whereby a constituent part may include other constituent parts. References do not cascade to child parts. References are explicit for the specified constituent part only. * */ @JsonProperty("assemblies") public Set getAssemblies() { return assemblies; } /** * BOM references *

* The bom-ref identifiers of the components or services being described. Assemblies refer to nested relationships whereby a constituent part may include other constituent parts. References do not cascade to child parts. References are explicit for the specified constituent part only. * */ @JsonProperty("assemblies") public void setAssemblies(Set assemblies) { this.assemblies = assemblies; } /** * BOM references *

* The bom-ref identifiers of the components or services being described. Dependencies refer to a relationship whereby an independent constituent part requires another independent constituent part. References do not cascade to transitive dependencies. References are explicit for the specified dependency only. * */ @JsonProperty("dependencies") public Set getDependencies() { return dependencies; } /** * BOM references *

* The bom-ref identifiers of the components or services being described. Dependencies refer to a relationship whereby an independent constituent part requires another independent constituent part. References do not cascade to transitive dependencies. References are explicit for the specified dependency only. * */ @JsonProperty("dependencies") public void setDependencies(Set dependencies) { this.dependencies = dependencies; } /** * BOM references *

* The bom-ref identifiers of the vulnerabilities being described. * */ @JsonProperty("vulnerabilities") public Set getVulnerabilities() { return vulnerabilities; } /** * BOM references *

* The bom-ref identifiers of the vulnerabilities being described. * */ @JsonProperty("vulnerabilities") public void setVulnerabilities(Set vulnerabilities) { this.vulnerabilities = vulnerabilities; } /** * Signature *

* * */ @JsonProperty("signature") public Signature getSignature() { return signature; } /** * Signature *

* * */ @JsonProperty("signature") public void setSignature(Signature signature) { this.signature = signature; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(Compositions.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); sb.append("bomRef"); sb.append('='); sb.append(((this.bomRef == null)?"":this.bomRef)); sb.append(','); sb.append("aggregate"); sb.append('='); sb.append(((this.aggregate == null)?"":this.aggregate)); sb.append(','); sb.append("assemblies"); sb.append('='); sb.append(((this.assemblies == null)?"":this.assemblies)); sb.append(','); sb.append("dependencies"); sb.append('='); sb.append(((this.dependencies == null)?"":this.dependencies)); sb.append(','); sb.append("vulnerabilities"); sb.append('='); sb.append(((this.vulnerabilities == null)?"":this.vulnerabilities)); sb.append(','); sb.append("signature"); sb.append('='); sb.append(((this.signature == null)?"":this.signature)); 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.assemblies == null)? 0 :this.assemblies.hashCode())); result = ((result* 31)+((this.signature == null)? 0 :this.signature.hashCode())); result = ((result* 31)+((this.vulnerabilities == null)? 0 :this.vulnerabilities.hashCode())); result = ((result* 31)+((this.bomRef == null)? 0 :this.bomRef.hashCode())); result = ((result* 31)+((this.aggregate == null)? 0 :this.aggregate.hashCode())); result = ((result* 31)+((this.dependencies == null)? 0 :this.dependencies.hashCode())); return result; } @Override public boolean equals(Object other) { if (other == this) { return true; } if ((other instanceof Compositions) == false) { return false; } Compositions rhs = ((Compositions) other); return (((((((this.assemblies == rhs.assemblies)||((this.assemblies!= null)&&this.assemblies.equals(rhs.assemblies)))&&((this.signature == rhs.signature)||((this.signature!= null)&&this.signature.equals(rhs.signature))))&&((this.vulnerabilities == rhs.vulnerabilities)||((this.vulnerabilities!= null)&&this.vulnerabilities.equals(rhs.vulnerabilities))))&&((this.bomRef == rhs.bomRef)||((this.bomRef!= null)&&this.bomRef.equals(rhs.bomRef))))&&((this.aggregate == rhs.aggregate)||((this.aggregate!= null)&&this.aggregate.equals(rhs.aggregate))))&&((this.dependencies == rhs.dependencies)||((this.dependencies!= null)&&this.dependencies.equals(rhs.dependencies)))); } @Generated("jsonschema2pojo") public enum AggregateType { COMPLETE("complete"), INCOMPLETE("incomplete"), INCOMPLETE_FIRST_PARTY_ONLY("incomplete_first_party_only"), INCOMPLETE_FIRST_PARTY_PROPRIETARY_ONLY("incomplete_first_party_proprietary_only"), INCOMPLETE_FIRST_PARTY_OPENSOURCE_ONLY("incomplete_first_party_opensource_only"), INCOMPLETE_THIRD_PARTY_ONLY("incomplete_third_party_only"), INCOMPLETE_THIRD_PARTY_PROPRIETARY_ONLY("incomplete_third_party_proprietary_only"), INCOMPLETE_THIRD_PARTY_OPENSOURCE_ONLY("incomplete_third_party_opensource_only"), UNKNOWN("unknown"), NOT_SPECIFIED("not_specified"); private final String value; private final static Map CONSTANTS = new HashMap(); static { for (Compositions.AggregateType c: values()) { CONSTANTS.put(c.value, c); } } AggregateType(String value) { this.value = value; } @Override public String toString() { return this.value; } @JsonValue public String value() { return this.value; } @JsonCreator public static Compositions.AggregateType fromValue(String value) { Compositions.AggregateType constant = CONSTANTS.get(value); if (constant == null) { throw new IllegalArgumentException(value); } else { return constant; } } } }