|
Lombok - v0.10.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectlombok.core.handlers.TransformationsUtil
public class TransformationsUtil
Container for static utility methods useful for some of the standard lombok transformations, regardless of target platform (e.g. useful for both javac and Eclipse lombok implementations).
| Field Summary | |
|---|---|
static Pattern |
NON_NULL_PATTERN
|
static Pattern |
NULLABLE_PATTERN
|
static Pattern |
PRIMITIVE_TYPE_NAME_PATTERN
|
| Method Summary | |
|---|---|
static List<String> |
toAllGetterNames(CharSequence fieldName,
boolean isBoolean)
Returns all names of methods that would represent the getter for a field with the provided name. |
static List<String> |
toAllSetterNames(CharSequence fieldName,
boolean isBoolean)
Returns all names of methods that would represent the setter for a field with the provided name. |
static String |
toGetterName(CharSequence fieldName,
boolean isBoolean)
Generates a getter name from a given field name. |
static String |
toSetterName(CharSequence fieldName,
boolean isBoolean)
Generates a setter name from a given field name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Pattern PRIMITIVE_TYPE_NAME_PATTERN
public static final Pattern NON_NULL_PATTERN
public static final Pattern NULLABLE_PATTERN
| Method Detail |
|---|
public static String toGetterName(CharSequence fieldName,
boolean isBoolean)
isBoolean is true.
Then, check if the first character of the field is lowercase. If so, check if the second character
exists and is title or upper case. If so, uppercase the first character. If not, titlecase the first character.
return the prefix plus the possibly title/uppercased first character, and the rest of the field name.
Note that for boolean fields, if the field starts with 'is', and the character after that is
not a lowercase character, the field name is returned without changing any character's case and without
any prefix.
fieldName - the name of the field.isBoolean - if the field is of type 'boolean'. For fields of type 'java.lang.Boolean', you should provide false.
public static String toSetterName(CharSequence fieldName,
boolean isBoolean)
fieldName - the name of the field.isBoolean - if the field is of type 'boolean'. For fields of type 'java.lang.Boolean', you should provide false.
public static List<String> toAllGetterNames(CharSequence fieldName,
boolean isBoolean)
isBoolean is true, then a field named isRunning would produce:[isRunning, getRunning, isIsRunning, getIsRunning]
fieldName - the name of the field.isBoolean - if the field is of type 'boolean'. For fields of type 'java.lang.Boolean', you should provide false.
public static List<String> toAllSetterNames(CharSequence fieldName,
boolean isBoolean)
isBoolean is true, then a field named isRunning would produce:[setRunning, setIsRunning]
fieldName - the name of the field.isBoolean - if the field is of type 'boolean'. For fields of type 'java.lang.Boolean', you should provide false.
|
Lombok - v0.10.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||