in rest-api/src/jetbrains/buildServer/server/rest/data/build/GenericBuildsFilter.java [86:148]
public GenericBuildsFilter(@Nullable final SBuildType buildType,
@Nullable final SProject project,
@Nullable final String status,
@Nullable final String number,
@Nullable final SUser user,
@Nullable final Boolean personal,
@Nullable final Boolean canceled,
@Nullable final Boolean running,
@Nullable final Boolean pinned,
@Nullable final List<String> tags,
@NotNull final BranchMatcher branchMatcher,
@Nullable final String agentName,
@Nullable final Collection<SBuildAgent> agents,
@Nullable final ParameterCondition parameterCondition,
@Nullable final RangeLimit since,
@Nullable final RangeLimit until,
@Nullable final Long start,
@Nullable final Integer count,
@Nullable final Long lookupLimit,
@NotNull final ServiceLocator serviceLocator) {
myStart = start;
myCount = count;
myBuildType = buildType;
myProject = project;
myStatus = status;
myNumber = number;
myUser = user;
myPersonal = personal;
myCanceled = canceled;
myRunning = running;
myPinned = pinned;
myTags = tags;
myBranchMatcher = branchMatcher;
myAgentName = agentName;
myServiceLocator = serviceLocator;
if (agents == null) {
myAgents = null;
} else {
myAgents = new TreeSet<SBuildAgent>(new Comparator<SBuildAgent>() {
public int compare(final SBuildAgent o1, final SBuildAgent o2) {
if (o1.getId() == -1) {
if (o2.getId() == -1) {
return o1.getAgentTypeId() - o2.getAgentTypeId();
} else {
return -1;
}
}
if (o2.getId() == -1) {
return 1;
}
return o1.getId() - o2.getId();
}
});
myAgents.addAll(agents);
}
mySince = since;
myUntil = until;
myLookupLimit = lookupLimit;
myParameterCondition = parameterCondition;
}