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

com.github.fashionbrot.internal.NotBlankConstraint Maven / Gradle / Ivy

The newest version!
package com.github.fashionbrot.internal;


import com.github.fashionbrot.annotation.NotBlank;
import com.github.fashionbrot.common.util.ObjectUtil;
import com.github.fashionbrot.constraint.ConstraintValidator;
import com.github.fashionbrot.util.ClassUtil;


public class NotBlankConstraint implements ConstraintValidator {

    @Override
    public boolean isValid(NotBlank notBlank, Object value, Class valueType) {
        if (ClassUtil.isString(valueType)) {
            String str = (String) value;
            return ObjectUtil.isNotBlank(str);
        }
        return true;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy