Commit cbc79dcd authored by Matija Obreza's avatar Matija Obreza
Browse files

Properly typed NumberFilter

parent 131c2065
......@@ -21,33 +21,33 @@ import com.querydsl.core.types.dsl.NumberPath;
/**
* Utility filtering for numeric types. Matches all constraints.
*/
public class NumberFilter {
public class NumberFilter<T extends Number & Comparable<?>> {
/**
* Equal
*/
public Double eq;
public T eq;
/**
* Greater than
*/
public Double gt;
public T gt;
/**
* Greater than or equal
*/
public Double ge;
public T ge;
/**
* Less than
*/
public Double lt;
public T lt;
/**
* Less than or equal
*/
public Double le;
public T le;
public BooleanBuilder buildQuery(final NumberPath<Double> val) {
public BooleanBuilder buildQuery(final NumberPath<T> val) {
final BooleanBuilder and = new BooleanBuilder();
if (eq != null) {
and.and(val.eq(eq));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment