package org.testng.remote;

import com.beust.jcommander.IStringConverter;
import com.beust.jcommander.Parameter;
import org.osgi.framework.Version;

public class RemoteArgs {
  public static final String PORT = "-serport";
  @Parameter(names = PORT, description = "The port for the serialization protocol")
  public Integer serPort;

  public static final String PROTOCOL = "-protocol";
  @Parameter(names = PROTOCOL, description = "The protocol for message inter-communication")
  public String protocol;

  public static final String DONT_EXIT= "-dontexit";
  @Parameter(names = DONT_EXIT, description = "Do not exit the JVM once done")
  public boolean dontExit = false;

  public static final String ACK = "-ack";
  @Parameter(names = ACK, description = "Use ACK's")
  public boolean ack = false;

  public static final String VERSION = "-version";
  @Parameter(names = VERSION, description = "TestNG target version", required = true, converter = VersionConverter.class)
  public Version version;

  private static class VersionConverter implements IStringConverter<Version> {

    @Override
    public Version convert(String value) {
      return new Version(value);
    }
  }
}

package org.testng.remote;

import com.beust.jcommander.IStringConverter;
import com.beust.jcommander.Parameter;
import org.osgi.framework.Version;

public class RemoteArgs {
  public static final String PORT = "-serport";
  @Parameter(names = PORT, description = "The port for the serialization protocol")
  public Integer serPort;

  public static final String PROTOCOL = "-protocol";
  @Parameter(names = PROTOCOL, description = "The protocol for message inter-communication")
  public String protocol;

  public static final String DONT_EXIT= "-dontexit";
  @Parameter(names = DONT_EXIT, description = "Do not exit the JVM once done")
  public boolean dontExit = false;

  public static final String ACK = "-ack";
  @Parameter(names = ACK, description = "Use ACK's")
  public boolean ack = false;

  public static final String VERSION = "-version";
  @Parameter(names = VERSION, description = "TestNG target version", required = true, converter = VersionConverter.class)
  public Version version;

  public static class VersionConverter implements IStringConverter<Version> {

    @Override
    public Version convert(String value) {
      return new Version(value);
    }
  }
}

mark VersionConverter public otherwise get error: Class com.beust.jcommander.JCommander can not access a member of class org.testng.remote.RemoteArgs$VersionConverter with modifiers "private"