All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.arconsis.android.datarobot.validation.NotNullValidator Maven / Gradle / Ivy

Go to download

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();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy