Example usage for com.google.common.collect ImmutableMultiset.Builder setCount

List of usage examples for com.google.common.collect ImmutableMultiset.Builder setCount

Introduction

In this page you can find the example usage for com.google.common.collect ImmutableMultiset.Builder setCount.

Prototype

@Deprecated
@Override
public final int setCount(E element, int count) 

Source Link

Document

Guaranteed to throw an exception and leave the collection unmodified.

Usage

From source file:org.sonar.db.organization.OrganizationMemberDao.java

public Multiset<String> countByOrganizationUuids(DbSession dbSession, List<String> organizationUuids) {
    ImmutableMultiset.Builder<String> counts = ImmutableMultiset.builder();
    executeLargeInputsWithoutOutput(organizationUuids,
            list -> mapper(dbSession).countByOrganizationUuids(list, result -> {
                OrganizationCount organizationUuidCount = (OrganizationCount) result.getResultObject();
                counts.setCount(organizationUuidCount.getOrganizationUuid(),
                        organizationUuidCount.getMemberCount());
            }));/*from w  w w .j a v  a 2  s  .com*/

    return counts.build();
}