private static <T extends Chain> ChainsConfig.Chains.Builder getChain(T chain) {
        ChainSpecification specification = chain.getChainSpecification();

        return new ChainsConfig.Chains.Builder()
                .type(chain.getType())
                .id(specification.componentId.stringValue())
                .components(getComponents(specification.componentReferences))
                .inherits(getComponents(specification.inheritance.chainSpecifications))
                .excludes(getComponents(specification.inheritance.excludedComponents))
                .phases(getPhases(specification.phases()));
    }
@author Tony Vaagenes
@author gjoranv

Generates config for a all the chains.
config-model/src/main/java/com/yahoo/vespa/model/container/component/chain/ChainsConfigGenerator.java