Interface ImmutableBagFactory
- All Known Implementing Classes:
ImmutableBagFactoryImpl
public interface ImmutableBagFactory
A factory which creates instances of type
ImmutableBag
.-
Method Summary
Modifier and TypeMethodDescription<T> ImmutableBag
<T> empty()
default <T> ImmutableBag
<T> fromStream
(Stream<? extends T> stream) <T> ImmutableBag
<T> of()
Same asempty()
.<T> ImmutableBag
<T> of
(T element) Same aswith(Object)
.<T> ImmutableBag
<T> of
(T... elements) Same aswith(Object[])
.<T> ImmutableBag
<T> Same aswithAll(Iterable)
.default <T> ImmutableBag
<T> ofOccurrences
(ObjectIntPair<T>... elementsWithOccurrences) Same aswithOccurrences(ObjectIntPair[])
default <T> ImmutableBag
<T> ofOccurrences
(T element, int occurrence) Same aswithOccurrences(Object, int)
.default <T> ImmutableBag
<T> ofOccurrences
(T element1, int occurrence1, T element2, int occurrence2) default <T> ImmutableBag
<T> ofOccurrences
(T element1, int occurrence1, T element2, int occurrence2, T element3, int occurrence3) default <T> ImmutableBag
<T> ofOccurrences
(T element1, int occurrence1, T element2, int occurrence2, T element3, int occurrence3, T element4, int occurrence4) <T> ImmutableBag
<T> with()
Same asempty()
.<T> ImmutableBag
<T> with
(T element) <T> ImmutableBag
<T> with
(T... elements) <T> ImmutableBag
<T> default <T> ImmutableBag
<T> withOccurrences
(ObjectIntPair<T>... elementsWithOccurrences) default <T> ImmutableBag
<T> withOccurrences
(T element, int occurrence) default <T> ImmutableBag
<T> withOccurrences
(T element1, int occurrence1, T element2, int occurrence2) default <T> ImmutableBag
<T> withOccurrences
(T element1, int occurrence1, T element2, int occurrence2, T element3, int occurrence3) default <T> ImmutableBag
<T> withOccurrences
(T element1, int occurrence1, T element2, int occurrence2, T element3, int occurrence3, T element4, int occurrence4)
-
Method Details
-
empty
- Since:
- 6.0
-
of
Same asempty()
. -
with
Same asempty()
. -
of
Same aswith(Object)
. -
with
-
of
Same aswith(Object[])
. -
ofOccurrences
Same aswithOccurrences(Object, int)
.- Since:
- 10.3
-
ofOccurrences
- Since:
- 10.3
-
ofOccurrences
default <T> ImmutableBag<T> ofOccurrences(T element1, int occurrence1, T element2, int occurrence2, T element3, int occurrence3) - Since:
- 10.3
-
ofOccurrences
default <T> ImmutableBag<T> ofOccurrences(T element1, int occurrence1, T element2, int occurrence2, T element3, int occurrence3, T element4, int occurrence4) - Since:
- 10.3
-
ofOccurrences
Same aswithOccurrences(ObjectIntPair[])
- Since:
- 10.3
-
with
-
withOccurrences
- Since:
- 10.3
-
withOccurrences
default <T> ImmutableBag<T> withOccurrences(T element1, int occurrence1, T element2, int occurrence2) - Since:
- 10.3
-
withOccurrences
default <T> ImmutableBag<T> withOccurrences(T element1, int occurrence1, T element2, int occurrence2, T element3, int occurrence3) - Since:
- 10.3
-
withOccurrences
default <T> ImmutableBag<T> withOccurrences(T element1, int occurrence1, T element2, int occurrence2, T element3, int occurrence3, T element4, int occurrence4) - Since:
- 10.3
-
withOccurrences
- Since:
- 10.3
-
ofAll
Same aswithAll(Iterable)
. -
withAll
-
fromStream
- Since:
- 10.0.
-