private Set < Comparable > prepareKeys ( OIndex < ? > index , Object keys ) { final OIndexDefinition indexDefinition = index . getDefinition ( ) ; if ( keys instanceof Collection ) { final Set < Comparable > newKeys = new TreeSet < Comparable > ( ) ; for ( Object o : ( ( Collection ) keys ) ) { newKeys . add ( ( Comparable ) indexDefinition . createValue ( o ) ) ; } return newKeys ; } else { return Collections . singleton ( ( Comparable ) indexDefinition . createValue ( keys ) ) ; } }
Make type conversion of keys for specific index .