
com.arconsis.android.datarobot.validation.InvalidEntityException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of datarobot.api Show documentation
Show all versions of datarobot.api Show documentation
Datarobot for Android is a lightweight framework, which frees you from the burden of dealing with Androids SQLite database directly if you don't want to and let's you access it directly if you have to.
The newest version!
package com.arconsis.android.datarobot.validation;
import java.util.List;
/**
* This exception is thrown when you try to save invalid entity
*
* @author Falk Appel
* @author Alexander Frank
*/
public class InvalidEntityException extends RuntimeException {
private List errors;
public InvalidEntityException(AccumulatedValidationResult errors) {
super(flatten(errors));
this.errors = errors.getErrors();
}
private static String flatten(AccumulatedValidationResult errors) {
if (errors == null) {
return "";
}
StringBuilder builder = new StringBuilder();
List validationResults = errors.getErrors();
for (int i = 0; i < validationResults.size(); i++) {
builder.append(validationResults.get(i));
if (i < validationResults.size() - 1) {
builder.append(" | ");
}
}
return builder.toString();
}
public List getErrors() {
return errors;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy