public void set ( Object receiver , String fieldName , /* @Nullable */ Object value ) throws SecurityException , NoSuchFieldException , IllegalArgumentException , IllegalAccessException { Preconditions . checkNotNull ( receiver , "receiver" ) ; Preconditions . checkNotNull ( fieldName , "fieldName" ) ; Class < ? extends Object > clazz = receiver . getClass ( ) ; Field f = getDeclaredField ( clazz , fieldName ) ; if ( ! f . isAccessible ( ) ) f . setAccessible ( true ) ; f . set ( receiver , value ) ; }
Sets the given value on an the receivers s accessible field with the given name .