Class ILike

  • All Implemented Interfaces:
    Criteria

    public class ILike
    extends BaseCriteria
    A regular expression criteria that matches attribute string values. For non java.lang.String attributes, the toString() form is used in the comparison.

    Expressions are always case insensitive

    The following special characters are supported:
    • '?' - match any one single character
    • '*' - match any multiple character(s) (including zero)
    The supported wildcard characters can be escaped with a backslash '\', and a literal backslash can be included with '\\'

    WARN: Expressions starting with a leading wildcard character are potentially very expensive (ie. full scan) for indexed caches

    Author:
    teck
    • Constructor Summary

      Constructors 
      Constructor Description
      ILike​(java.lang.String attributeName, java.lang.String regex)
      Construct a "like" criteria for the given expression
    • Constructor Detail

      • ILike

        public ILike​(java.lang.String attributeName,
                     java.lang.String regex)
        Construct a "like" criteria for the given expression
        Parameters:
        attributeName - attribute name
        regex - expression
    • Method Detail

      • getAttributeName

        public java.lang.String getAttributeName()
        Return attribute name.
        Returns:
        String attribute name
      • getRegex

        public java.lang.String getRegex()
        Return regex string.
        Returns:
        String regex.
      • execute

        public boolean execute​(Element e,
                               java.util.Map<java.lang.String,​AttributeExtractor> attributeExtractors)
        Test this criteria against a cache element
        Parameters:
        e - cache element
        attributeExtractors - map of attribute extractors to attribute value names
        Returns:
        true if the criteria matches this element