code: public static boolean setProperty(Object target, String name, Object value) {
          try {
              for (PropertyDescriptor pd : Introspector.getBeanInfo(target.getClass()).getPropertyDescriptors()) {
                  if (pd.getWriteMethod() != null && pd.getName().equals(name)) {
                      pd.getWriteMethod().invoke(target, value);
                      return true;
                  }
              }
          } catch (Exception e) {
              throw new RuntimeException(e);
          }
  
          return false;
      }
docs: Set the property identified by name to the provided value.
  @param target
  @param name
  @param value
  @return true on success, false if property wasn't found.