public static List < String > getIndexNames ( final List < IndexModel > indexes , final CodecRegistry codecRegistry ) { List < String > indexNames = new ArrayList < String > ( indexes . size ( ) ) ; for ( IndexModel index : indexes ) { String name = index . getOptions ( ) . getName ( ) ; if ( name != null ) { indexNames . add ( name ) ; } else { indexNames . add ( IndexHelper . generateIndexName ( index . getKeys ( ) . toBsonDocument ( BsonDocument . class , codecRegistry ) ) ) ; } } return indexNames ; }
Get a list of index names for the given list of index models