Class SearchTerms<E extends Locatable>

java.lang.Object
org.cruk.clarity.api.search.SearchTerms<E>
Type Parameters:
E - The type of object the search terms are for.
All Implemented Interfaces:
Serializable

public class SearchTerms<E extends Locatable> extends Object implements Serializable
Class recording the parameters and entity class of a call to the API's find method.
See Also:
  • Constructor Details

    • SearchTerms

      public SearchTerms(Map<String,?> searchTerms, Class<E> entityClass)
      Creates a new SearchTerms object with the given values (as have been passed to find).
      Parameters:
      searchTerms - The search parameters.
      entityClass - The type of object being searched for.
  • Method Details

    • getSearchTerms

      public List<SearchTerm> getSearchTerms()
      Get the parameters of the search.
      Returns:
      A list of individual search terms.
    • getEntityClass

      public Class<E> getEntityClass()
      Get the class being searched for.
      Returns:
      The entity class.
    • hashCode

      public int hashCode()
      Override of hash code. The hash should be based on the class being searched for along with the names of the parameters and their individual types and values. The order of values in parameter values is not important.
      Overrides:
      hashCode in class Object
      Returns:
      A hash code for these search terms.
    • equals

      public boolean equals(Object obj)
      Test whether the given object is equal to these SearchTerms. It will be if it is also a SearchTerms object that records a search for the same type of object as this; if it has the same number of parameters with the same names; and if all the values of the parameters are the same (order unimportant for parameters that are collections).
      Overrides:
      equals in class Object
      Parameters:
      obj - The object to compare to.
      Returns:
      True if this object is value equal to obj, false if not.
    • toString

      public String toString()
      Get a human readable representation of this object. Gives the type of objects being searched for and the parameters used in the search.
      Overrides:
      toString in class Object
      Returns:
      A printable representation of this object.