public static Pair<FilterValueSetParam,FilterParamIndexBase> findIndex(ArrayDeque<FilterValueSetParam> parameters,List<FilterParamIndexBase> indizes){
  for (  FilterValueSetParam parameter : parameters) {
    FilterSpecLookupable lookupable=parameter.getLookupable();
    FilterOperator operator=parameter.getFilterOperator();
    for (    FilterParamIndexBase index : indizes) {
      if (index instanceof FilterParamIndexLookupableBase) {
        FilterParamIndexLookupableBase propBasedIndex=(FilterParamIndexLookupableBase)index;
        if ((lookupable.equals(propBasedIndex.getLookupable())) && (operator.equals(propBasedIndex.getFilterOperator()))) {
          return new Pair<FilterValueSetParam,FilterParamIndexBase>(parameter,index);
        }
      }
 else       if (index instanceof FilterParamIndexBooleanExpr && parameters.size() == 1) {
        if (operator.equals(FilterOperator.BOOLEAN_EXPRESSION)) {
          return new Pair<FilterValueSetParam,FilterParamIndexBase>(parameter,index);
        }
      }
    }
  }
  return null;
}

public static Pair < FilterValueSetParam , FilterParamIndexBase > findIndex ( ArrayDeque < FilterValueSetParam > parameters , List < FilterParamIndexBase > indizes ) { for ( FilterValueSetParam parameter : parameters ) { FilterSpecLookupable lookupable = parameter . getLookupable ( ) ; FilterOperator operator = parameter . getFilterOperator ( ) ; for ( FilterParamIndexBase index : indizes ) { if ( index instanceof FilterParamIndexLookupableBase ) { FilterParamIndexLookupableBase propBasedIndex = ( FilterParamIndexLookupableBase ) index ; if ( ( lookupable . equals ( propBasedIndex . getLookupable ( ) ) ) && ( operator . equals ( propBasedIndex . getFilterOperator ( ) ) ) ) { return new Pair < FilterValueSetParam , FilterParamIndexBase > ( parameter , index ) ; } } else if ( index instanceof FilterParamIndexBooleanExpr && parameters . size ( ) == 1 ) { if ( operator . equals ( FilterOperator . BOOLEAN_EXPRESSION ) ) { return new Pair < FilterValueSetParam , FilterParamIndexBase > ( parameter , index ) ; } } } } return null ; }
find an index that matches one of the filter parameters passed . the parameter type and index type match up if the property name and filter operator are the same for the index and the filter parameter . for instance , for a filter parameter of " count equals 10 " , the index against property " count " with operator type equals will be returned , if present . note : the caller is expected to obtain locks , if necessary , on the collections passed in . note : doesn ' t match non - property based index - thus boolean expressions don ' t get found and are always entered as a new index
