public static OIndexDefinition createIndexDefinition(final OClass oClass, final List<String> fieldNames, final List<OType> types,
List<OCollate> collates, String indexKind, String algorithm) {
checkTypes(oClass, fieldNames, types);
if (fieldNames.size() == 1)
return createSingleFieldIndexDefinition(oClass, fieldNames.get(0), types.get(0), collates == null ? null : collates.get(0),
indexKind, algorithm);
else
return createMultipleFieldIndexDefinition(oClass, fieldNames, types, collates, indexKind, algorithm);
}