public static Field[] getAllFields(Class<?> c) {
        List<Field> listOfFields = new ArrayList<Field>();
        getAllFields(c, listOfFields);

        Field[] arrayOffields = new Field[listOfFields.size()];
        listOfFields.toArray(arrayOffields);
        return arrayOffields;
    }
public static Field [ ] getAllFields ( Class < ? > c ) { List < Field > listOfFields = new ArrayList < Field > ( ) ; getAllFields ( c , listOfFields ) ; Field [ ] arrayOffields = new Field [ listOfFields . size ( ) ] ; listOfFields . toArray ( arrayOffields ) ; return arrayOffields ; }
Given any class return an Array of Fields in the class

@param c Class
@return Field[]