package gw.search uses gw.api.util.DisplayableException uses java.io.Serializable /** * Abstract class defining a search criteria used for searching objects that aren't Guidewire entities in the UI. */ @ReadOnly abstract class SearchCriteria implements Serializable { /** * Return true if this search criteria has enough information to execute a search. */ abstract protected property get HasMinimumSearchCriteria() : boolean /** * Message to throw in a DisplayableException if this search criteria doesn't have enough information. */ abstract protected property get MinimumSearchCriteriaMessage() : String /** * Execute a search for this search criteria and return the result. */ abstract protected function doSearch() : T[] /** * Throw the MinimumSearchCriteriaMessage as a DisplayableException if * this search criteria doesn't have enough information. Otherwise * execute the search and return the result. */ final function performSearch() : T[] { if (HasMinimumSearchCriteria) { return doSearch() } throw new DisplayableException(MinimumSearchCriteriaMessage) } }