io.github.algomaster99.terminator.commons.cyclonedx.Property Maven / Gradle / Ivy
package io.github.algomaster99.terminator.commons.cyclonedx;
import java.util.LinkedHashMap;
import java.util.Map;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/**
* Lightweight name-value pair
*
* Provides the ability to document properties in a name-value store. This provides flexibility to include data not officially supported in the standard without having to use additional namespaces or create extensions. Unlike key-value stores, properties support duplicate names, each potentially having different values. Property names of interest to the general public are encouraged to be registered in the [CycloneDX Property Taxonomy](https://github.com/CycloneDX/cyclonedx-property-taxonomy). Formal registration is OPTIONAL.
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"name",
"value"
})
@Generated("jsonschema2pojo")
public class Property {
/**
* Name
*
* The name of the property. Duplicate names are allowed, each potentially having a different value.
*
*/
@JsonProperty("name")
@JsonPropertyDescription("The name of the property. Duplicate names are allowed, each potentially having a different value.")
private String name;
/**
* Value
*
* The value of the property.
*
*/
@JsonProperty("value")
@JsonPropertyDescription("The value of the property.")
private String value;
@JsonIgnore
private Map additionalProperties = new LinkedHashMap();
/**
* Name
*
* The name of the property. Duplicate names are allowed, each potentially having a different value.
*
*/
@JsonProperty("name")
public String getName() {
return name;
}
/**
* Name
*
* The name of the property. Duplicate names are allowed, each potentially having a different value.
*
*/
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
/**
* Value
*
* The value of the property.
*
*/
@JsonProperty("value")
public String getValue() {
return value;
}
/**
* Value
*
* The value of the property.
*
*/
@JsonProperty("value")
public void setValue(String value) {
this.value = value;
}
@JsonAnyGetter
public Map getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(Property.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("name");
sb.append('=');
sb.append(((this.name == null)?"":this.name));
sb.append(',');
sb.append("value");
sb.append('=');
sb.append(((this.value == null)?"":this.value));
sb.append(',');
sb.append("additionalProperties");
sb.append('=');
sb.append(((this.additionalProperties == null)?"":this.additionalProperties));
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.name == null)? 0 :this.name.hashCode()));
result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode()));
result = ((result* 31)+((this.value == null)? 0 :this.value.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof Property) == false) {
return false;
}
Property rhs = ((Property) other);
return ((((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name)))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.value == rhs.value)||((this.value!= null)&&this.value.equals(rhs.value))));
}
}