public static ConnectionDetails fromServer(Server server) {
        ConnectionDetails cd = new ConnectionDetails();
        cd.address = server.get("address");

        String port = server.get("port");
        if ( !port.isEmpty() )
            cd.port = Integer.parseInt(port);

        String nick = server.get("nickname");
        if ( !nick.isEmpty() )
            cd.nickname = nick;

        String autoChans = server.get("channels");
        if ( !autoChans.isEmpty() )
            cd.addChannelList(autoChans);

        return cd;
    }