class RecipientRewriteTableConfiguration {

    public static RecipientRewriteTableConfiguration fromConfiguration(HierarchicalConfiguration<ImmutableNode> config) throws ConfigurationException {
        boolean recursive = config.getBoolean("recursiveMapping", RECURSIVE_MAPPING_ENABLED);
        int mappingLimit;
        if (recursive) {
            mappingLimit = config.getInt("mappingLimit", DEFAULT_ENABLED_MAPPING_LIMIT);
            checkMappingLimit(mappingLimit);
        } else {
            mappingLimit = DISABLED_MAPPING_LIMIT;
        }
        return new RecipientRewriteTableConfiguration(recursive, mappingLimit);
    }

    @VisibleForTesting public  RecipientRewriteTableConfiguration(boolean recursive, int mappingLimit);

}