@CheckForNull
    private static Method locateGetter(Class<?> clazz, @NonNull String fieldName) {
        final String upname = StringUtils.capitalize(fieldName);
        final List<String> accessors = Arrays.asList("get" + upname, "is" + upname);

        for (Method method : clazz.getMethods()) {
            if (method.getParameterCount() != 0) {
                continue;
            }
            if (accessors.contains(method.getName())) {
                return method;
            }

            final Exported exported = method.getAnnotation(Exported.class);
            if (exported != null && exported.name().equalsIgnoreCase(fieldName)) {
                return method;
            }
        }
        return null;
    }
Abstracts away how to retrieve attribute value from a 'target' Jenkins object.
plugin/src/main/java/io/jenkins/plugins/casc/Attribute.java