T - The final type of the builder, used for a fluid chaining interface.public class QBuilder<T extends QBuilder<T>> extends Object implements Partial<T>
| Modifier and Type | Class and Description |
|---|---|
protected class |
QBuilder.ConditionDelegate
A delegate view of this builder that represents a logically complete condition.
|
| Modifier and Type | Field and Description |
|---|---|
protected LogicalNode |
current |
protected LogicalNode |
root |
| Constructor and Description |
|---|
QBuilder() |
| Modifier and Type | Method and Description |
|---|---|
Condition<T> |
and(Condition<T> c1,
Condition<T> c2,
Condition<T>... cn)
Allows for composing a list of conditions in a "all match" fashion.
|
Condition<T> |
and(List<Condition<T>> conditions)
Allows for composing a list of conditions in a "all match" fashion.
|
BooleanProperty<T> |
bool(String field)
For usage when the field is known to contain values of a boolean type.
|
protected Condition<T> |
condition(FieldPath field,
ComparisonOperator operator,
Collection<?> values)
Call this method to add a condition to the current logical node of the underlying query tree.
|
<S extends QBuilder<S>> |
condition(String field)
For usage when the field is a multivalued field of objects who themselves can
be tested against a condition.
|
DoubleProperty<T> |
doubleNum(String field)
For usage when the field is known to contain values of a numerical double type.
|
<S extends Enum<S>> |
enumeration(String field)
For usage when the field is known to contain values of an enum type.
|
FloatProperty<T> |
floatNum(String field)
For usage when the field is known to contain values of a numerical float type.
|
InstantProperty<T> |
instant(String field)
For usage when the field is known to contain values of a point-in-time type.
|
IntegerProperty<T> |
intNum(String field)
For usage when the field is known to contain values of an integer type.
|
LongProperty<T> |
longNum(String field)
For usage when the field is known to contain values of a long type.
|
Condition<T> |
or(Condition<T> c1,
Condition<T> c2,
Condition<T>... cn)
Allows for composing a list of conditions in a "any match" fashion.
|
Condition<T> |
or(List<Condition<T>> conditions)
Allows for composing a list of conditions in a "any match" fashion.
|
protected <S extends PropertyDelegate<T>,Q extends Property<T>> |
prop(String field,
Class<S> delegate,
Class<Q> inter) |
protected T |
self()
Since we have delegate classes that extend this class but not its potential end-user imposed subclasses
we instead pass the original instance of whatever the final QBuilder class is around as
a delegate which each view calls for any operations instead of calling 'this' thereby providing type safe
compatibility with extensions.
|
ShortProperty<T> |
shortNum(String field)
For usage when the field is known to contain values of a numerical short type.
|
StringProperty<T> |
string(String field)
For usage when the field is known to contain values of a string type.
|
protected LogicalNode root
protected LogicalNode current
public final <S extends Enum<S>> EnumProperty<T,S> enumeration(String field)
Partialenumeration in interface Partial<T extends QBuilder<T>>field - The name of the field.public final BooleanProperty<T> bool(String field)
Partialpublic final StringProperty<T> string(String field)
Partialpublic final ShortProperty<T> shortNum(String field)
Partialpublic final IntegerProperty<T> intNum(String field)
Partialpublic final LongProperty<T> longNum(String field)
Partialpublic final FloatProperty<T> floatNum(String field)
Partialpublic final DoubleProperty<T> doubleNum(String field)
Partialpublic final InstantProperty<T> instant(String field)
Partialpublic final <S extends QBuilder<S>> ConditionProperty<T,S> condition(String field)
Partialprotected final <S extends PropertyDelegate<T>,Q extends Property<T>> Q prop(String field, Class<S> delegate, Class<Q> inter)
@SafeVarargs public final Condition<T> and(Condition<T> c1, Condition<T> c2, Condition<T>... cn)
Partial@SafeVarargs public final Condition<T> or(Condition<T> c1, Condition<T> c2, Condition<T>... cn)
Partialpublic final Condition<T> and(List<Condition<T>> conditions)
Partialpublic final Condition<T> or(List<Condition<T>> conditions)
Partialprotected final Condition<T> condition(FieldPath field, ComparisonOperator operator, Collection<?> values)
field - The field that this condition belongs to.operator - The operator indicating how the values provided should be interpreted against the field.values - The values to use in the comparison against the value of the field.Condition that can be built into a query or logically composed into other conditions.protected T self()
Copyright © 2017. All rights reserved.