code: private void resetField(Object instance, String fieldName, boolean hasValue) {
          try {
              Field field = getField(instance.getClass(), fieldName);
              if(!Modifier.isPublic(field.getModifiers()))
                  field.setAccessible(true);
              if(field.getType().isPrimitive()) {
                  if(boolean.class.isAssignableFrom(field.getType()))
                      field.set(instance, false);
                  else if(int.class.isAssignableFrom(field.getType()))
                      field.set(instance, 0);
                  else if(short.class.isAssignableFrom(field.getType()))
                      field.set(instance, 0);
                  else if(char.class.isAssignableFrom(field.getType()))
                      field.set(instance, '\u0000');
                  else if(byte.class.isAssignableFrom(field.getType()))
                      field.set(instance, 0);
                  else if(long.class.isAssignableFrom(field.getType()))
                      field.set(instance, 0L);
                  else if(float.class.isAssignableFrom(field.getType()))
                      field.set(instance, 0.0f);
                  else if(double.class.isAssignableFrom(field.getType()))
                      field.set(instance, 0.0d);
              }
              else if(!hasValue && field.getType().equals(Boolean.class)) {
                 field.set(instance, Boolean.FALSE);
              }
              else
                  field.set(instance, null);
          }
          catch (NoSuchFieldException | IllegalAccessException e) {
              e.printStackTrace();
          }
      }
docs: Will parse the input line and populate the fields in the instance object specified by
  the given annotations.
  The instance object must be annotated with the CommandDefinition annotation @see CommandDefinition
  Any parser errors will throw an exception
  
  @param instance command
  @param fieldName field
  public static void parseAndPopulate(Object instance, String line)
  throws CommandLineParserException, OptionValidatorException {
  CommandLineParser parser = ParserGenerator.generateCommandLineParser(instance.getClass());
  AeshCommandPopulator populator = new AeshCommandPopulator(parser);
  populator.populateObject(instance, parser.parse(line));
  }