net.anotheria.anodoc.query2.QueryLikeProperty Maven / Gradle / Ivy
package net.anotheria.anodoc.query2;
/**
* QueryLikeProperty class.
*
* @author another
* @version $Id: $Id
*/
public class QueryLikeProperty extends QueryProperty{
/**
* Constructor for QueryLikeProperty.
*
* @param aName a {@link java.lang.String} object.
* @param aValue a {@link java.lang.Object} object.
*/
public QueryLikeProperty(String aName, Object aValue){
super(aName, aValue);
}
/**
* getComparator.
*
* @return a {@link java.lang.String} object.
*/
public String getComparator(){
return " like ";
}
/** {@inheritDoc} */
@Override
public Object getValue() {
return "%"+super.getValue()+"%";
}
/** {@inheritDoc} */
public boolean doesMatch(Object o){
return o== null ?getOriginalValue() == null :
o.toString().indexOf(getOriginalValue().toString()) != -1;
}
}