net.anotheria.anodoc.query2.QueryStartsWithProperty Maven / Gradle / Ivy
package net.anotheria.anodoc.query2;
/**
* QueryStartsWithProperty class.
*
* @author another
* @version $Id: $Id
*/
public class QueryStartsWithProperty extends QueryProperty{
/**
* Constructor for QueryStartsWithProperty.
*
* @param aName a {@link java.lang.String} object.
* @param aValue a {@link java.lang.Object} object.
*/
public QueryStartsWithProperty(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().startsWith(getOriginalValue().toString());
}
}