public ServerInfo(String host,int port){
  Objects.requireNonNull(host);
  if (port < 0) {
    throw new IllegalArgumentException("port<0");
  }
  this.host=host;
  this.port=port;
}

public ServerInfo ( String host , int port ) { Objects . requireNonNull ( host ) ; if ( port < 0 ) { throw new IllegalArgumentException ( "port<0" ) ; } this . host = host ; this . port = port ; }
creates a serverinfo with the given host and port .
