int idx = 0;
while (idx < values.length) {
if (values[idx] instanceof NSDictionary) {
NSDictionary<String,Object> theseValues = (NSDictionary<String,Object>)values[idx];
for (String aKey : theseValues.allKeys()) {
qualifiers.add(new EOKeyValueQualifier(aKey, EOQualifier.QualifierOperatorEqual, theseValues.objectForKey(aKey)));
}
idx++;
continue;
}
if (values[idx] instanceof EOQualifier) {
qualifiers.add((EOQualifier)values[idx]);
idx++;
continue;
}
if (values[idx] instanceof String || values[idx] instanceof ERXKey) {
if ((idx+1) < values.length) {
if (values[idx] instanceof String)
qualifiers.add(new EOKeyValueQualifier((String)values[idx], EOQualifier.QualifierOperatorEqual, values[idx+1]));
else
qualifiers.add(((ERXKey)values[idx]).is(values[idx+1]));
} else
throw new IllegalArgumentException("Parameters to matchingValues did not match allowed sequence of objects. List of values is length "+values.length+".");
idx += 2;