More succinct return statements
This commit is contained in:
parent
25dd347123
commit
7ba110e31a
@ -76,16 +76,16 @@ abstract public class ExpressionStringComparisonRowFilter implements RowFilter {
|
||||
Object[] a = (Object[]) value;
|
||||
for (Object v : a) {
|
||||
if (checkValue(v instanceof String ? ((String) v) : v.toString())) {
|
||||
return (invert) ? false : true;
|
||||
return !invert;
|
||||
}
|
||||
}
|
||||
} else if (value instanceof Collection<?>) {
|
||||
for (Object v : ExpressionUtils.toObjectCollection(value)) {
|
||||
if (checkValue(v.toString())) {
|
||||
return (invert) ? false : true;
|
||||
return !invert;
|
||||
}
|
||||
}
|
||||
return (invert) ? true : false;
|
||||
return invert;
|
||||
} else if (value instanceof JSONArray) {
|
||||
JSONArray a = (JSONArray) value;
|
||||
int l = a.length();
|
||||
@ -93,20 +93,20 @@ abstract public class ExpressionStringComparisonRowFilter implements RowFilter {
|
||||
for (int i = 0; i < l; i++) {
|
||||
try {
|
||||
if (checkValue(a.get(i).toString())) {
|
||||
return (invert) ? false : true;
|
||||
return !invert;
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
return (invert) ? true : false;
|
||||
return invert;
|
||||
} else {
|
||||
if (checkValue(value instanceof String ? ((String) value) : value.toString())) {
|
||||
return (invert) ? false : true;
|
||||
return !invert;
|
||||
}
|
||||
}
|
||||
}
|
||||
return (invert) ? true : false;
|
||||
return invert;
|
||||
}
|
||||
|
||||
abstract protected boolean checkValue(String s);
|
||||
|
Loading…
Reference in New Issue
Block a user