core/src/main/java/com/orientechnologies/orient/core/sql/OChainedIndexProxy.java
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));
    }
  }
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));
    }
  }
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.

@param index - index for which keys prepared for.
@param keys  - which should be prepared.

@return keys converted to necessary type.
Make type conversion of keys for specific index .