Class AbstractFilter

    • Constructor Detail

      • AbstractFilter

        public AbstractFilter()
    • Method Detail

      • and

        public And and()
        Wraps the filter in an And filter (if not already present)
        Returns:
      • and

        public And and​(Collection<Filter> filters)
        Constructs a filter that is a conjunction of the provided filters
        Parameters:
        filters -
        Returns:
      • and

        public And and​(Filter... filters)
        Constructs a filter that is a conjunction of the provided filters
        Parameters:
        filters -
        Returns:
      • applyFilter

        public <T> List<T> applyFilter​(Collection<T> collection)
        Applies the filter to a collection of objects and returns those that match the filter
        Specified by:
        applyFilter in interface Filter
        Parameters:
        collection - the collection to apply the filter to
      • between

        public AbstractJunctionFilter between​(String propertyId,
                                              Comparable<?> startValue,
                                              Comparable<?> endValue)
        Constructs a "between" for the provided property
        Parameters:
        propertyId - the property
        startValue - the start value (inclusive)
        endValue - the end value (inclusive)
        Returns:
      • getProperty

        protected Object getProperty​(Object bean,
                                     String propertyName)
        Get the value of a property of the given bean by use of optimized reflection by Spring.
        Parameters:
        bean - The bean
        propertyName - The name of the property to get
        Returns:
        The property value
      • greater

        public AbstractJunctionFilter greater​(String propertyId,
                                              Object value)
        Constructs an "greater than" filter for a property
        Parameters:
        propertyId - the property
        value - the value to compare to
        Returns:
      • greaterOrEqual

        public AbstractJunctionFilter greaterOrEqual​(String propertyId,
                                                     Object value)
        Constructs an "greater or equals" filter for a property
        Parameters:
        propertyId - the property
        value - the value to compare to
        Returns:
      • isEqual

        public AbstractJunctionFilter isEqual​(String propertyId,
                                              Object value)
        Constructs an "equals" filter
        Parameters:
        propertyId - the property
        value - the value to compare to
        Returns:
      • isNull

        public AbstractJunctionFilter isNull​(String propertyId)
        Constructs a "isNull" filter for a property
        Parameters:
        propertyId - the property
        Returns:
      • lessOrEqual

        public AbstractJunctionFilter lessOrEqual​(String propertyId,
                                                  Object value)
        Constructs a "less or equal" filter
        Parameters:
        propertyId -
        value -
        Returns:
      • like

        public AbstractJunctionFilter like​(String propertyId,
                                           String value,
                                           boolean caseSensitive)
        Constructs a "like" filter for string comparison
        Parameters:
        propertyId -
        value -
        caseSensitive -
        Returns:
      • or

        public Or or()
        Wraps the filter in an Or filter (if not already present)
        Returns:
      • or

        public Or or​(Collection<Filter> filters)
        Constructs a filter that is a disjunction of the provided filters
        Parameters:
        filters -
        Returns:
      • or

        public Or or​(Filter... filters)
        Constructs a filter that is a disjunction of the provided filters
        Parameters:
        filters -
        Returns: