title: I want to implement an interface for a search class what is the best approach to implement an interface?
body: <p>I want to have a search class with several different options in it, my search class should be able to filter results in different ways such as :</p>
  
  <pre><code>getX()
  getY()
  getZ()
  getK()
  </code></pre>
  
  <p>above X,Y,Z,K are my criterion and they are common in my case so I decided to create an interface like following :</p>
  
  <pre><code>public interface IFilter {
  
  public String getX();
  public void setX(String x);
  .
  .
  .
  
  //I am not sure about the return type of my criteria!
  public IAmNotSureAboutReturnType criteria();
  }
  </code></pre>
  
  <p>the application should be capable of geting 1 or more criteria at each time and my Idea is to have an interface to instruct a class to implement all the criterion and all a criteria() method to return back a compiled criteria to my search class.</p>
  
  <p>All of the criterion are based on String but yet I'm not sure about return type of criteria() since it should combine all the given criterion and return one particular type as return value.</p>
  
  <p>and my search class is not based on SQL its mostly based on JSON.</p>
  
  <p>Can anyone suggest me what is the best approach to have an interface for criterion for a search class?</p>