com.dooapp.gaedo.finders.collections.GreaterThanEvaluator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gaedo-collections Show documentation
Show all versions of gaedo-collections Show documentation
Contains the collections implementation, and only depend upon gaedo-definition
package com.dooapp.gaedo.finders.collections;
import java.lang.reflect.Field;
import com.dooapp.gaedo.properties.Property;
/**
* This evaluator uses non-typesafe Comparable interfaces, since the type has already been ensured elsewhere.
* @author ndx
*
* @param
*/
@SuppressWarnings("unchecked")
public class GreaterThanEvaluator extends
AbstractBasicEvaluator implements Evaluator {
private boolean strictly;
private Comparable value;
public GreaterThanEvaluator(Property fieldName, boolean strictly, Comparable value) {
super(fieldName);
this.strictly = strictly;
this.value = value;
}
public boolean matches(DataType element) {
Comparable fieldValue = (Comparable>) getValue(element);
return strictly ? fieldValue.compareTo(value)>0 : fieldValue.compareTo(value)>=0;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy