org.openmetadata.schema.entity.app.AppExtension Maven / Gradle / Ivy
package org.openmetadata.schema.entity.app;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.UUID;
import javax.annotation.processing.Generated;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
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;
import com.fasterxml.jackson.annotation.JsonValue;
/**
* AppExtension
*
* App Extension Object.
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"appId",
"appName",
"timestamp",
"extension"
})
@Generated("jsonschema2pojo")
public class AppExtension {
/**
* Unique id used to identify an entity.
* (Required)
*
*/
@JsonProperty("appId")
@JsonPropertyDescription("Unique id used to identify an entity.")
@NotNull
private UUID appId;
/**
* Name that identifies an entity.
* (Required)
*
*/
@JsonProperty("appName")
@JsonPropertyDescription("Name that identifies an entity.")
@Pattern(regexp = "^((?!::).)*$")
@Size(min = 1, max = 256)
@NotNull
private String appName;
/**
* Timestamp in Unix epoch time milliseconds.@om-field-type
*
*/
@JsonProperty("timestamp")
@JsonPropertyDescription("Timestamp in Unix epoch time milliseconds.")
private Long timestamp;
/**
* Extension type.
* (Required)
*
*/
@JsonProperty("extension")
@JsonPropertyDescription("Extension type.")
@NotNull
private AppExtension.ExtensionType extension;
@JsonIgnore
@Valid
private Map additionalProperties = new LinkedHashMap();
/**
* Unique id used to identify an entity.
* (Required)
*
*/
@JsonProperty("appId")
public UUID getAppId() {
return appId;
}
/**
* Unique id used to identify an entity.
* (Required)
*
*/
@JsonProperty("appId")
public void setAppId(UUID appId) {
this.appId = appId;
}
public AppExtension withAppId(UUID appId) {
this.appId = appId;
return this;
}
/**
* Name that identifies an entity.
* (Required)
*
*/
@JsonProperty("appName")
public String getAppName() {
return appName;
}
/**
* Name that identifies an entity.
* (Required)
*
*/
@JsonProperty("appName")
public void setAppName(String appName) {
this.appName = appName;
}
public AppExtension withAppName(String appName) {
this.appName = appName;
return this;
}
/**
* Timestamp in Unix epoch time milliseconds.@om-field-type
*
*/
@JsonProperty("timestamp")
public Long getTimestamp() {
return timestamp;
}
/**
* Timestamp in Unix epoch time milliseconds.@om-field-type
*
*/
@JsonProperty("timestamp")
public void setTimestamp(Long timestamp) {
this.timestamp = timestamp;
}
public AppExtension withTimestamp(Long timestamp) {
this.timestamp = timestamp;
return this;
}
/**
* Extension type.
* (Required)
*
*/
@JsonProperty("extension")
public AppExtension.ExtensionType getExtension() {
return extension;
}
/**
* Extension type.
* (Required)
*
*/
@JsonProperty("extension")
public void setExtension(AppExtension.ExtensionType extension) {
this.extension = extension;
}
public AppExtension withExtension(AppExtension.ExtensionType extension) {
this.extension = extension;
return this;
}
@JsonAnyGetter
public Map getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public AppExtension withAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(AppExtension.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("appId");
sb.append('=');
sb.append(((this.appId == null)?"":this.appId));
sb.append(',');
sb.append("appName");
sb.append('=');
sb.append(((this.appName == null)?"":this.appName));
sb.append(',');
sb.append("timestamp");
sb.append('=');
sb.append(((this.timestamp == null)?"":this.timestamp));
sb.append(',');
sb.append("extension");
sb.append('=');
sb.append(((this.extension == null)?"":this.extension));
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.extension == null)? 0 :this.extension.hashCode()));
result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode()));
result = ((result* 31)+((this.appName == null)? 0 :this.appName.hashCode()));
result = ((result* 31)+((this.appId == null)? 0 :this.appId.hashCode()));
result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof AppExtension) == false) {
return false;
}
AppExtension rhs = ((AppExtension) other);
return ((((((this.extension == rhs.extension)||((this.extension!= null)&&this.extension.equals(rhs.extension)))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.appName == rhs.appName)||((this.appName!= null)&&this.appName.equals(rhs.appName))))&&((this.appId == rhs.appId)||((this.appId!= null)&&this.appId.equals(rhs.appId))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp))));
}
/**
* Extension type.
*
*/
@Generated("jsonschema2pojo")
public enum ExtensionType {
STATUS("status"),
LIMITS("limits"),
CUSTOM("custom");
private final String value;
private final static Map CONSTANTS = new HashMap();
static {
for (AppExtension.ExtensionType c: values()) {
CONSTANTS.put(c.value, c);
}
}
ExtensionType(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
@JsonValue
public String value() {
return this.value;
}
@JsonCreator
public static AppExtension.ExtensionType fromValue(String value) {
AppExtension.ExtensionType constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
}