class RetentionExpirationDestroyerController {

    protected BusinessObjectDataKey getBusinessObjectDataKey(String[] line, int lineNumber, File inputCsvFile)
    {
        if (line.length != CSV_FILE_HEADER_COLUMNS.length)
        {
            throw new IllegalArgumentException(
                String.format("Line number %d of input file \"%s\" does not match the expected format.", lineNumber, inputCsvFile.toString()));
        }

        Integer businessObjectFormatVersion;
        Integer businessObjectDataVersion;

        try
        {
            businessObjectFormatVersion = Integer.valueOf(line[4]);
        }
        catch (NumberFormatException e)
        {
            throw new IllegalArgumentException(String
                .format("Line number %d of input file \"%s\" does not match the expected format. Business object format version must be an integer.",
                    lineNumber, inputCsvFile.toString()), e);
        }

        try
        {
            businessObjectDataVersion = Integer.valueOf(line[10]);
        }
        catch (NumberFormatException e)
        {
            throw new IllegalArgumentException(String
                .format("Line number %d of input file \"%s\" does not match the expected format. Business object data version must be an integer.", lineNumber,
                    inputCsvFile.toString()), e);
        }

        // Build a list of optional sub-partition values.
        List<String> subPartitionValues = new ArrayList<>();
        for (String subPartitionValue : Arrays.asList(line[6], line[7], line[8], line[9]))
        {
            if (StringUtils.isNotBlank(subPartitionValue))
            {
                subPartitionValues.add(subPartitionValue);
            }
            else
            {
                break;
            }
        }

        return new BusinessObjectDataKey(line[0], line[1], line[2], line[3], businessObjectFormatVersion, line[5], subPartitionValues,
            businessObjectDataVersion);
    }

}