Uses reflection to access all fields of type clazz in T and write field name and its value as a key-value pair into a map.