Field[] fields = TbRawMaterialController.class.getDeclaredFields(); Arrays.stream(fields).forEach(field -> { String fieldName = field.getName(); Class<?> type = field.getType(); try { field.setAccessible(true); if(!Modifier.isAbstract(field.getModifiers())&&!type.isInterface()){ Object o = field.get(TbRawMaterialController.class); map.put(fieldName,o); } }catch (Exception e){ } });