com.clinia.model.common.V1PropertyRule 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.List;
import java.util.Objects;
/** V1PropertyRule */
public class V1PropertyRule {
@JsonProperty("required")
private Boolean required;
@JsonProperty("pattern")
private String pattern;
@JsonProperty("enum")
private List _enum;
@JsonProperty("min")
private Integer min;
@JsonProperty("max")
private Integer max;
public V1PropertyRule setRequired(Boolean required) {
this.required = required;
return this;
}
/** Get required */
@javax.annotation.Nullable
public Boolean getRequired() {
return required;
}
public V1PropertyRule setPattern(String pattern) {
this.pattern = pattern;
return this;
}
/** Get pattern */
@javax.annotation.Nullable
public String getPattern() {
return pattern;
}
public V1PropertyRule setEnum(List _enum) {
this._enum = _enum;
return this;
}
public V1PropertyRule addEnum(V1PropertyRuleEnumInner _enumItem) {
if (this._enum == null) {
this._enum = new ArrayList<>();
}
this._enum.add(_enumItem);
return this;
}
/** List of possible values for the property: string and number types only. */
@javax.annotation.Nullable
public List getEnum() {
return _enum;
}
public V1PropertyRule setMin(Integer min) {
this.min = min;
return this;
}
/** Get min */
@javax.annotation.Nullable
public Integer getMin() {
return min;
}
public V1PropertyRule setMax(Integer max) {
this.max = max;
return this;
}
/** Get max */
@javax.annotation.Nullable
public Integer getMax() {
return max;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
V1PropertyRule v1PropertyRule = (V1PropertyRule) o;
return (
Objects.equals(this.required, v1PropertyRule.required) &&
Objects.equals(this.pattern, v1PropertyRule.pattern) &&
Objects.equals(this._enum, v1PropertyRule._enum) &&
Objects.equals(this.min, v1PropertyRule.min) &&
Objects.equals(this.max, v1PropertyRule.max)
);
}
@Override
public int hashCode() {
return Objects.hash(required, pattern, _enum, min, max);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class V1PropertyRule {\n");
sb.append(" required: ").append(toIndentedString(required)).append("\n");
sb.append(" pattern: ").append(toIndentedString(pattern)).append("\n");
sb.append(" _enum: ").append(toIndentedString(_enum)).append("\n");
sb.append(" min: ").append(toIndentedString(min)).append("\n");
sb.append(" max: ").append(toIndentedString(max)).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 ");
}
}