Top Description Methods
org.eclipse.collections.api.factory.bag

public Interface ImmutableBagFactory

Imports
java.util.stream.Stream, org.eclipse.collections.api.bag.ImmutableBag, .MutableBag, org.eclipse.collections.api.factory.Bags, org.eclipse.collections.api.tuple.primitive.ObjectIntPair

A factory which creates instances of type ImmutableBag.

Method Summary

Modifier and TypeMethod and Description
public <T> ImmutableBag<T>
public default <T> ImmutableBag<T>
fromStream(Stream<? extends T> stream)

public <T> ImmutableBag<T>
of()

Same as empty().

public <T> ImmutableBag<T>
of(T element)

Same as with(Object).

public <T> ImmutableBag<T>
of(T... elements)

Same as with(Object[]).

public <T> ImmutableBag<T>
ofAll(Iterable<? extends T> items)

Same as withAll(Iterable).

public default <T> ImmutableBag<T>
ofOccurrences(T element, int occurrence)

Same as withOccurrences(Object, int).

public default <T> ImmutableBag<T>
ofOccurrences(T element1, int occurrence1, T element2, int occurrence2)

Same as withOccurrences(Object, int, Object, int).

public default <T> ImmutableBag<T>
ofOccurrences(T element1, int occurrence1, T element2, int occurrence2, T element3, int occurrence3)

Same as withOccurrences(Object, int, Object, int, Object, int).

public default <T> ImmutableBag<T>
ofOccurrences(T element1, int occurrence1, T element2, int occurrence2, T element3, int occurrence3, T element4, int occurrence4)

Same as withOccurrences(Object, int, Object, int, Object, int, Object, int).

public default <T> ImmutableBag<T>
ofOccurrences(ObjectIntPair<T>... elementsWithOccurrences)

Same as withOccurrences(ObjectIntPair[])

public <T> ImmutableBag<T>
with()

Same as empty().

public <T> ImmutableBag<T>
with(T element)

public <T> ImmutableBag<T>
with(T... elements)

public <T> ImmutableBag<T>
withAll(Iterable<? extends T> items)

public default <T> ImmutableBag<T>
withOccurrences(T element, int occurrence)

public default <T> ImmutableBag<T>
withOccurrences(T element1, int occurrence1, T element2, int occurrence2)

public default <T> ImmutableBag<T>
withOccurrences(T element1, int occurrence1, T element2, int occurrence2, T element3, int occurrence3)

public default <T> ImmutableBag<T>
withOccurrences(T element1, int occurrence1, T element2, int occurrence2, T element3, int occurrence3, T element4, int occurrence4)

public default <T> ImmutableBag<T>
withOccurrences(ObjectIntPair<T>... elementsWithOccurrences)

Method Detail

emptyback to summary
public <T> ImmutableBag<T> empty()
Since
6.0
fromStreamback to summary
public default <T> ImmutableBag<T> fromStream(Stream<? extends T> stream)
Since
10.0.
ofback to summary
public <T> ImmutableBag<T> of()

Same as empty().

ofback to summary
public <T> ImmutableBag<T> of(T element)

Same as with(Object).

ofback to summary
public <T> ImmutableBag<T> of(T... elements)

Same as with(Object[]).

ofAllback to summary
public <T> ImmutableBag<T> ofAll(Iterable<? extends T> items)

Same as withAll(Iterable).

ofOccurrencesback to summary
public default <T> ImmutableBag<T> ofOccurrences(T element, int occurrence)

Same as withOccurrences(Object, int).

Since
10.3
ofOccurrencesback to summary
public default <T> ImmutableBag<T> ofOccurrences(T element1, int occurrence1, T element2, int occurrence2)

Same as withOccurrences(Object, int, Object, int).

Since
10.3
ofOccurrencesback to summary
public default <T> ImmutableBag<T> ofOccurrences(T element1, int occurrence1, T element2, int occurrence2, T element3, int occurrence3)

Same as withOccurrences(Object, int, Object, int, Object, int).

Since
10.3
ofOccurrencesback to summary
public default <T> ImmutableBag<T> ofOccurrences(T element1, int occurrence1, T element2, int occurrence2, T element3, int occurrence3, T element4, int occurrence4)

Same as withOccurrences(Object, int, Object, int, Object, int, Object, int).

Since
10.3
ofOccurrencesback to summary
public default <T> ImmutableBag<T> ofOccurrences(ObjectIntPair<T>... elementsWithOccurrences)

Same as withOccurrences(ObjectIntPair[])

Since
10.3
withback to summary
public <T> ImmutableBag<T> with()

Same as empty().

withback to summary
public <T> ImmutableBag<T> with(T element)
withback to summary
public <T> ImmutableBag<T> with(T... elements)
withAllback to summary
public <T> ImmutableBag<T> withAll(Iterable<? extends T> items)
withOccurrencesback to summary
public default <T> ImmutableBag<T> withOccurrences(T element, int occurrence)
Since
10.3
withOccurrencesback to summary
public default <T> ImmutableBag<T> withOccurrences(T element1, int occurrence1, T element2, int occurrence2)
Since
10.3
withOccurrencesback to summary
public default <T> ImmutableBag<T> withOccurrences(T element1, int occurrence1, T element2, int occurrence2, T element3, int occurrence3)
Since
10.3
withOccurrencesback to summary
public default <T> ImmutableBag<T> withOccurrences(T element1, int occurrence1, T element2, int occurrence2, T element3, int occurrence3, T element4, int occurrence4)
Since
10.3
withOccurrencesback to summary
public default <T> ImmutableBag<T> withOccurrences(ObjectIntPair<T>... elementsWithOccurrences)
Since
10.3