.setHandler(this)
.setResponseExample(getClass().getResource("search-example.json"));
- action.addFieldsParam(UserJsonWriter.FIELDS);
+ action.createFieldsParam(UserJsonWriter.FIELDS)
+ .setDeprecatedSince("5.4");
action.addPagingParams(50, MAX_LIMIT);
action.createParam(Param.TEXT_QUERY)
import com.google.common.collect.ImmutableSet;
import java.util.Collection;
+import java.util.Collections;
import java.util.Set;
import javax.annotation.Nullable;
import org.sonar.api.user.User;
if (user == null) {
json.beginObject().endObject();
} else {
- write(json, user, ImmutableSet.<String>of(), CONCISE_FIELDS);
+ write(json, user, Collections.<String>emptySet(), CONCISE_FIELDS);
}
}
* used to restrict the number of fields returned in JSON response.
*/
public NewAction addFieldsParam(Collection<?> possibleValues) {
- createParam(Param.FIELDS)
+ createFieldsParam(possibleValues);
+ return this;
+ }
+
+ public NewParam createFieldsParam(Collection<?> possibleValues) {
+ return createParam(Param.FIELDS)
.setDescription("Comma-separated list of the fields to be returned in response. All the fields are returned by default.")
.setPossibleValues(possibleValues);
- return this;
}
/**$