@ Trivial private static String toKey ( String name , String filter , SearchControls cons ) { int length = name . length ( ) + filter . length ( ) + 100 ; StringBuffer key = new StringBuffer ( length ) ; key . append ( name ) ; key . append ( "|" ) ; key . append ( filter ) ; key . append ( "|" ) ; key . append ( cons . getSearchScope ( ) ) ; key . append ( "|" ) ; key . append ( cons . getCountLimit ( ) ) ; key . append ( "|" ) ; key . append ( cons . getTimeLimit ( ) ) ; String [ ] attrIds = cons . getReturningAttributes ( ) ; if ( attrIds != null ) { for ( int i = 0 ; i < attrIds . length ; i ++ ) { key . append ( "|" ) ; key . append ( attrIds [ i ] ) ; } } return key . toString ( ) ; }
Returns a hash key for the name|filter|cons tuple used in the search query - results cache .