(Object obj, String name, Class<T> type)
| 871 | } |
| 872 | |
| 873 | public static <T> T getInstanceObject(Object obj, String name, Class<T> type) throws NoSuchFieldException { |
| 874 | Class<?> clazz = obj.getClass(); |
| 875 | Field f = findField(clazz, type, name); |
| 876 | f.setAccessible(true); |
| 877 | try { |
| 878 | return (T) f.get(obj); |
| 879 | } catch (IllegalAccessException e) { |
| 880 | // should not happen |
| 881 | throw new AssertionError(e); |
| 882 | } |
| 883 | } |
| 884 | |
| 885 | public static void setInstanceObject(@NonNull Object obj, @NonNull String name, |
| 886 | @Nullable Object value) throws NoSuchFieldException { |
no test coverage detected