Class ImmutableMultiset.Builder<E>

java.lang.Object
com.google.common.collect.ImmutableCollection.Builder<E>
com.google.common.collect.ImmutableMultiset.Builder<E>
Direct Known Subclasses:
ImmutableSortedMultiset.Builder
Enclosing class:
ImmutableMultiset<E>

@Deprecated(since="2022-12-01") public static class ImmutableMultiset.Builder<E> extends ImmutableCollection.Builder<E>
Deprecated.
The Google Guava Core Libraries are deprecated and will not be part of the AEM SDK after April 2023
A builder for creating immutable multiset instances, especially public static final multisets ("constant multisets"). Example:
 

    public static final ImmutableMultiset<Bean> BEANS =
        new ImmutableMultiset.Builder<Bean>()
            .addCopies(Bean.COCOA, 4)
            .addCopies(Bean.GARDEN, 6)
            .addCopies(Bean.RED, 8)
            .addCopies(Bean.BLACK_EYED, 10)
            .build();

Builder instances can be reused; it is safe to call build() multiple times to build multiple multisets in series.

Since:
2.0 (imported from Google Collections Library)