uk.sponte.automation.seleniumpom.helpers.ClassHelper Maven / Gradle / Ivy
package uk.sponte.automation.seleniumpom.helpers;
import com.google.common.collect.Lists;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
/**
* Created by n450777 on 30/04/15.
*/
public class ClassHelper {
public static Iterable getFieldsFromClass(Class> startClass) {
List currentClassFields = new ArrayList();
Class> parentClass = startClass.getSuperclass();
if (parentClass != null) {
List parentClassFields =
(List) getFieldsFromClass(parentClass);
currentClassFields.addAll(parentClassFields);
}
currentClassFields.addAll(Lists.newArrayList(startClass.getDeclaredFields()));
return currentClassFields;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy