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 MethodFind the getter of the specified property in the type.static MethodFind the getter of the specified property in the type.findOptional(TypeDef clazz, Property property) static final MethodforProperty(Property property) static booleanChecks if the specified method is a getter.static booleanChecks if the specified method is a getter.static StringReturn the getter name for the specifiedProperty.static Stringstatic StringpropertyName(Method method) Return the property name for the specified gettermethod.static StringpropertyNameSafe(Method method) Return the property name for the specified gettermethod.
-
Field Details
-
GET_PREFIX
- See Also:
-
IS_PREFIX
- See Also:
-
SHOULD_PREFIX
- See Also:
-
VOID
-
-
Constructor Details
-
Getter
public Getter()
-
-
Method Details
-
find
Find the getter of the specified property in the type.- Parameters:
clazz- The class.property- The property.- Returns:
- The getter method if found. Throws exception if no getter is matched.
-
findOptional
-
find
Find the getter of the specified property in the type.- Parameters:
clazz- The class.property- The property.acceptPrefixless- Flag to accept prefixless getters.- 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:
-
forProperty
-
name
Return the getter name for the specifiedProperty.- Parameters:
property- The property.- Returns:
- The name.
-
propertyName
Return the property name for the specified gettermethod.- Parameters:
method- The method.- Returns:
- The name.
-
propertyNameSafe
Return the property 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
-