Package org.javimmutable.collections
Interface IMapBuilder<K,V>
- All Known Implementing Classes:
HashMap.Builder
public interface IMapBuilder<K,V>
-
Method Summary
Modifier and TypeMethodDescriptiondefault IMapBuilder
<K, V> Adds all values in the Collection to the values included in the collection when build() is called.default IMapBuilder
<K, V> Adds all values in the Iterator to the values included in the collection when build() is called.default IMapBuilder
<K, V> Adds all values in the Map to the values included in the collection when build() is called.default IMapBuilder
<K, V> add
(IMapBuilder<K, V> other) default IMapBuilder
<K, V> default IMapBuilder
<K, V> Adds all values in the Indexed to the values included in the collection when build() is called.default IMapBuilder
<K, V> Adds all values in the specified range of Indexed to the values included in the collection when build() is called.add
(T... source) Adds all values in the array to the values included in the collection when build() is called.build()
clear()
Deletes all values.int
size()
-
Method Details
-
build
-
add
-
size
int size() -
add
-
add
@Nonnull default IMapBuilder<K,V> add(Iterator<? extends IMapEntry<? extends K, ? extends V>> source) Adds all values in the Iterator to the values included in the collection when build() is called.- Parameters:
source
- Iterator containing values to add- Returns:
- the builder (convenience for chaining multiple calls)
-
add
Adds all values in the Map to the values included in the collection when build() is called.- Parameters:
source
- Iterator containing values to add- Returns:
- the builder (convenience for chaining multiple calls)
-
add
@Nonnull default IMapBuilder<K,V> add(Iterable<? extends IMapEntry<? extends K, ? extends V>> source) Adds all values in the Collection to the values included in the collection when build() is called.- Parameters:
source
- Collection containing values to add- Returns:
- the builder (convenience for chaining multiple calls)
-
add
Adds all values in the array to the values included in the collection when build() is called.- Parameters:
source
- array containing values to add- Returns:
- the builder (convenience for chaining multiple calls)
-
add
@Nonnull default IMapBuilder<K,V> add(Indexed<? extends IMapEntry<? extends K, ? extends V>> source, int offset, int limit) Adds all values in the specified range of Indexed to the values included in the collection when build() is called.- Parameters:
source
- Indexed containing values to add- Returns:
- the builder (convenience for chaining multiple calls)
-
add
Adds all values in the Indexed to the values included in the collection when build() is called.- Parameters:
source
- Indexed containing values to add- Returns:
- the builder (convenience for chaining multiple calls)
-
add
-
clear
Deletes all values. This is useful to reset to build a new map with the same builder.- Returns:
- the builder (convenience for chaining multiple calls)
-