Exemplo n.º 1
0
  /**
   * Set the value in the field with the specified name in the specified object. Supports
   * inheritance.
   *
   * @param object The object to set the value in.
   * @param fieldName The name of the field.
   * @param value The value to set in the field.
   */
  public static void setFieldValue(
      final Object object, final String fieldName, final Object value) {
    Validate.notNull(object, "The object to set the value in can not be null");
    Validate.notEmpty(fieldName, "The name of the field can not be empty");

    final Field field = getField(object, fieldName);
    setValue(object, value, field);
  }