@ SuppressWarnings ( "unchecked" ) @ Override public < T extends Element > Index < T > getIndex ( final String indexName , final Class < T > indexClass ) { makeActive ( ) ; final OIndexManager indexManager = getDatabase ( ) . getMetadata ( ) . getIndexManager ( ) ; final OIndex idx = indexManager . getIndex ( indexName ) ; if ( idx == null || ! hasIndexClass ( idx ) ) return null ; final Index < ? extends Element > index = new OrientIndex ( this , idx ) ; if ( indexClass . isAssignableFrom ( index . getIndexClass ( ) ) ) return ( Index < T > ) index ; else throw ExceptionFactory . indexDoesNotSupportClass ( indexName , indexClass ) ; }
Returns an index by name and class