code: private void primitiveGetter(Field field) {
      String typeName = field.getType().getName();
      String methodName = String.format("get%c%s", Character.toUpperCase(typeName.charAt(0)), typeName.substring(1));
  
      GeneratorAdapter mg = new GeneratorAdapter(Opcodes.ACC_PUBLIC, getMethod(field.getType(), methodName, Object.class),
                                                 null, new Type[0], classWriter);
      if (isPrivate) {
        // get the value using the generic Object get(Object) method and unbox the value
        mg.loadThis();
        mg.loadArg(0);
        mg.invokeVirtual(Type.getObjectType(className), getMethod(Object.class, "get", Object.class));
        mg.unbox(Type.getType(field.getType()));
      } else {
        // Simply access the field.
        mg.loadArg(0);
        mg.checkCast(Type.getType(field.getDeclaringClass()));
        mg.getField(Type.getType(field.getDeclaringClass()), field.getName(), Type.getType(field.getType()));
      }
      mg.returnValue();
      mg.endMethod();
    }
docs: Generates the primitive getter (getXXX) based on the field type.
  @param field The reflection field object.