Gets the value stored in a field in the wrapped object @param name The name of the field @param supers The number of superclasses to move up before getting the declared field @return A wrapped NMSObject with the value of the field
(int supers, String name)
| 86 | * @return A wrapped NMSObject with the value of the field |
| 87 | */ |
| 88 | public NMSObject getField(int supers, String name) { |
| 89 | try { |
| 90 | Field field = getSuperclass(obj.getClass(), supers).getDeclaredField(name); |
| 91 | field.setAccessible(true); |
| 92 | return new NMSObject(field.get(obj)); |
| 93 | } catch (IllegalAccessException | NoSuchFieldException e) { |
| 94 | throw new IllegalArgumentException(e); |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | /** |
| 99 | * Gets the value stored in a field in the wrapped object |
nothing calls this directly
no test coverage detected