code: @SuppressWarnings("unchecked")
    public static <T, O> O getFieldValue(Class<T> clz, T t, String fieldName) throws NoSuchFieldException {
      Field field = clz.getDeclaredField(fieldName);
      field.setAccessible(true);
      try {
        return (O) field.get(t);
      } catch (IllegalAccessException e) {
        throw new IllegalStateException(e);
      }
    }
docs: Get field value by name
  
  @param clz
  @param t
  @param fieldName
  @return
  @throws NoSuchFieldException