Skip to content
Snippets Groups Projects
Commit b2c82193 authored by Jonas Blatt's avatar Jonas Blatt :ant:
Browse files

Fix Name: auto cut length of name, if it is greater than the max length

parent e70ef5bc
Branches
Tags
No related merge requests found
......@@ -18,8 +18,16 @@ public class Name extends AbstractStringValueObject {
super(initialValue);
}
@Override
protected String validateAndNormalize(String newValue) {
if (newValue.length() > getMaxLength()) {
newValue = newValue.substring(0, getMaxLength() - 2) + "..";
}
return super.validateAndNormalize(newValue);
}
@Override
protected Integer getMaxLength() {
return 50;
return 60;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment