com.clinia.model.common.V1ObjectPropertyDefinition Maven / Gradle / Ivy
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost
// - read more on https://github.com/clinia/api-clients-generation. DO NOT EDIT.
package com.clinia.model.common;
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.annotation.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/** V1ObjectPropertyDefinition */
@JsonDeserialize(as = V1ObjectPropertyDefinition.class)
public class V1ObjectPropertyDefinition implements V1PropertyDefinition {
@JsonProperty("type")
private V1DataType type = V1DataType.OBJECT;
@JsonProperty("rules")
private List rules;
@JsonProperty("properties")
private Map properties = new HashMap<>();
public V1ObjectPropertyDefinition setType(V1DataType type) {
this.type = type;
return this;
}
/** Get type */
@javax.annotation.Nonnull
public V1DataType getType() {
return type;
}
public V1ObjectPropertyDefinition setRules(List rules) {
this.rules = rules;
return this;
}
public V1ObjectPropertyDefinition addRules(V1PropertyRule rulesItem) {
if (this.rules == null) {
this.rules = new ArrayList<>();
}
this.rules.add(rulesItem);
return this;
}
/** Get rules */
@javax.annotation.Nullable
public List getRules() {
return rules;
}
public V1ObjectPropertyDefinition setProperties(Map properties) {
this.properties = properties;
return this;
}
public V1ObjectPropertyDefinition putProperties(String key, V1PropertyDefinition propertiesItem) {
this.properties.put(key, propertiesItem);
return this;
}
/** Get properties */
@javax.annotation.Nonnull
public Map getProperties() {
return properties;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
V1ObjectPropertyDefinition v1ObjectPropertyDefinition = (V1ObjectPropertyDefinition) o;
return (
Objects.equals(this.type, v1ObjectPropertyDefinition.type) &&
Objects.equals(this.rules, v1ObjectPropertyDefinition.rules) &&
Objects.equals(this.properties, v1ObjectPropertyDefinition.properties)
);
}
@Override
public int hashCode() {
return Objects.hash(type, rules, properties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class V1ObjectPropertyDefinition {\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" rules: ").append(toIndentedString(rules)).append("\n");
sb.append(" properties: ").append(toIndentedString(properties)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}