Package io.sundr.model.utils
Class Getter
java.lang.Object
io.sundr.model.utils.Getter
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringReturn the field name for the specified gettermethod.static StringfieldNameSafe(Method method) Return the field name for the specified gettermethod.static MethodFind the getter of the specified field in the type.findOptional(TypeDef clazz, Field field) static final Methodstatic booleanChecks if the specified method is a getter.static booleanChecks if the specified method is a getter.static StringReturn the getter name for the specifiedField.static String
-
Field Details
-
GET_PREFIX
- See Also:
-
IS_PREFIX
- See Also:
-
SHOULD_PREFIX
- See Also:
-
VOID
-
-
Constructor Details
-
Getter
public Getter()
-
-
Method Details
-
findOptional
-
find
Find the getter of the specified field in the type.- Parameters:
clazz- The class.field- The field.- Returns:
- The getter method if found. Throws exception if no getter is matched.
-
is
Checks if the specified method is a getter.- Parameters:
method- The specified method.- Returns:
- True if getter, false otherwise.
-
is
Checks if the specified method is a getter.- Parameters:
method- The method.acceptPrefixless- Flag to enable support of prefixless getters.- Returns:
- True if the method is a getter, false otherwise.
-
forField
-
name
Return the getter name for the specifiedField.- Parameters:
field- The field.- Returns:
- The name.
-
fieldName
Return the field name for the specified gettermethod.- Parameters:
method- The method.- Returns:
- The name.
-
fieldNameSafe
Return the field name for the specified gettermethod. This method will not check if the method is an actual getter and will return the method name if not.- Parameters:
method- The method.- Returns:
- The name, or the method name if method is not a typical getter..
-
prefix
-