|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
RECORD
- The record typeT
- The field typepublic interface IdxField<RECORD,T>
An IdxField
is used to identify an indexable field relative to
a given RECORD type, and serves as a factory for Predicate
s against
the field value.
Nested Class Summary | |
---|---|
static class |
IdxField.KeyMapping<T>
|
Method Summary | |
---|---|
IdxField<RECORD,Double> |
average()
Create an aggregate field that average of non-null values for this field, null otherwise. |
Predicate<RECORD> |
between(T lowValue,
T highValue)
Constructs a 'between' predicate for this field. |
T |
convertToFieldType(Object value)
Attempts to convert the provided value to a type that is compatible with this field's type ( getFieldType() . |
IdxField<RECORD,Integer> |
count()
Create an aggregate field that counts the non-null occurances of this field. |
Predicate<RECORD> |
equal(T value)
Constructs an 'equals' predicate for this field. |
String |
getCanonicalName()
|
double |
getCost()
Return the cost of applying this field, normalized to the cost of retrieving the relevant record. |
String |
getFieldPath()
Gets the field's bean accessor path relative to this fields record type. |
Class<T> |
getFieldType()
Gets the type for this field. |
Class<?> |
getIndexKeyType()
Gets the type of the value being indexed (may be different from the field type in the presence of a IdxField.KeyMapping |
IdxField.KeyMapping<T> |
getKeyMapping()
Gets the key mapping assigned to this field. |
String |
getName()
Gets the name of this field. |
Class<? extends RECORD> |
getRecordType()
Gets the concrete type against which this field applies. |
Predicate<RECORD> |
getTypePredicate()
Returns a constraint against the type(s) that match the field's path. |
Predicate<RECORD> |
greaterThan(T value)
Constructs an 'greater than' predicate for this field. |
Predicate<RECORD> |
greaterThanOrEqual(T value)
Constructs an 'greater than or equal to' predicate for this field. |
Predicate<RECORD> |
in(Collection<T> values)
Constructs an 'in' predicate for this field. |
Predicate<RECORD> |
in(T... values)
Constructs an 'in' predicate for this field. |
Predicate<RECORD> |
is(T value)
Constructs an 'equals' predicate for this field. |
Predicate<RECORD> |
isNotNull()
Constructs an 'IS NOT NULL' predicate against this field |
Predicate<RECORD> |
isNull()
Constructs an 'IS NULL' predicate against this field |
boolean |
isQualified()
Indicate whether the field is qualified (e.g. |
Predicate<RECORD> |
lessThan(T value)
Constructs an 'less than' predicate for this field. |
Predicate<RECORD> |
lessThanOrEqual(T value)
Constructs an 'less than or equal to' predicate for this field. |
Predicate<RECORD> |
like(T value)
Constructs a 'like' predicatre for this field |
IdxField<RECORD,T> |
max()
Create an aggregate field that maximum non-null value of this field, null otherwise. |
IdxField<RECORD,T> |
min()
Create an aggregate field that minimum non-null value of this field, null otherwise. |
Predicate<RECORD> |
regexLike(T value)
Constructs a 'regex_like' predicatre for this field |
void |
setKeyMapping(IdxField.KeyMapping<T> keyMapping)
Assign a mapping from Field values their corresponding index keys. |
IdxField<RECORD,Double> |
sumDouble()
Create an aggregate field that sum of non-null values for this field, null otherwise. |
IdxField<RECORD,Long> |
sumLong()
Create an aggregate field that sum of non-null values for this field, null otherwise. |
void |
validateIndexable()
Validates that this field is indexable. |
Methods inherited from interface com.google.common.base.Function |
---|
apply, equals |
Method Detail |
---|
Predicate<RECORD> getTypePredicate()
Class<? extends RECORD> getRecordType()
Class<T> getFieldType()
String getName()
String getFieldPath()
Predicate<RECORD> equal(T value)
value
- The value to test against.
Predicate<RECORD> is(T value)
equal(Object)
, but provided for
greater fluency in query contsruction.
value
- The value to test against.
Predicate<RECORD> like(T value)
value
- The like mask to test against
Predicate<RECORD> regexLike(T value)
value
- The regex pattern to test against
Predicate<RECORD> greaterThan(T value)
value
- The value to test against.
Predicate<RECORD> greaterThanOrEqual(T value)
value
- The value to test against.
Predicate<RECORD> lessThan(T value)
value
- The value to test against.
Predicate<RECORD> lessThanOrEqual(T value)
value
- The value to test against.
Predicate<RECORD> between(T lowValue, T highValue)
lowValue
- The low value to test against.highValue
- The high value to test against.
Predicate<RECORD> in(Collection<T> values)
values
- The values to test agains.
Predicate<RECORD> in(T... values)
values
- The values to test agains.
Predicate<RECORD> isNull()
Predicate<RECORD> isNotNull()
T convertToFieldType(Object value) throws IllegalArgumentException
getFieldType()
.
value
- The value to convert
IllegalArgumentException
- if the type is not convertible.IdxField<RECORD,Integer> count()
IdxField<RECORD,T> min()
IdxField<RECORD,T> max()
IdxField<RECORD,Long> sumLong()
IdxField<RECORD,Double> sumDouble()
IdxField<RECORD,Double> average()
boolean isQualified()
String getCanonicalName()
void setKeyMapping(IdxField.KeyMapping<T> keyMapping)
keyMapping
- The key mapping to assign.IdxField.KeyMapping<T> getKeyMapping()
Class<?> getIndexKeyType()
IdxField.KeyMapping
void validateIndexable()
Exception
- If the field is not indexable.double getCost()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |