code: private void generateSetter(Field field) {
      if (isPrivate) {
        invokeReflection(getMethod(void.class, "set", Object.class, Object.class), setterSignature());
      } else {
        directSetter(field);
      }
  
      if (field.getType().isPrimitive()) {
        primitiveSetter(field);
      }
    }
docs: Generates the setter method and optionally the primitive setter.
  @param field The reflection field object.