New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lombok build getters/setters not by standard Java Beans specification #1661
Comments
There are conflicting implementations, even in java.beans.
public static String capitalize(String name) {
if (name == null || name.length() == 0) {
return name;
}
return name.substring(0, 1).toUpperCase(ENGLISH) + name.substring(1);
}
public static String decapitalize(String name) {
if (name == null || name.length() == 0) {
return name;
}
if (name.length() > 1 && Character.isUpperCase(name.charAt(1)) &&
Character.isUpperCase(name.charAt(0))){
return name;
}
char chars[] = name.toCharArray();
chars[0] = Character.toLowerCase(chars[0]);
return new String(chars);
} If we would have started lombok right now we might have made a different choice. |
@rspilker |
Closed
Duplicate of #2693 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
question
lombok version: lastest
lombok build getters/setters not by standard Java Beans specification
code
standard java beans getter/setter
lombok getter/setter (decoder result)
resolve
you can use Introspector.decapitalize(name) get property
The text was updated successfully, but these errors were encountered: