class HeaderFunctions {

    public static HeaderFunction parseFromJson(JsonArray config) throws IllegalArgumentException {
        LOG.debug("creating header function chain from " + config);

        Consumer<EvalScope> chain = null;
        for (int pos = 0; pos < config.size(); pos++) {
            JsonObject rule = config.getJsonObject(pos);
            Consumer<EvalScope> c = parseOneFromJason(config, rule);
            chain = (chain == null) ? c : chain.andThen(c);
        }
        return wrapConsumerChain(chain);
    }

}