mirror of
https://github.com/querydsl/querydsl.git
synced 2026-07-03 21:07:49 +08:00
added delegating methods for NumberExpression statics to MathExpressions
This commit is contained in:
parent
2f8d809537
commit
590ba60290
@ -19,6 +19,7 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
public class CollectionTest {
|
||||
|
||||
@ -46,7 +46,7 @@ public final class MathExpressions {
|
||||
public static <A extends Number & Comparable<?>> NumberExpression<Double> atan(Expression<A> num) {
|
||||
return NumberOperation.create(Double.class, Ops.MathOps.ATAN, num);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param num
|
||||
* @return cos(num)
|
||||
@ -112,6 +112,24 @@ public final class MathExpressions {
|
||||
return NumberOperation.create(Double.class, Ops.MathOps.LOG, num, ConstantImpl.create(base));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the greater of the given values
|
||||
*
|
||||
* @return max(left, right)
|
||||
*/
|
||||
public static <A extends Number & Comparable<?>> NumberExpression<A> max(Expression<A> left, Expression<A> right) {
|
||||
return NumberExpression.max(left, right);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the smaller of the given values
|
||||
*
|
||||
* @return min(left, right)
|
||||
*/
|
||||
public static <A extends Number & Comparable<?>> NumberExpression<A> min(Expression<A> left, Expression<A> right) {
|
||||
return NumberExpression.min(left, right);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param num
|
||||
* @param exponent
|
||||
@ -129,6 +147,14 @@ public final class MathExpressions {
|
||||
return NumberOperation.create(Double.class, Ops.MathOps.RAD, num);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the random expression
|
||||
* @return random()
|
||||
*/
|
||||
public static NumberExpression<Double> random(){
|
||||
return NumberExpression.random();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param num
|
||||
* @return sign(num)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user