public void toConfig(StringBuilder cfg, String prefix) {
        cfg.append(prefix).append("name ").append(RoutingSpec.toConfigString(name)).append("\n");
        int numHops = hops.size();
        if (numHops > 0) {
            cfg.append(prefix).append("hop[").append(numHops).append("]\n");
            for (int i = 0; i < numHops; ++i) {
                cfg.append(prefix).append("hop[").append(i).append("] ");
                cfg.append(RoutingSpec.toConfigString(hops.get(i))).append("\n");
            }
        }
    }
Appends the content of this to the given config string builder.

@param cfg    The config to add to.
@param prefix The prefix to use for each add.
messagebus/src/main/java/com/yahoo/messagebus/routing/RouteSpec.java