public static final Any newInstance(anvil.script.Context context, Any[] parameters)
{
SearchControls controls = new SearchControls();
int n = parameters.length;
for(int i=0; i<n; i++) {
Any property = parameters[i];
if (property.isMap()) {
AnyMap map = property.toMap();
String key = map.getLeft().toString();
if (key.equalsIgnoreCase("scope")) {
controls.setSearchScope(map.getRight().toInt());
} else if (key.equalsIgnoreCase("countlimit")) {
controls.setCountLimit(map.getRight().toInt());
} else if (key.equalsIgnoreCase("timelimit")) {
controls.setTimeLimit(map.getRight().toInt());
} else if (key.equalsIgnoreCase("attributes")) {
Any right = map.getRight();
if (right.isNull()) {
controls.setReturningAttributes(null);
} else {
String[] attributes = AnyUtils.toStringArray(right);
controls.setReturningAttributes(attributes);
}