Package net.sf.ehcache.search.expression
Class ILike
- java.lang.Object
-
- net.sf.ehcache.search.expression.BaseCriteria
-
- net.sf.ehcache.search.expression.ILike
-
- All Implemented Interfaces:
Criteria
public class ILike extends BaseCriteria
A regular expression criteria that matches attribute string values. For nonjava.lang.String attributes, thetoString()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)
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
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanexecute(Element e, java.util.Map<java.lang.String,AttributeExtractor> attributeExtractors)Test this criteria against a cache elementjava.lang.StringgetAttributeName()Return attribute name.java.util.Set<Attribute<?>>getAttributes()Returns all search attributes referenced by this instancejava.lang.StringgetRegex()Return regex string.-
Methods inherited from class net.sf.ehcache.search.expression.BaseCriteria
and, getExtractor, not, or
-
-
-
-
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 elementattributeExtractors- map of attribute extractors to attribute value names- Returns:
- true if the criteria matches this element
-
getAttributes
public java.util.Set<Attribute<?>> getAttributes()
Description copied from class:BaseCriteriaReturns all search attributes referenced by this instance- Specified by:
getAttributesin classBaseCriteria
-
-