package org.pdxfinder.services.search;

import org.pdxfinder.services.ds.ModelForQuery;

import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.function.Function;

/*
 * Created by csaba on 20/11/2018.
 */
public class OneParamSearch extends GeneralSearch{

    //static Function a = ModelForQuery::getPatientAge;



    public OneParamSearch(String name, String urlParam) {
        super(name, urlParam);
    }



    public Set<ModelForQuery> search(List<String> param, List<ModelForQuery> mfq, Function searchFunc){

        //TODO: Implement search logic on single selected parameter
        return new HashSet<>();
    }


}

@@ -288,67 +288,8 @@
 h%7B%0A%0A
-    //static Function a = ModelForQuery::getPatientAge;%0A%0A%0A%0A
     
@@ -381,17 +381,16 @@
     %7D%0A%0A%0A
-%0A
     publ
@@ -435,18 +435,24 @@
 ng%3E 
-p
+searchP
 aram
+s
 , 
-Lis
+Se
 t%3CMo
@@ -467,16 +467,19 @@
 ery%3E mfq
+Set
 , Functi
@@ -484,90 +484,304 @@
 tion
- searchFunc)%7B%0A%0A        //TODO: Implement search logic on single selected parameter
+%3CModelForQuery, String%3E searchFunc)%7B%0A%0A        Set%3CModelForQuery%3E results = new HashSet%3C%3E();%0A%0A        for(ModelForQuery mfq: mfqSet)%7B%0A%0A            String mfqValue = searchFunc.apply(mfq);%0A%0A            if(searchParams.contains(mfqValue))%7B%0A                results.add(mfq);%0A            %7D%0A%0A        %7D%0A
 %0A   
@@ -792,31 +792,23 @@
  return 
-new HashSet%3C%3E()
+results
 ;%0A    %7D%0A

Implement one param search