ehcache

net.sf.ehcache.search.expression
Class ILike

java.lang.Object
  extended by net.sf.ehcache.search.expression.BaseCriteria
      extended by 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 non java.lang.String attributes, the toString() form is used in the comparison.

Expressions are always case insensitive

The following special characters are supported:

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
ILike(String attributeName, String regex)
          Construct a "like" criteria for the given expression
 
Method Summary
 boolean execute(Element e, Map<String,AttributeExtractor> attributeExtractors)
          Test this criteria against a cache element
 String getAttributeName()
          Return attribute name.
 Set<Attribute<?>> getAttributes()
          Returns all search attributes referenced by this instance
 String getRegex()
          Return regex string.
 
Methods inherited from class net.sf.ehcache.search.expression.BaseCriteria
and, getExtractor, not, or
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ILike

public ILike(String attributeName,
             String regex)
Construct a "like" criteria for the given expression

Parameters:
attributeName - attribute name
regex - expression
Method Detail

getAttributeName

public String getAttributeName()
Return attribute name.

Returns:
String attribute name

getRegex

public String getRegex()
Return regex string.

Returns:
String regex.

execute

public boolean execute(Element e,
                       Map<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

getAttributes

public Set<Attribute<?>> getAttributes()
Description copied from class: BaseCriteria
Returns all search attributes referenced by this instance

Specified by:
getAttributes in class BaseCriteria

ehcache

Copyright 2001-2016, Terracotta, Inc.