org.kuali.rice.krms.impl.repository.mock
Class CriteriaMatcherInMemory<T>

java.lang.Object
  extended by org.kuali.rice.krms.impl.repository.mock.CriteriaMatcherInMemory<T>

public class CriteriaMatcherInMemory<T>
extends Object

A helper class for the Mock implementation to match criteria to values on the object

Author:
nwright

Constructor Summary
CriteriaMatcherInMemory()
           
 
Method Summary
protected static Object extractValue(String fieldPath, Object infoObject)
           
 Collection<T> findMatching(Collection<T> all)
          finds all of the supplied objects that match the specified criteria
 QueryByCriteria getCriteria()
           
 boolean matches(T infoObject)
          Checks if an object matches the criteria
protected  boolean matches(T infoObject, Predicate predicate)
          protected for testing
static boolean matchesEqual(Object dataValue, Object criteriaValue)
           
static boolean matchesGreaterThan(Object dataValue, Object criteriaValue)
           
static boolean matchesLessThan(Object dataValue, Object criteriaValue)
           
 boolean matchesLike(Object dataValue, Object criteriaValue)
           
static boolean matchesLike(String str, String expr)
          This was taken from http://stackoverflow.com/questions/898405/how-to-implement-a-sql-like-like-operator-in-java
 boolean matchesLikeCachingPattern(String str, String expr)
          this was taken from http://stackoverflow.com/questions/898405/how-to-implement-a-sql-like-like-operator-in-java
 void setCriteria(QueryByCriteria criteria)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CriteriaMatcherInMemory

public CriteriaMatcherInMemory()
Method Detail

getCriteria

public QueryByCriteria getCriteria()

setCriteria

public void setCriteria(QueryByCriteria criteria)

findMatching

public Collection<T> findMatching(Collection<T> all)
finds all of the supplied objects that match the specified criteria

Parameters:
all -
Returns:
filtered list

matches

public boolean matches(T infoObject)
Checks if an object matches the criteria

Parameters:
infoObject -
Returns:

matches

protected boolean matches(T infoObject,
                          Predicate predicate)
protected for testing


extractValue

protected static Object extractValue(String fieldPath,
                                     Object infoObject)

matchesEqual

public static boolean matchesEqual(Object dataValue,
                                   Object criteriaValue)

matchesLessThan

public static boolean matchesLessThan(Object dataValue,
                                      Object criteriaValue)

matchesGreaterThan

public static boolean matchesGreaterThan(Object dataValue,
                                         Object criteriaValue)

matchesLike

public boolean matchesLike(Object dataValue,
                           Object criteriaValue)

matchesLikeCachingPattern

public boolean matchesLikeCachingPattern(String str,
                                         String expr)
this was taken from http://stackoverflow.com/questions/898405/how-to-implement-a-sql-like-like-operator-in-java


matchesLike

public static boolean matchesLike(String str,
                                  String expr)
This was taken from http://stackoverflow.com/questions/898405/how-to-implement-a-sql-like-like-operator-in-java



Copyright © 2004-2013 The Kuali Foundation. All Rights Reserved.