class SQLiteUtils {

    @NonNull
    static List<String> createUniqueDefinition(TableInfo tableInfo) {
        ArrayList<String> definitions = new ArrayList<>();
        SparseArray<UniqueGroupInfo> uniqueGroups = tableInfo.getUniqueGroups();
        for (int i = 0; i < uniqueGroups.size(); i++) {
            int key = uniqueGroups.keyAt(i);
            UniqueGroupInfo uniqueGroupInfo = uniqueGroups.get(key);
            if (uniqueGroupInfo.columns.size() > 0) {
                definitions.add(String.format("UNIQUE (%s) ON CONFLICT %s",
                        join(uniqueGroupInfo.columns),
                        uniqueGroupInfo.uniqueConflict.toString()));
            }
        }
        return definitions;
    }

}