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

com.nls.validation.LocalDateFormatValidator Maven / Gradle / Ivy

There is a newer version: 1.0.14
Show newest version
package com.nls.validation;

import com.google.common.base.Strings;
import com.nls.util.LocalDates;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

class LocalDateFormatValidator implements ConstraintValidator {

    public void initialize(LocalDateFormat parameters) {
    }

    public boolean isValid(String object, ConstraintValidatorContext context) {

        if (Strings.isNullOrEmpty(object)) {
            return true;
        }

        return LocalDates.tryParse(object) != null;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy