class LogPruneStrategyFactory {

    @VisibleForTesting
    static Threshold getThresholdByType( FileSystemAbstraction fileSystem, Clock clock, ThresholdConfigValue value,
            String originalConfigValue )
    {
        long thresholdValue = value.value;

        switch ( value.type )
        {
            case "files":
                return new FileCountThreshold( thresholdValue );
            case "size":
                return new FileSizeThreshold( fileSystem, thresholdValue );
            case "txs":
            case "entries": // txs and entries are synonyms
                return new EntryCountThreshold( thresholdValue );
            case "hours":
                return new EntryTimespanThreshold( clock, HOURS, thresholdValue );
            case "days":
                return new EntryTimespanThreshold( clock, DAYS, thresholdValue );
            default:
                throw new IllegalArgumentException( "Invalid log pruning configuration value '" + originalConfigValue +
                        "'. Invalid type '" + value.type + "', valid are files, size, txs, entries, hours, days." );
        }
    }

    public  LogPruneStrategyFactory();

}