@Test public void set_value() { FieldDescriptor fieldDescriptor = type.getField("privateField"); fieldDescriptor.set(this, "Magic!"); assertThat(privateField).isEqualTo("Magic!"); }
public void set(Object obj, Object value) { try { field.set(obj, value); } catch (IllegalArgumentException | IllegalAccessException e) { throw new ReflectionException(toString(), e); } }
FieldDescriptor extends JavaMemberDescriptor<Field> implements AccessibleProperty { public void set(Object obj, Object value) { try { field.set(obj, value); } catch (IllegalArgumentException | IllegalAccessException e) { throw new ReflectionException(toString(), e); } } }
FieldDescriptor extends JavaMemberDescriptor<Field> implements AccessibleProperty { public void set(Object obj, Object value) { try { field.set(obj, value); } catch (IllegalArgumentException | IllegalAccessException e) { throw new ReflectionException(toString(), e); } } FieldDescriptor(TypeDescriptor typeDescriptor, Field field); }
FieldDescriptor extends JavaMemberDescriptor<Field> implements AccessibleProperty { public void set(Object obj, Object value) { try { field.set(obj, value); } catch (IllegalArgumentException | IllegalAccessException e) { throw new ReflectionException(toString(), e); } } FieldDescriptor(TypeDescriptor typeDescriptor, Field field); Object getStatic(); Object get(Object obj); @Override boolean isReadable(); @Override boolean isReadableFrom(TypeDescriptor typeDescriptor); @Override boolean isWritable(); @Override boolean isWritableFrom(TypeDescriptor typeDescriptor); void setStatic(Object value); void set(Object obj, Object value); boolean isTransient(); TypeDescriptor getType(); @Override Field getElement(); final int hashCode(); final boolean equals(Object obj); String getName(); String toString(); }
FieldDescriptor extends JavaMemberDescriptor<Field> implements AccessibleProperty { public void set(Object obj, Object value) { try { field.set(obj, value); } catch (IllegalArgumentException | IllegalAccessException e) { throw new ReflectionException(toString(), e); } } FieldDescriptor(TypeDescriptor typeDescriptor, Field field); Object getStatic(); Object get(Object obj); @Override boolean isReadable(); @Override boolean isReadableFrom(TypeDescriptor typeDescriptor); @Override boolean isWritable(); @Override boolean isWritableFrom(TypeDescriptor typeDescriptor); void setStatic(Object value); void set(Object obj, Object value); boolean isTransient(); TypeDescriptor getType(); @Override Field getElement(); final int hashCode(); final boolean equals(Object obj); String getName(); String toString();  }