Class IllegalSearchTermException

All Implemented Interfaces:
Serializable

public class IllegalSearchTermException extends IllegalArgumentException
Exception raised when a search for entities is provided with search terms that are illegal. Terms can be illegal for a number of reasons:
  1. The term's value is null;
  2. The term's value is an empty collection or a zero length array;
  3. The term's value is a collection or an array containing a null.

It is important to not ignore missing values as the search will probably not run as intended. Typically it will return more results than one would expect, often drastically so. An example is searching for processes by input artifact ids: if the ids have been collected into a set but on a particular call that set is empty, then all processes ever run will be returned (if that term is just left out of the query, which is how the code worked before release 2.23). This is clearly not a good idea when the intention is to search for a small set.

It is still possible to use the find method with no search terms. In this case, the call is the same as ClarityAPI.listAll(Class).

Since:
2.23
See Also:
  • Constructor Details

    • IllegalSearchTermException

      public IllegalSearchTermException(String term, String message)
      Construct a new IllegalSearchTermException.
      Parameters:
      term - The search term that is in error.
      message - The message indicating why the term is in error.
  • Method Details

    • getSearchTerm

      public String getSearchTerm()
      Get the search term that caused the error.
      Returns:
      The search term.