-
-
Save ksiwonia/4994306 to your computer and use it in GitHub Desktop.
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
public boolean clearEanOnCopy(final DataDefinition dataDefinition, final Entity product) { | |
if (product == null) { | |
return true; | |
} | |
product.setField(EAN, null); | |
return true; | |
} | |
public boolean checkIfEanValueIsNumerical(final DataDefinition productDD, final Entity product) { | |
String eanCode = product.getStringField(EAN); | |
if (StringUtils.isNumeric(eanCode) || eanCode == null) { | |
return true; | |
} else { | |
product.addError(productDD.getField(EAN), "basic.product.ean.onlyNumericValue"); | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment