Class AlertQueryBuilder


  • public class AlertQueryBuilder
    extends java.lang.Object
    Helper to query Alerts.
    Since:
    jcms-10.0
    Version:
    $Revision: 114560 $
    Author:
    Sylvain Devaux
    • Field Detail

      • RECIPIENT_EXCEPTION_EXPECTED_MESSAGE

        protected static final java.lang.String RECIPIENT_EXCEPTION_EXPECTED_MESSAGE
        See Also:
        Constant Field Values
    • Constructor Detail

      • AlertQueryBuilder

        public AlertQueryBuilder()
    • Method Detail

      • getResultsCount

        public int getResultsCount()
        Count (without sorting and first/max criteria for performance reason)
        Returns:
        results count for current user filters
        Throws:
        java.lang.IllegalArgumentException - if recipient is null
      • getResults

        public PageResult<Alert> getResults()
        Returns alert paginated result
        Returns:
        results as a PageResult of Alert
        Throws:
        java.lang.IllegalArgumentException - if recipient is null
      • endDate

        public AlertQueryBuilder endDate​(java.util.Date endDate)
        Sets the endDate to filter on current AlertQueryBuilder
        Parameters:
        endDate - the Date
        Returns:
        a reference to this object
      • endDate

        public AlertQueryBuilder endDate​(java.util.Calendar endCal)
        Sets the endDate to filter on current AlertQueryBuilder
        Parameters:
        endCal - the Calendar
        Returns:
        a reference to this object
      • startDate

        public AlertQueryBuilder startDate​(java.util.Date startDate)
        Sets the startDate to filter on current AlertQueryBuilder
        Parameters:
        startDate - the Date
        Returns:
        a reference to this object
      • startDate

        public AlertQueryBuilder startDate​(java.util.Calendar startCal)
        Sets the startDate to filter on current AlertQueryBuilder
        Parameters:
        startCal - the Calendar
        Returns:
        a reference to this object
      • pagerParams

        public void pagerParams​(PagerParams pagerParams)
      • sort

        public AlertQueryBuilder sort​(java.lang.String sort)
        Sets the sort on current AlertQueryBuilder
        Parameters:
        sort - the chosen sort on current AlertQueryBuilder
        Returns:
        a reference to this object
      • reverse

        public AlertQueryBuilder reverse​(boolean reverse)
        Defines if results have to be reversed on current AlertQueryBuilder
        Parameters:
        reverse - if true results order will be reversed
        Returns:
        a reference to this object
      • start

        public AlertQueryBuilder start​(int start)
        Sets the start (Index) on current AlertQueryBuilder
        Parameters:
        start - the first index
        Returns:
        a reference to this object
      • pageSize

        public AlertQueryBuilder pageSize​(int pageSize)
        Sets the page size on current AlertQueryBuilder
        Parameters:
        pageSize - the page size for returned PageResult
        Returns:
        a reference to this object
      • pagerAll

        public AlertQueryBuilder pagerAll​(boolean pagerAll)
        Defines if all results should be displayed for current AlertQueryBuilder
        Parameters:
        pagerAll - if true all results will be displayed
        Returns:
        a reference to this object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object