public class TransformationsUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static Pattern |
NON_NULL_PATTERN
Matches the simple part of any annotation that lombok considers as indicative of NonNull status.
|
static Pattern |
NULLABLE_PATTERN
Matches the simple part of any annotation that lombok considers as indicative of Nullable status.
|
| Modifier and Type | Method and Description |
|---|---|
static List<String> |
toAllGetterNames(AnnotationValues<Accessors> accessors,
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(AnnotationValues<Accessors> accessors,
CharSequence fieldName,
boolean isBoolean)
Returns all names of methods that would represent the setter for a field with the provided name.
|
static List<String> |
toAllWitherNames(AnnotationValues<Accessors> accessors,
CharSequence fieldName,
boolean isBoolean)
Returns all names of methods that would represent the wither for a field with the provided name.
|
static String |
toGetterName(AnnotationValues<Accessors> accessors,
CharSequence fieldName,
boolean isBoolean)
Generates a getter name from a given field name.
|
static String |
toSetterName(AnnotationValues<Accessors> accessors,
CharSequence fieldName,
boolean isBoolean)
Generates a setter name from a given field name.
|
static String |
toWitherName(AnnotationValues<Accessors> accessors,
CharSequence fieldName,
boolean isBoolean)
Generates a wither name from a given field name.
|
public static final Pattern NON_NULL_PATTERN
public static final Pattern NULLABLE_PATTERN
public static String toGetterName(AnnotationValues<Accessors> accessors, CharSequence fieldName, boolean isBoolean)
Accessors). If the field name does not fit
the prefix list, this method immediately returns null.Accessors has fluent=true, then return the basename.isBoolean is true.isBoolean is true: Check if the field starts with is followed by a non-lowercase character. If so, return the field name verbatim.accessors - Accessors configuration.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.null if this field does not fit expected patterns and therefore cannot be turned into a getter name.public static String toSetterName(AnnotationValues<Accessors> accessors, CharSequence fieldName, boolean isBoolean)
Accessors). If the field name does not fit
the prefix list, this method immediately returns null.Accessors has fluent=true, then return the basename.isBoolean is true: Check if the field starts with is followed by a non-lowercase character.
If so, replace is with set and return that."set" plus the possibly title/uppercased first character, and the rest of the field name.accessors - Accessors configuration.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.null if this field does not fit expected patterns and therefore cannot be turned into a getter name.public static String toWitherName(AnnotationValues<Accessors> accessors, CharSequence fieldName, boolean isBoolean)
Accessors). If the field name does not fit
the prefix list, this method immediately returns null.isBoolean is true: Check if the field starts with is followed by a non-lowercase character.
If so, replace is with with and return that."with" plus the possibly title/uppercased first character, and the rest of the field name.accessors - Accessors configuration.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.null if this field does not fit expected patterns and therefore cannot be turned into a getter name.public static List<String> toAllGetterNames(AnnotationValues<Accessors> accessors, CharSequence fieldName, boolean isBoolean)
isBoolean is true, then a field named isRunning would produce:[isRunning, getRunning, isIsRunning, getIsRunning]accessors - Accessors configuration.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(AnnotationValues<Accessors> accessors, CharSequence fieldName, boolean isBoolean)
isBoolean is true, then a field named isRunning would produce:[setRunning, setIsRunning]accessors - Accessors configuration.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> toAllWitherNames(AnnotationValues<Accessors> accessors, CharSequence fieldName, boolean isBoolean)
isBoolean is true, then a field named isRunning would produce:[withRunning, withIsRunning]accessors - Accessors configuration.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.Copyright © 2009-2011 The Project Lombok Authors, licensed under the MIT licence.