public class ERXQ extends Object
EOQualifier qualifier = new ERXAndQualifier( new NSArray(new Object[] { new ERXKeyValueQualifier("name", EOQualifier.QualifierOperatorsEquals, "Mike"), new ERXKeyValueQualifier("admin", EOQualifier.QualifierOperatorsEquals, Boolean.TRUE) }));
... becomes ...
EOQualifier qualifier = ERXQ.and(ERXQ.equals("name", "Mike"), ERXQ.isTrue("admin"));
Modifier and Type | Field and Description |
---|---|
static com.webobjects.foundation.NSSelector |
CONTAINS
Equivalent to EOQualifier.QualifierOperatorContains
|
static com.webobjects.foundation.NSSelector |
EQ
Equivalent to EOQualifier.QualifierOperatorEqual
|
static com.webobjects.foundation.NSSelector |
GT
Equivalent to EOQualifier.QualifierOperatorGreaterThan
|
static com.webobjects.foundation.NSSelector |
GTEQ
Equivalent to EOQualifier.QualifierOperatorGreaterThanOrEqualTo
|
static com.webobjects.foundation.NSSelector |
ILIKE
Equivalent to EOQualifier.QualifierOperatorCaseInsensitiveLike
|
static com.webobjects.foundation.NSSelector |
LIKE
Equivalent to EOQualifier.QualifierOperatorLike
|
static com.webobjects.foundation.NSSelector |
LT
Equivalent to EOQualifier.QualifierOperatorLessThan
|
static com.webobjects.foundation.NSSelector |
LTEQ
Equivalent to EOQualifier.QualifierOperatorLessThanOrEqualTo
|
static com.webobjects.foundation.NSSelector |
NE
Equivalent to EOQualifier.QualifierOperatorNotEqual
|
Constructor and Description |
---|
ERXQ() |
Modifier and Type | Method and Description |
---|---|
static ERXAndQualifier |
and(com.webobjects.eocontrol.EOQualifier... qualifiersArray)
Equivalent to new ERXAndQualifier(new NSArray(qualifiersArray).
|
static ERXAndQualifier |
and(NSArray<? extends com.webobjects.eocontrol.EOQualifier> qualifiers)
Equivalent to new ERXAndQualifier(new NSArray(qualifiersArray).
|
static com.webobjects.eocontrol.EOQualifier |
between(String key,
Object lowerBound,
Object upperBound)
Equivalent to key > lowerBound and key < upperBound (exclusive).
|
static com.webobjects.eocontrol.EOQualifier |
between(String key,
Object lowerBound,
Object upperBound,
boolean inclusive)
Equivalent to key >= lowerBound and key <= upperBound (inclusive).
|
static ERXKeyValueQualifier |
compare(String key,
com.webobjects.foundation.NSSelector operator,
Object value)
Equivalent to new ERXKeyValueQualifier(key, operator, value);
|
static ERXKeyValueQualifier |
contains(String key,
String value)
Equivalent to new ERXKeyValueQualifier(key,
EOQualifier.OperatorCaseInsensitiveLike, "*" + value + "*").
|
static ERXOrQualifier |
containsAll(NSArray<String> keys,
String tokensWithWhitespace)
Returns a qualifier that evalutes to true when the value of any of the
given keys contains all of the given tokens (insensitively) in the search
string.
|
static ERXAndQualifier |
containsAll(String key,
String tokensWithWhitespace)
Returns a qualifier that evalutes to true when the value of the given key
contains all of the given tokens (insensitively) in the search string.
|
static ERXAndQualifier |
containsAll(String key,
String[] tokens)
Returns a qualifier that evalutes to true when the value of the given key
contains all of the given tokens (insensitively).
|
static ERXAndQualifier |
containsAllInAny(String[] keys,
String tokensWithWhitespace)
Returns a qualifier that evaluates to true when all values in the given
tokens are found when searching across any of the keypaths.
|
static ERXAndQualifier |
containsAllInAny(String[] keys,
String[] tokens)
Returns a qualifier that evaluates to true when all values in the given
tokens are found when searching across any of the keypaths.
|
static ERXOrQualifier |
containsAny(NSArray<String> keys,
String tokensWithWhitespace)
Returns a qualifier that evalutes to true when the value of any of the
given keys contains any of the given tokens (insensitively) in the search
string.
|
static ERXOrQualifier |
containsAny(String key,
String tokensWithWhitespace)
Returns a qualifier that evalutes to true when the value of the given key
contains any of the given tokens (insensitively) in the search string.
|
static ERXOrQualifier |
containsAny(String key,
String[] tokens)
Returns a qualifier that evalutes to true when the value of the given key
contains any of the given tokens (insensitively).
|
static ERXKeyValueQualifier |
containsObject(String key,
Object value)
Equivalent to new ERXKeyValueQualifier(key, EOQualifier.OperatorContains,
value).
|
static ERXKeyValueQualifier |
endsWith(String key,
String value)
Equivalent to new ERXKeyValueQualifier(key,
EOQualifier.OperatorLike, "*" + value).
|
static ERXKeyValueQualifier |
endsWithInsensitive(String key,
String value)
Equivalent to new ERXKeyValueQualifier(key,
EOQualifier.OperatorCaseInsensitiveLike, "*" + value).
|
static <T> ERXKeyComparisonQualifier |
equals(ERXKey<T> key,
ERXKey<T> value)
Equivalent to new ERXKeyComparisonQualifier(key,
EOQualifier.QualifierOperatorEqual, value);
|
static ERXKeyValueQualifier |
equals(String key,
Object value)
Equivalent to new ERXKeyValueQualifier(key,
EOQualifier.QualifierOperatorEqual, value);
|
static NSArray<com.webobjects.eocontrol.EOKeyValueQualifier> |
extractKeyValueQualifiers(com.webobjects.eocontrol.EOQualifier qualifier)
Analyzes the given qualifier and returns all found
EOKeyValueQualifier objects
contained within. |
static void |
filter(NSMutableArray<?> array,
com.webobjects.eocontrol.EOQualifier qualifier)
Equivalent to EOQualifier.filterArrayWithQualifier(NSMutableArray,
EOQualifier)
|
static <T> NSArray<T> |
filtered(NSArray<T> array,
com.webobjects.eocontrol.EOQualifier qualifier)
Equivalent to EOQualifier.filteredArrayWithQualifier(NSArray,
EOQualifier)
|
static <T> T |
first(NSArray<T> array,
com.webobjects.eocontrol.EOQualifier qualifier)
Returns the first object that matches the qualifier in the given array
(or null if there is no match).
|
static <T> ERXKeyComparisonQualifier |
greaterThan(ERXKey<T> key,
ERXKey<T> value)
Equivalent to new ERXKeyComparisonQualifier(key,
EOQualifier.QualifierOperatorGreaterThan, value);
|
static ERXKeyValueQualifier |
greaterThan(String key,
Object value)
Equivalent to new ERXKeyValueQualifier(key,
EOQualifier.QualifierOperatorGreaterThan, value);
|
static <T> ERXKeyComparisonQualifier |
greaterThanOrEqualTo(ERXKey<T> key,
ERXKey<T> value)
Equivalent to new ERXKeyComparisonQualifier(key,
EOQualifier.QualifierOperatorGreaterThanOrEqualTo, value);
|
static ERXKeyValueQualifier |
greaterThanOrEqualTo(String key,
Object value)
Equivalent to new ERXKeyValueQualifier(key,
EOQualifier.QualifierOperatorGreaterThanOrEqualTo, value);
|
static ERXKeyValueQualifier |
has(String key,
NSArray values)
Equivalent to new ERXToManyQualifier(key, values);
|
static ERXKeyValueQualifier |
hasAtLeast(String key,
NSArray values,
int min)
Equivalent to new ERXToManyQualifier(key, values);
|
static ERXKeyValueQualifier |
hasValues(String key,
NSArray values)
Equivalent to new ERXInQualifier(key, values);
|
static ERXOrQualifier |
in(String key,
NSArray<?> values)
Equivalent to a new ERXOrQualifier of EOKeyValueQualifier with key equals
value for each value.
|
static ERXOrQualifier |
inObjects(String key,
Object... values)
Equivalent to a new ERXOrQualifier of EOKeyValueQualifier with key equals
value for each value.
|
static com.webobjects.eocontrol.EOQualifier |
is(ERXGenericRecord value)
Return an identity qualifier to use with ERXExistsQualifier for example
|
static ERXKeyValueQualifier |
is(String key,
Object value)
Equivalent to new ERXKeyValueQualifier(key,
EOQualifier.QualifierOperatorEqual, value);
|
static ERXKeyValueQualifier |
isFalse(String key)
Equivalent to new ERXKeyValueQualifier(key,
EOQualifier.QualifierOperatorEqual, Boolean.FALSE);
|
static com.webobjects.eocontrol.EOQualifier |
isIn(NSArray<? extends ERXGenericRecord> valueArray)
Return a OR qualifier of identity qualifiers using each value from the param array
|
static ERXKeyValueQualifier |
isNotNull(String key)
Equivalent to new ERXKeyValueQualifier(key,
EOQualifier.QualifierOperatorNotEqual, null);
|
static ERXKeyValueQualifier |
isNull(String key)
Equivalent to new ERXKeyValueQualifier(key,
EOQualifier.QualifierOperatorEqual, null);
|
static ERXKeyValueQualifier |
isNull(String key,
boolean yesOrNo)
Returns isNull or isNotNull depending on the value of yesOrNo.
|
static ERXKeyValueQualifier |
isTrue(String key)
Equivalent to new ERXKeyValueQualifier(key,
EOQualifier.QualifierOperatorEqual, Boolean.TRUE);
|
static String |
keyPath(String... elements)
Generates a key path from a var args list of strings.
|
static <T> ERXKeyComparisonQualifier |
lessThan(ERXKey<T> key,
ERXKey<T> value)
Equivalent to new ERXKeyComparisonQualifier(key,
EOQualifier.QualifierOperatorLessThan, value);
|
static ERXKeyValueQualifier |
lessThan(String key,
Object value)
Equivalent to new ERXKeyValueQualifier(key,
EOQualifier.QualifierOperatorLessThan, value);
|
static <T> ERXKeyComparisonQualifier |
lessThanOrEqualTo(ERXKey<T> key,
ERXKey<T> value)
Equivalent to new ERXKeyComparisonQualifier(key,
EOQualifier.QualifierOperatorLessThanOrEqualTo, value);
|
static ERXKeyValueQualifier |
lessThanOrEqualTo(String key,
Object value)
Equivalent to new ERXKeyValueQualifier(key,
EOQualifier.QualifierOperatorLessThanOrEqualTo, value);
|
static ERXKeyValueQualifier |
like(String key,
Object value)
Equivalent to new ERXKeyValueQualifier(key,
EOQualifier.QualifierOperatorLike, value);
|
static ERXKeyValueQualifier |
likeInsensitive(String key,
Object value)
Equivalent to new ERXKeyValueQualifier(key,
EOQualifier.QualifierOperatorCaseInsensitiveLike, value);
|
static ERXKeyValueQualifier |
matches(String key,
String value)
Equivalent to new ERXRegExQualifier(key, value);
|
static com.webobjects.eocontrol.EOQualifier |
matchingValues(Object... values)
Inspired by EOUtilities.objectsWithValues method, creates EOKeyValueQualifiers for a variable-length list of parameters,
combines these qualifier into an EOAndQualifier and returns that qualifier.
|
static ERXNotQualifier |
not(com.webobjects.eocontrol.EOQualifier qualifier)
Equivalent to new ERXNotQualifier(qualifier);
|
static <T> ERXKeyComparisonQualifier |
notEquals(ERXKey<T> key,
ERXKey<T> value)
Equivalent to new ERXKeyComparisonQualifier(key,
EOQualifier.QualifierOperatorNotEqual, value);
|
static ERXKeyValueQualifier |
notEquals(String key,
Object value)
Equivalent to new ERXKeyValueQualifier(key,
EOQualifier.QualifierOperatorNotEqual, value);
|
static ERXAndQualifier |
notIn(String key,
NSArray values)
Equivalent to a new ERXAndQualifier of
EONotQualifier(EOKeyValueQualifier) with key equals value for each value.
|
static ERXAndQualifier |
notInObjects(String key,
Object... values)
Equivalent to a new ERXAndQualifier of
EONotQualifier(EOKeyValueQualifier) with key equals value for each value.
|
static <T> T |
one(NSArray<T> array,
com.webobjects.eocontrol.EOQualifier qualifier)
Returns the one object that matches the qualifier in the given array (or
null if there is no match).
|
static ERXOrQualifier |
or(com.webobjects.eocontrol.EOQualifier... qualifiersArray)
Equivalent to new ERXOrQualifier(new NSArray(qualifiersArray).
|
static ERXOrQualifier |
or(NSArray<? extends com.webobjects.eocontrol.EOQualifier> qualifiers)
Equivalent to new ERXOrQualifier(new NSArray(qualifiersArray).
|
static com.webobjects.eocontrol.EOQualifier |
replaceQualifierWithQualifier(com.webobjects.eocontrol.EOQualifier qualifier,
com.webobjects.eocontrol.EOQualifier searchFor,
com.webobjects.eocontrol.EOQualifier replaceWith)
Takes a qualifier and searches for the given qualifier within to replace it with another one.
|
static <T> T |
requiredOne(NSArray<T> array,
com.webobjects.eocontrol.EOQualifier qualifier)
Returns the one object that matches the qualifier in the given array (or
throws if there is no match).
|
static ERXKeyValueQualifier |
startsWith(String key,
String value)
Equivalent to new ERXKeyValueQualifier(key,
EOQualifier.OperatorLike, value + "*").
|
static ERXKeyValueQualifier |
startsWithInsensitive(String key,
String value)
Equivalent to new ERXKeyValueQualifier(key,
EOQualifier.OperatorCaseInsensitiveLike, value + "*").
|
public static final com.webobjects.foundation.NSSelector EQ
public static final com.webobjects.foundation.NSSelector NE
public static final com.webobjects.foundation.NSSelector LT
public static final com.webobjects.foundation.NSSelector GT
public static final com.webobjects.foundation.NSSelector LTEQ
public static final com.webobjects.foundation.NSSelector GTEQ
public static final com.webobjects.foundation.NSSelector CONTAINS
public static final com.webobjects.foundation.NSSelector LIKE
public static final com.webobjects.foundation.NSSelector ILIKE
public static <T> NSArray<T> filtered(NSArray<T> array, com.webobjects.eocontrol.EOQualifier qualifier)
T
- the type of the arrayarray
- the array to filterqualifier
- the qualifier to filter withpublic static void filter(NSMutableArray<?> array, com.webobjects.eocontrol.EOQualifier qualifier)
array
- the array to filter (in place)qualifier
- the qualifier to filter withpublic static <T> T one(NSArray<T> array, com.webobjects.eocontrol.EOQualifier qualifier)
T
- the type of the objectsarray
- the array to filterqualifier
- the qualifier to filter onIllegalStateException
- if more than one object matchedpublic static <T> T first(NSArray<T> array, com.webobjects.eocontrol.EOQualifier qualifier)
T
- the type of the objectsarray
- the array to filterqualifier
- the qualifier to filter onpublic static <T> T requiredOne(NSArray<T> array, com.webobjects.eocontrol.EOQualifier qualifier)
T
- the type of the objectsarray
- the array to filterqualifier
- the qualifier to filter onIllegalStateException
- if more than one object matchedNoSuchElementException
- if no objects matchedpublic static ERXOrQualifier or(com.webobjects.eocontrol.EOQualifier... qualifiersArray)
qualifiersArray
- the array of qualifiers to orpublic static ERXOrQualifier or(NSArray<? extends com.webobjects.eocontrol.EOQualifier> qualifiers)
qualifiers
- the NSArray of qualifiers to orpublic static ERXAndQualifier and(com.webobjects.eocontrol.EOQualifier... qualifiersArray)
qualifiersArray
- the array of qualifiers to andpublic static ERXAndQualifier and(NSArray<? extends com.webobjects.eocontrol.EOQualifier> qualifiers)
qualifiers
- the NSArray of qualifiers to andpublic static ERXKeyValueQualifier like(String key, Object value)
key
- the keyvalue
- the valuepublic static ERXKeyValueQualifier likeInsensitive(String key, Object value)
key
- the keyvalue
- the valuepublic static ERXKeyValueQualifier matches(String key, String value)
key
- the keyvalue
- the valuepublic static ERXKeyValueQualifier hasValues(String key, NSArray values)
key
- the keyvalues
- the valuespublic static ERXKeyValueQualifier has(String key, NSArray values)
key
- the keyvalues
- the valuespublic static ERXKeyValueQualifier hasAtLeast(String key, NSArray values, int min)
key
- the keyvalues
- the valuesmin
- the minimum number of objects from values to matchpublic static ERXKeyValueQualifier equals(String key, Object value)
key
- the keyvalue
- the valuepublic static <T> ERXKeyComparisonQualifier equals(ERXKey<T> key, ERXKey<T> value)
key
- the keyvalue
- the valuepublic static com.webobjects.eocontrol.EOQualifier isIn(NSArray<? extends ERXGenericRecord> valueArray)
valueArray
- the array of valuespublic static com.webobjects.eocontrol.EOQualifier is(ERXGenericRecord value)
value
- the valuepublic static ERXKeyValueQualifier is(String key, Object value)
key
- the keyvalue
- the valuepublic static ERXKeyValueQualifier isNull(String key, boolean yesOrNo)
key
- the keyyesOrNo
- if true, returns isNull, if false, returns isNotNullpublic static ERXKeyValueQualifier isNull(String key)
key
- the keypublic static ERXKeyValueQualifier isNotNull(String key)
key
- the keypublic static ERXKeyValueQualifier isTrue(String key)
key
- the keypublic static ERXKeyValueQualifier isFalse(String key)
key
- the keypublic static ERXKeyValueQualifier notEquals(String key, Object value)
key
- the keyvalue
- the valuepublic static <T> ERXKeyComparisonQualifier notEquals(ERXKey<T> key, ERXKey<T> value)
key
- the keyvalue
- the valuepublic static ERXKeyValueQualifier lessThan(String key, Object value)
key
- the keyvalue
- the valuepublic static <T> ERXKeyComparisonQualifier lessThan(ERXKey<T> key, ERXKey<T> value)
key
- the keyvalue
- the valuepublic static ERXKeyValueQualifier greaterThan(String key, Object value)
key
- the keyvalue
- the valuepublic static <T> ERXKeyComparisonQualifier greaterThan(ERXKey<T> key, ERXKey<T> value)
key
- the keyvalue
- the valuepublic static ERXKeyValueQualifier lessThanOrEqualTo(String key, Object value)
key
- the keyvalue
- the valuepublic static <T> ERXKeyComparisonQualifier lessThanOrEqualTo(ERXKey<T> key, ERXKey<T> value)
key
- the keyvalue
- the valuepublic static ERXKeyValueQualifier greaterThanOrEqualTo(String key, Object value)
key
- the keyvalue
- the valuepublic static <T> ERXKeyComparisonQualifier greaterThanOrEqualTo(ERXKey<T> key, ERXKey<T> value)
key
- the keyvalue
- the valuepublic static ERXNotQualifier not(com.webobjects.eocontrol.EOQualifier qualifier)
qualifier
- the qualifier to notpublic static ERXKeyValueQualifier compare(String key, com.webobjects.foundation.NSSelector operator, Object value)
key
- the keyoperator
- ERXQ.EQ, NE, GT, LT, etcvalue
- the valuepublic static ERXOrQualifier inObjects(String key, Object... values)
key
- the keyvalues
- the valuespublic static ERXAndQualifier notInObjects(String key, Object... values)
key
- the keyvalues
- the valuespublic static ERXOrQualifier in(String key, NSArray<?> values)
key
- the keyvalues
- the valuespublic static ERXAndQualifier notIn(String key, NSArray values)
key
- the keyvalues
- the valuespublic static com.webobjects.eocontrol.EOQualifier between(String key, Object lowerBound, Object upperBound)
key
- the keylowerBound
- the lower bound valueupperBound
- the upper bound valuepublic static com.webobjects.eocontrol.EOQualifier between(String key, Object lowerBound, Object upperBound, boolean inclusive)
key
- the keylowerBound
- the lower bound valueupperBound
- the upper bound valueinclusive
- if the lowerBound and upperBound should be inclusivepublic static ERXKeyValueQualifier startsWith(String key, String value)
key
- the keyvalue
- the substring valuepublic static ERXKeyValueQualifier startsWithInsensitive(String key, String value)
key
- the keyvalue
- the substring valuepublic static ERXKeyValueQualifier endsWith(String key, String value)
key
- the keyvalue
- the substring valuepublic static ERXKeyValueQualifier endsWithInsensitive(String key, String value)
key
- the keyvalue
- the substring valuepublic static ERXKeyValueQualifier containsObject(String key, Object value)
key
- the keyvalue
- the valuepublic static ERXKeyValueQualifier contains(String key, String value)
key
- the keyvalue
- the substring valuepublic static ERXOrQualifier containsAny(NSArray<String> keys, String tokensWithWhitespace)
keys
- the keystokensWithWhitespace
- a whitespace separated list of tokens to search forpublic static ERXOrQualifier containsAny(String key, String tokensWithWhitespace)
key
- the keytokensWithWhitespace
- a whitespace separated list of tokens to search forpublic static ERXOrQualifier containsAny(String key, String[] tokens)
key
- the keytokens
- the list of tokens to search forpublic static ERXOrQualifier containsAll(NSArray<String> keys, String tokensWithWhitespace)
keys
- the keystokensWithWhitespace
- a whitespace separated list of tokens to search forpublic static ERXAndQualifier containsAll(String key, String tokensWithWhitespace)
key
- the keytokensWithWhitespace
- a whitespace separated list of tokens to search forpublic static ERXAndQualifier containsAll(String key, String[] tokens)
key
- the keytokens
- the list of tokens to search forpublic static ERXAndQualifier containsAllInAny(String[] keys, String tokensWithWhitespace)
keys
- keypaths to perform search intokensWithWhitespace
- tokens to search forpublic static ERXAndQualifier containsAllInAny(String[] keys, String[] tokens)
keys
- keypaths to perform search intokens
- tokens to search forpublic static String keyPath(String... elements)
qualifiers.addObject(ERXQ.equals(Distribution.PUBLICATION + "." + Publication.AD + "." + Ad.STATE, DisplayAdStateMachine.ReadyForPrinting));to:
qualifiers.addObject(ERXQ.equals(ERXQ.keyPath(Distribution.PUBLICATION, Publication.AD, Ad.STATE, DisplayAdStateMachine.ReadyForPrinting));
elements
- one or more string to concatenate into a keyPathpublic static NSArray<com.webobjects.eocontrol.EOKeyValueQualifier> extractKeyValueQualifiers(com.webobjects.eocontrol.EOQualifier qualifier)
EOKeyValueQualifier
objects
contained within.qualifier
- qualifier to analyzepublic static com.webobjects.eocontrol.EOQualifier replaceQualifierWithQualifier(com.webobjects.eocontrol.EOQualifier qualifier, com.webobjects.eocontrol.EOQualifier searchFor, com.webobjects.eocontrol.EOQualifier replaceWith)
qualifier
- the qualifier to modifysearchFor
- the qualifier to replacereplaceWith
- the qualifier that replaces the searched onepublic static com.webobjects.eocontrol.EOQualifier matchingValues(Object... values)
An IllegalArgumentException is thrown if objects are not of the right type or if a bad sequence is used, such as a sequence of String-Object-Object or String-String-String.
See er.extensions.eof.ERXEOControlUtilitiesTest in the ERXTest project for details.
values
- a list of objects that can be used to create an EOQualifier. An NSDictionary or EOQualifier can stand alone in the
list. A String or ERXKey must be followed by an Object.Copyright © 2002 – 2020 Project Wonder.