public static Map<String, Property> getProperties(Class clazz, Type genericType) {
        Map<String, Property> map = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);

        // Start by methods - public only, including overridden
        Method[] methods = clazz.getMethods();
        for (Method method : methods) {
            if (method.getName().startsWith("set") && method.getParameterTypes().length == 1) {
                // it's a setter.
                String name = method.getName().substring("set".length());
                Property property = map.get(name);
                if (property == null) {
                    property = new Property();
                    map.put(name, property);
                }
                property.setter(method);
            }
        }

        // All fields, but will not do anything for existing properties.
        for (Field field : getAllFields(clazz)) {
            String name = field.getName();
            Property property = map.get(name);
            if (property == null) {
                property = new Property();
                property.field(field);
                map.put(name, property);
            }
            // Else the property has already a setter, the setter has to be used.
        }

        return map;
    }
public static Map < String , Property > getProperties ( Class clazz , Type genericType ) { Map < String , Property > map = new TreeMap < > ( String . CASE_INSENSITIVE_ORDER ) ; Method [ ] methods = clazz . getMethods ( ) ; for ( Method method : methods ) { if ( method . getName ( ) . startsWith ( "set" ) && method . getParameterTypes ( ) . length == 1 ) { String name = method . getName ( ) . substring ( "set" . length ( ) ) ; Property property = map . get ( name ) ; if ( property == null ) { property = new Property ( ) ; map . put ( name , property ) ; } property . setter ( method ) ; } } for ( Field field : getAllFields ( clazz ) ) { String name = field . getName ( ) ; Property property = map . get ( name ) ; if ( property == null ) { property = new Property ( ) ; property . field ( field ) ; map . put ( name , property ) ; } } return map ; }
Gets the map of String to {@link org.wisdom.content.converters.ReflectionHelper.Property}. These properties
are extracted from the given class. Properties are identified using the `setX` methods and fields. The map
entry are the property name.

@param clazz       the class
@param genericType the class with generic parameter if any
@return the map containing the extracted properties