I have java package There is Host class and Client class that can reveive many hosts
public final class Host {
public final String name;
public final int port;
}
public class SomeClient{...
public Client(Host... hosts) throws Exception {
....
}
I'm writing scala code to creating this client
// the hosts example is hosts1,host2,host3
def getClient(hosts:String) :SomeClient ={
val default_port:Int = 100
val hostsArr: Array[String] =hosts.split(",")
new Client (hostArr ???)
}
How can I map and convert scala array of strings to Host[], so the client will be created properly?