setFieldTyped

public static void setFieldTyped(Field field, Object obj, Object value)(source)

Sets the typed field to the specified value.

Parameters

field

the field instance to change its content

obj

the object instance containing the field

value

the new value of the field

Throws

if this Field object is enforcing Java language access control and the underlying field is either inaccessible or final; or if this Field object has no write access.

if the specified object is not an instance of the class or interface declaring the underlying field (or a subclass or implementor thereof), or if an unwrapping conversion fails.