Created
May 22, 2016 16:59
-
-
Save ansidev/0ca7ee995b83f9b477b6bded21c04f0b to your computer and use it in GitHub Desktop.
Vaadin Empty Validator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package xyz.ansidev.vaadin.validator; | |
import com.vaadin.data.validator.AbstractStringValidator; | |
@SuppressWarnings("serial") | |
public class EmptyValidator extends AbstractStringValidator { | |
public EmptyValidator(String errorMessage) { | |
super(errorMessage); | |
} | |
@Override | |
protected boolean isValidValue(String value) { | |
if (value == null || value.isEmpty()) { | |
return false; | |
} | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment