public final class ExpressionUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> Expression<T> |
all(CollectionExpression<?,? super T> col) |
static Predicate |
allOf(Collection<Predicate> exprs)
Create the intersection of the given arguments
|
static Predicate |
allOf(Predicate... exprs)
Create the intersection of the given arguments
|
static Predicate |
and(Predicate left,
Predicate right)
Create the intersection of the given arguments
|
static <T> Expression<T> |
any(CollectionExpression<?,? super T> col) |
static Predicate |
anyOf(Collection<Predicate> exprs)
Create the union of the given arguments
|
static Predicate |
anyOf(Predicate... exprs)
Create the union of the given arguments
|
static <D> Expression<D> |
as(Expression<D> source,
Path<D> alias)
Create an alias expression (source as alias) with the given source and alias
|
static <D> Expression<D> |
as(Expression<D> source,
String alias)
Create an alias expression (source as alias) with the given source and alias
|
static Expression<Long> |
count(Expression<?> source) |
static String |
createRootVariable(Path<?> path)
Create a new root variable based on the given path
|
static String |
createRootVariable(Path<?> path,
int suffix)
Create a new root variable based on the given path and suffix
|
static com.google.common.collect.ImmutableList<Expression<?>> |
distinctList(Expression<?>... args)
Get a distinct list of the given args
|
static com.google.common.collect.ImmutableList<Expression<?>> |
distinctList(Expression<?>[]... args)
Get a distinct list of the concatenated array contents
|
static <D> Predicate |
eq(Expression<D> left,
Expression<? extends D> right)
Create an left equals right expression
|
static <D> Predicate |
eqConst(Expression<D> left,
D constant)
Create an left equals constant expression
|
static <T> Expression<T> |
extract(Expression<T> expr)
Get the potentially wrapped expression
|
static <D> Predicate |
in(Expression<D> left,
Collection<? extends D> right)
Create an left in right expression
|
static <D> Predicate |
in(Expression<D> left,
CollectionExpression<?,? extends D> right)
Create an left in right expression
|
static <D> Predicate |
inAny(Expression<D> left,
Iterable<? extends Collection<? extends D>> lists)
Create a
left in right or... expression for each list |
static Predicate |
isNotNull(Expression<?> left)
Create a left is not null expression
|
static Predicate |
isNull(Expression<?> left)
Create a left is null expression
|
static Expression<String> |
likeToRegex(Expression<String> expr)
Convert the given like pattern to a regex pattern
|
static Expression<String> |
likeToRegex(Expression<String> expr,
boolean matchStartAndEnd) |
static <T> Expression<T> |
list(Class<T> clazz,
Expression<?>... exprs) |
static <T> Expression<T> |
list(Class<T> clazz,
List<? extends Expression<?>> exprs) |
static <D> Predicate |
ne(Expression<D> left,
Expression<? super D> right)
Create a left not equals right expression
|
static <D> Predicate |
neConst(Expression<D> left,
D constant)
Create a left not equals constant expression
|
static <D> Predicate |
notIn(Expression<D> left,
Collection<? extends D> right)
Create an left not in right expression
|
static <D> Predicate |
notIn(Expression<D> left,
CollectionExpression<?,? extends D> right)
Create an left not in right expression
|
static <D> Predicate |
notInAny(Expression<D> left,
Iterable<? extends Collection<? extends D>> lists)
Create a
left not in right and... expression for each list |
static <T> Operation<T> |
operation(Class<? extends T> type,
Operator<T> operator,
Expression<?>... args)
Create a new Operation expression
|
static <T> Operation<T> |
operation(Class<? extends T> type,
Operator<T> operator,
com.google.common.collect.ImmutableList<Expression<?>> args)
Create a new Operation expression
|
static Predicate |
or(Predicate left,
Predicate right)
Create a left or right expression
|
static Expression<?> |
orderBy(List<OrderSpecifier<?>> args)
Create an expression out of the given order specifiers
|
static <T> Path<T> |
path(Class<? extends T> type,
Path<?> parent,
String property)
Create a new Path expression
|
static <T> Path<T> |
path(Class<? extends T> type,
PathMetadata metadata)
Create a new Path expression
|
static <T> Path<T> |
path(Class<? extends T> type,
String variable)
Create a new Path expression
|
static PredicateOperation |
predicate(Operator<Boolean> operator,
Expression<?>... args)
Create a new Operation expression
|
static PredicateOperation |
predicate(Operator<Boolean> operator,
com.google.common.collect.ImmutableList<Expression<?>> args)
Create a new Operation expression
|
static PredicateTemplate |
predicateTemplate(String template,
com.google.common.collect.ImmutableList<?> args)
Create a new Template expression
|
static PredicateTemplate |
predicateTemplate(String template,
Object... args)
Create a new Template expression
|
static PredicateTemplate |
predicateTemplate(Template template,
com.google.common.collect.ImmutableList<?> args)
Create a new Template expression
|
static PredicateTemplate |
predicateTemplate(Template template,
Object... args)
Create a new Template expression
|
static Expression<String> |
regexToLike(Expression<String> expr) |
static <T> TemplateExpression<T> |
template(Class<? extends T> cl,
String template,
com.google.common.collect.ImmutableList<?> args)
Create a new Template expression
|
static <T> TemplateExpression<T> |
template(Class<? extends T> cl,
String template,
Object... args)
Create a new Template expression
|
static <T> TemplateExpression<T> |
template(Class<? extends T> cl,
Template template,
com.google.common.collect.ImmutableList<?> args)
Create a new Template expression
|
static <T> TemplateExpression<T> |
template(Class<? extends T> cl,
Template template,
Object... args)
Create a new Template expression
|
static Expression<?> |
toExpression(Object o)
Converts the given object to an Expression
|
static Expression<String> |
toLower(Expression<String> stringExpression)
Converts the given expression to lower(expression)
|
public static <T> Operation<T> operation(Class<? extends T> type, Operator<T> operator, Expression<?>... args)
type - type of expressionoperator - operatorargs - operation argumentspublic static <T> Operation<T> operation(Class<? extends T> type, Operator<T> operator, com.google.common.collect.ImmutableList<Expression<?>> args)
type - type of expressionoperator - operatorargs - operation argumentspublic static PredicateOperation predicate(Operator<Boolean> operator, Expression<?>... args)
operator - operatorargs - operation argumentspublic static PredicateOperation predicate(Operator<Boolean> operator, com.google.common.collect.ImmutableList<Expression<?>> args)
operator - operatorargs - operation argumentspublic static <T> Path<T> path(Class<? extends T> type, String variable)
type - type of expressionvariable - variable namepublic static <T> Path<T> path(Class<? extends T> type, Path<?> parent, String property)
type - type of expressionparent - parent pathproperty - property namepublic static <T> Path<T> path(Class<? extends T> type, PathMetadata metadata)
T - type of expressiontype - type of expressionmetadata - path metadatapublic static PredicateTemplate predicateTemplate(String template, Object... args)
template - templateargs - template parameterspublic static PredicateTemplate predicateTemplate(String template, com.google.common.collect.ImmutableList<?> args)
template - templateargs - template parameterspublic static PredicateTemplate predicateTemplate(Template template, Object... args)
template - templateargs - template parameterspublic static PredicateTemplate predicateTemplate(Template template, com.google.common.collect.ImmutableList<?> args)
template - templateargs - template parameterspublic static <T> TemplateExpression<T> template(Class<? extends T> cl, String template, Object... args)
cl - type of expressiontemplate - templateargs - template parameterspublic static <T> TemplateExpression<T> template(Class<? extends T> cl, String template, com.google.common.collect.ImmutableList<?> args)
cl - type of expressiontemplate - templateargs - template parameterspublic static <T> TemplateExpression<T> template(Class<? extends T> cl, Template template, Object... args)
cl - type of expressiontemplate - templateargs - template parameterspublic static <T> TemplateExpression<T> template(Class<? extends T> cl, Template template, com.google.common.collect.ImmutableList<?> args)
cl - type of expressiontemplate - templateargs - template parameterspublic static <T> Expression<T> all(CollectionExpression<?,? super T> col)
col - public static <T> Expression<T> any(CollectionExpression<?,? super T> col)
col - @Nullable public static Predicate allOf(Collection<Predicate> exprs)
exprs - @Nullable public static Predicate allOf(Predicate... exprs)
exprs - public static Predicate and(Predicate left, Predicate right)
left - right - @Nullable public static Predicate anyOf(Collection<Predicate> exprs)
exprs - @Nullable public static Predicate anyOf(Predicate... exprs)
exprs - public static <D> Expression<D> as(Expression<D> source, Path<D> alias)
D - source - alias - public static <D> Expression<D> as(Expression<D> source, String alias)
D - source - alias - public static Expression<Long> count(Expression<?> source)
source - public static <D> Predicate eqConst(Expression<D> left, D constant)
D - left - constant - public static <D> Predicate eq(Expression<D> left, Expression<? extends D> right)
D - left - right - public static <D> Predicate in(Expression<D> left, CollectionExpression<?,? extends D> right)
D - left - right - public static <D> Predicate in(Expression<D> left, Collection<? extends D> right)
D - left - right - public static <D> Predicate inAny(Expression<D> left, Iterable<? extends Collection<? extends D>> lists)
left in right or... expression for each listD - left - lists - left in right or... expressionpublic static Predicate isNull(Expression<?> left)
left - public static Predicate isNotNull(Expression<?> left)
left - public static Expression<String> likeToRegex(Expression<String> expr)
expr - public static Expression<String> likeToRegex(Expression<String> expr, boolean matchStartAndEnd)
public static <T> Expression<T> list(Class<T> clazz, Expression<?>... exprs)
exprs - public static <T> Expression<T> list(Class<T> clazz, List<? extends Expression<?>> exprs)
exprs - public static Expression<String> regexToLike(Expression<String> expr)
public static <D> Predicate neConst(Expression<D> left, D constant)
D - left - constant - public static <D> Predicate ne(Expression<D> left, Expression<? super D> right)
D - left - right - public static <D> Predicate notIn(Expression<D> left, CollectionExpression<?,? extends D> right)
D - left - right - public static <D> Predicate notIn(Expression<D> left, Collection<? extends D> right)
D - left - right - public static <D> Predicate notInAny(Expression<D> left, Iterable<? extends Collection<? extends D>> lists)
left not in right and... expression for each listD - left - lists - left not in right and... expressionpublic static Predicate or(Predicate left, Predicate right)
left - right - public static com.google.common.collect.ImmutableList<Expression<?>> distinctList(Expression<?>... args)
args - public static com.google.common.collect.ImmutableList<Expression<?>> distinctList(Expression<?>[]... args)
args - public static <T> Expression<T> extract(Expression<T> expr)
expr - public static String createRootVariable(Path<?> path)
path - public static String createRootVariable(Path<?> path, int suffix)
path - base pathsuffix - suffix for variable namepublic static Expression<?> toExpression(Object o)
o - public static Expression<String> toLower(Expression<String> stringExpression)
Constants are lower()ed at creation time
stringExpression - the string to lower()public static Expression<?> orderBy(List<OrderSpecifier<?>> args)
args - Copyright © 2007–2015 Querydsl. All rights reserved.