Class SimpleStringFilter

  • All Implemented Interfaces:
    Container.Filter, Serializable

    @Deprecated
    public final class SimpleStringFilter
    extends Object
    implements Container.Filter
    Deprecated.
    As of 8.0, the whole filtering feature is integrated into DataProvider. For in-memory case (ListDataProvider), use predicates as filters. For back-end DataProviders, filters are specific to the implementation.
    Simple string filter for matching items that start with or contain a specified string. The matching can be case-sensitive or case-insensitive. This filter also directly supports in-memory filtering. When performing in-memory filtering, values of other types are converted using toString(), but other (lazy container) implementations do not need to perform such conversions and might not support values of different types. Note that this filter is modeled after the pre-6.6 filtering mechanisms, and might not be very efficient e.g. for database filtering. TODO this might still change
    Since:
    6.6
    See Also:
    Serialized Form
    • Constructor Detail

      • SimpleStringFilter

        public SimpleStringFilter​(Object propertyId,
                                  String filterString,
                                  boolean ignoreCase,
                                  boolean onlyMatchPrefix)
        Deprecated.
    • Method Detail

      • passesFilter

        public boolean passesFilter​(Object itemId,
                                    Item item)
        Deprecated.
        Description copied from interface: Container.Filter
        Check if an item passes the filter (in-memory filtering).
        Specified by:
        passesFilter in interface Container.Filter
        Parameters:
        itemId - identifier of the item being filtered; may be null when the item is being added to the container
        item - the item being filtered
        Returns:
        true if the item is accepted by this filter
      • appliesToProperty

        public boolean appliesToProperty​(Object propertyId)
        Deprecated.
        Description copied from interface: Container.Filter
        Check if a change in the value of a property can affect the filtering result. May always return true, at the cost of performance. If the filter cannot determine whether it may depend on the property or not, should return true.
        Specified by:
        appliesToProperty in interface Container.Filter
        Returns:
        true if the filtering result may/does change based on changes to the property identified by propertyId
      • equals

        public boolean equals​(Object obj)
        Deprecated.
        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Deprecated.
        Overrides:
        hashCode in class Object
      • getPropertyId

        public Object getPropertyId()
        Deprecated.
        Returns the property identifier to which this filter applies.
        Returns:
        property id
      • getFilterString

        public String getFilterString()
        Deprecated.
        Returns the filter string. Note: this method is intended only for implementations of lazy string filters and may change in the future.
        Returns:
        filter string given to the constructor
      • isIgnoreCase

        public boolean isIgnoreCase()
        Deprecated.
        Returns whether the filter is case-insensitive or case-sensitive. Note: this method is intended only for implementations of lazy string filters and may change in the future.
        Returns:
        true if performing case-insensitive filtering, false for case-sensitive
      • isOnlyMatchPrefix

        public boolean isOnlyMatchPrefix()
        Deprecated.
        Returns true if the filter only applies to the beginning of the value string, false for any location in the value. Note: this method is intended only for implementations of lazy string filters and may change in the future.
        Returns:
        true if checking for matches at the beginning of the value only, false if matching any part of value