.. java:import:: org.joda.time DateTime .. java:import:: org.motechproject.commons.api Range .. java:import:: org.motechproject.email.domain DeliveryStatus .. java:import:: org.motechproject.mds.query QueryParams .. java:import:: java.util Arrays .. java:import:: java.util HashSet .. java:import:: java.util Set EmailRecordSearchCriteria ========================= .. java:package:: org.motechproject.email.builder :noindex: .. java:type:: public class EmailRecordSearchCriteria The \ ``EmailRecordSearchCriteria``\ class represents search criteria that may be used for searching \ :java:ref:`org.motechproject.email.domain.EmailRecord`\ entities in Motech Data Services. A consumer of this class may create search criteria to query on multiple fields by calling several of the with* methods. To perform the search, use \ :java:ref:`org.motechproject.email.service.EmailAuditService.findEmailRecords(EmailRecordSearchCriteria)`\ . Methods ------- getDeliveryStatuses ^^^^^^^^^^^^^^^^^^^ .. java:method:: public Set getDeliveryStatuses() :outertype: EmailRecordSearchCriteria Gets the delivery statuses criterion. :return: the delivery statuses criterion for this search criteria getDeliveryTimeRange ^^^^^^^^^^^^^^^^^^^^ .. java:method:: public Range getDeliveryTimeRange() :outertype: EmailRecordSearchCriteria Gets the delivery time range criterion. :return: the deliveryTimeRange criterion for this search criteria getFromAddress ^^^^^^^^^^^^^^ .. java:method:: public String getFromAddress() :outertype: EmailRecordSearchCriteria Gets the from address criterion. :return: the fromAddress criterion for this search criteria getMessage ^^^^^^^^^^ .. java:method:: public String getMessage() :outertype: EmailRecordSearchCriteria Gets the message body criterion. :return: the message criterion for this search criteria getQueryParams ^^^^^^^^^^^^^^ .. java:method:: public QueryParams getQueryParams() :outertype: EmailRecordSearchCriteria Gets the query paramaters that are used for controlling order and size of the query results for this search criteria. :return: the query params for this search criteria getSubject ^^^^^^^^^^ .. java:method:: public String getSubject() :outertype: EmailRecordSearchCriteria Gets the subject criterion. :return: the subject criterion for this search criteria getToAddress ^^^^^^^^^^^^ .. java:method:: public String getToAddress() :outertype: EmailRecordSearchCriteria Gets the to address criterion. :return: the toAddress criterion for this search criteria withDeliveryStatuses ^^^^^^^^^^^^^^^^^^^^ .. java:method:: public EmailRecordSearchCriteria withDeliveryStatuses(Set deliveryStatuses) :outertype: EmailRecordSearchCriteria Sets the delivery statuses criterion to the set specified :param deliveryStatuses: the delivery statuses on which to search :return: this \ ``EmailRecordSearchCriteria``\ with its deliveryStatuses criterion set to the provided statuses withDeliveryStatuses ^^^^^^^^^^^^^^^^^^^^ .. java:method:: public EmailRecordSearchCriteria withDeliveryStatuses(DeliveryStatus... deliveryStatuses) :outertype: EmailRecordSearchCriteria Sets the delivery statuses criterion to the set specified :param deliveryStatuses: the delivery statuses on which to search :return: this \ ``EmailRecordSearchCriteria``\ with its deliveryStatuses criterion set to the provided statuses withFromAddress ^^^^^^^^^^^^^^^ .. java:method:: public EmailRecordSearchCriteria withFromAddress(String fromAddress) :outertype: EmailRecordSearchCriteria Sets the fromAddress criterion to the address specified :param fromAddress: the sender email address on which to search :return: this \ ``EmailRecordSearchCriteria``\ with its fromAddress criterion set to the provided address withMessage ^^^^^^^^^^^ .. java:method:: public EmailRecordSearchCriteria withMessage(String message) :outertype: EmailRecordSearchCriteria Sets the message criterion to the message specified :param message: the email message body on which to search :return: this \ ``EmailRecordSearchCriteria``\ with its message criterion set to the provided message withMessageTime ^^^^^^^^^^^^^^^ .. java:method:: public EmailRecordSearchCriteria withMessageTime(DateTime deliveryTimeRange) :outertype: EmailRecordSearchCriteria Sets the send time criterion to the time specified. Use this method to search on a specific date/time; if a range is needed, use \ ``withMessageTimeRange``\ instead. :param deliveryTimeRange: the specific time on which to search :return: this \ ``EmailRecordSearchCriteria``\ with its deliveryTimeRange criterion set to the specified date/time withMessageTimeRange ^^^^^^^^^^^^^^^^^^^^ .. java:method:: public EmailRecordSearchCriteria withMessageTimeRange(Range deliveryTimeRange) :outertype: EmailRecordSearchCriteria Sets the sent time criterion to the range specified. Use this method to search on a time range; if searching on a specific date/time is needed, use \ ``withMessageTime``\ instead. :param deliveryTimeRange: the date/time range on which to search :return: this \ ``EmailRecordSearchCriteria``\ with its deliveryTimeRange criterion set to the specified date/time range withQueryParams ^^^^^^^^^^^^^^^ .. java:method:: public EmailRecordSearchCriteria withQueryParams(QueryParams queryParams) :outertype: EmailRecordSearchCriteria Sets the queryParams of the search criteria to the parameters specified. Use this method when it is necessary to specify order and size of query results. This is used mainly for paging/ordering queries from the UI. :param queryParams: the query parameters to include with the search criteria :return: this \ ``EmailRecordSearchCriteria``\ with its queryParams set to the provided parameters withSubject ^^^^^^^^^^^ .. java:method:: public EmailRecordSearchCriteria withSubject(String subject) :outertype: EmailRecordSearchCriteria Sets the subject criterion to the subject specified :param subject: the subject on which to search :return: this \ ``EmailRecordSearchCriteria``\ with its subject criterion set to the provided subject withToAddress ^^^^^^^^^^^^^ .. java:method:: public EmailRecordSearchCriteria withToAddress(String toAddress) :outertype: EmailRecordSearchCriteria Sets the toAddress criterion to the address specified :param toAddress: the recipient email address on which to search :return: this \ ``EmailRecordSearchCriteria``\ with its toAddress criterion set to the provided address