184 lines
5.1 KiB
Java
184 lines
5.1 KiB
Java
package com.muse.dto;
|
|
|
|
import java.net.URI;
|
|
import java.util.Objects;
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
|
import com.muse.dto.CompatibilityResult;
|
|
import com.muse.dto.ValidationError;
|
|
import com.muse.dto.ValidationWarning;
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
import org.springframework.lang.Nullable;
|
|
import java.io.Serializable;
|
|
import java.time.OffsetDateTime;
|
|
import jakarta.validation.Valid;
|
|
import jakarta.validation.constraints.*;
|
|
import io.swagger.v3.oas.annotations.media.Schema;
|
|
|
|
|
|
import java.util.*;
|
|
import jakarta.annotation.Generated;
|
|
|
|
/**
|
|
* ValidationResult
|
|
*/
|
|
|
|
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2026-05-24T16:47:40.290595+08:00[Asia/Shanghai]", comments = "Generator version: 7.22.0")
|
|
public class ValidationResult implements Serializable {
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
private @Nullable Boolean valid;
|
|
|
|
@Valid
|
|
private List<@Valid ValidationError> errors = new ArrayList<>();
|
|
|
|
@Valid
|
|
private List<@Valid ValidationWarning> warnings = new ArrayList<>();
|
|
|
|
private @Nullable CompatibilityResult compatibilityResult;
|
|
|
|
public ValidationResult valid(@Nullable Boolean valid) {
|
|
this.valid = valid;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 是否校验通过
|
|
* @return valid
|
|
*/
|
|
|
|
@Schema(name = "valid", description = "是否校验通过", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("valid")
|
|
public @Nullable Boolean getValid() {
|
|
return valid;
|
|
}
|
|
|
|
@JsonProperty("valid")
|
|
public void setValid(@Nullable Boolean valid) {
|
|
this.valid = valid;
|
|
}
|
|
|
|
public ValidationResult errors(List<@Valid ValidationError> errors) {
|
|
this.errors = errors;
|
|
return this;
|
|
}
|
|
|
|
public ValidationResult addErrorsItem(ValidationError errorsItem) {
|
|
if (this.errors == null) {
|
|
this.errors = new ArrayList<>();
|
|
}
|
|
this.errors.add(errorsItem);
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 校验错误列表
|
|
* @return errors
|
|
*/
|
|
@Valid
|
|
@Schema(name = "errors", description = "校验错误列表", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("errors")
|
|
public List<@Valid ValidationError> getErrors() {
|
|
return errors;
|
|
}
|
|
|
|
@JsonProperty("errors")
|
|
public void setErrors(List<@Valid ValidationError> errors) {
|
|
this.errors = errors;
|
|
}
|
|
|
|
public ValidationResult warnings(List<@Valid ValidationWarning> warnings) {
|
|
this.warnings = warnings;
|
|
return this;
|
|
}
|
|
|
|
public ValidationResult addWarningsItem(ValidationWarning warningsItem) {
|
|
if (this.warnings == null) {
|
|
this.warnings = new ArrayList<>();
|
|
}
|
|
this.warnings.add(warningsItem);
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 校验警告列表
|
|
* @return warnings
|
|
*/
|
|
@Valid
|
|
@Schema(name = "warnings", description = "校验警告列表", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("warnings")
|
|
public List<@Valid ValidationWarning> getWarnings() {
|
|
return warnings;
|
|
}
|
|
|
|
@JsonProperty("warnings")
|
|
public void setWarnings(List<@Valid ValidationWarning> warnings) {
|
|
this.warnings = warnings;
|
|
}
|
|
|
|
public ValidationResult compatibilityResult(@Nullable CompatibilityResult compatibilityResult) {
|
|
this.compatibilityResult = compatibilityResult;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get compatibilityResult
|
|
* @return compatibilityResult
|
|
*/
|
|
@Valid
|
|
@Schema(name = "compatibilityResult", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("compatibilityResult")
|
|
public @Nullable CompatibilityResult getCompatibilityResult() {
|
|
return compatibilityResult;
|
|
}
|
|
|
|
@JsonProperty("compatibilityResult")
|
|
public void setCompatibilityResult(@Nullable CompatibilityResult compatibilityResult) {
|
|
this.compatibilityResult = compatibilityResult;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object o) {
|
|
if (this == o) {
|
|
return true;
|
|
}
|
|
if (o == null || getClass() != o.getClass()) {
|
|
return false;
|
|
}
|
|
ValidationResult validationResult = (ValidationResult) o;
|
|
return Objects.equals(this.valid, validationResult.valid) &&
|
|
Objects.equals(this.errors, validationResult.errors) &&
|
|
Objects.equals(this.warnings, validationResult.warnings) &&
|
|
Objects.equals(this.compatibilityResult, validationResult.compatibilityResult);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(valid, errors, warnings, compatibilityResult);
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append("class ValidationResult {\n");
|
|
sb.append(" valid: ").append(toIndentedString(valid)).append("\n");
|
|
sb.append(" errors: ").append(toIndentedString(errors)).append("\n");
|
|
sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n");
|
|
sb.append(" compatibilityResult: ").append(toIndentedString(compatibilityResult)).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(@Nullable Object o) {
|
|
return o == null ? "null" : o.toString().replace("\n", "\n ");
|
|
}
|
|
}
|
|
|