com.revinate.sendgrid.model.ApiErrorsResponse Maven / Gradle / Ivy
The newest version!
package com.revinate.sendgrid.model;
import java.util.List;
public class ApiErrorsResponse extends SendGridModel {
private List errors;
public List getErrors() {
return errors;
}
public void setErrors(List errors) {
this.errors = errors;
}
@Override
public String toString() {
if (errors == null || errors.isEmpty()) {
return "No errors";
} else if (errors.size() == 1) {
return errors.get(0).toString();
} else {
StringBuilder sb = new StringBuilder();
sb.append("Multiple errors:\n");
for (ApiError error : errors) {
sb.append("\t").append(error.toString()).append("\n");
}
return sb.toString();
}
}
}