Class RegexFilter<T,E>

Type Parameters:
T - the type of the input argument to the filter
E - the type of the extracted attribute to use for comparison
All Implemented Interfaces:
ExternalizableLite, PortableObject, Filter<T>, EntryFilter<Object,T>, IndexAwareFilter<Object,T>, QueryRecorderFilter<T>, Serializable

public class RegexFilter<T,E> extends ComparisonFilter<T,E,String>
Filter which uses the regular expression pattern match defined by the String.matches(String) contract. This implementation is not index aware and will not take advantage of existing indexes.
Since:
Coherence 3.6
Author:
gg 2010.05.02
See Also:
  • Constructor Details

    • RegexFilter

      public RegexFilter()
      Default constructor (necessary for the ExternalizableLite interface).
    • RegexFilter

      public RegexFilter(ValueExtractor<? super T,? extends E> extractor, String sRegex)
      Construct a RegexFilter for testing pattern matching.
      Parameters:
      extractor - the ValueExtractor to use by this filter
      sRegex - the regular expression to match the result with
    • RegexFilter

      public RegexFilter(String sMethod, String sRegex)
      Construct a RegexFilter for testing pattern matching.
      Parameters:
      sMethod - the name of the method to invoke via reflection
      sRegex - the regular expression to match the result with
  • Method Details

    • evaluateExtracted

      protected boolean evaluateExtracted(E extracted)
      Evaluate the specified extracted value.
      Specified by:
      evaluateExtracted in class ExtractorFilter<T,E>
      Parameters:
      extracted - an extracted value to evaluate
      Returns:
      true iff the test passes