com.arconsis.android.datarobot.validation.NotNullValidator 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;
/**
* Implementation of the @NotNull validation annotation.
*
* @author Falk Appel
* @author Alexander Frank
*/
public class NotNullValidator implements CustomValidator {
public static final int ERROR_CODE = 0;
@Override
public ValidationResult onValidate(NotNull annotation, Object toByValidated) {
if (toByValidated == null) {
return ValidationResult.invalid(ERROR_CODE, "The field is not allowed to be null");
}
return ValidationResult.valid();
}
}