Interface IMapBuilder<K,V>

All Known Implementing Classes:
HashMap.Builder

public interface IMapBuilder<K,V>
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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.
    default IMapBuilder<K,V>
    add(Map<? extends K,? extends V> source)
    Adds all values in the Map to the values included in the collection when build() is called.
    add(K key, V value)
     
    default IMapBuilder<K,V>
    add(IMapBuilder<K,V> other)
     
    default IMapBuilder<K,V>
    add(IMapEntry<? extends K,? extends V> e)
     
    default IMapBuilder<K,V>
    add(Indexed<? extends IMapEntry<? extends K,? extends V>> source)
    Adds all values in the Indexed to the values included in the collection when build() is called.
    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.
    default <T extends IMapEntry<? extends K, ? extends V>>
    IMapBuilder<K,V>
    add(T... source)
    Adds all values in the array to the values included in the collection when build() is called.
     
    Deletes all values.
    int
     
  • Method Details

    • build

      @Nonnull IMap<K,V> build()
    • add

      @Nonnull IMapBuilder<K,V> add(@Nonnull K key, V value)
    • size

      int size()
    • add

      @Nonnull default IMapBuilder<K,V> add(IMapEntry<? extends K,? extends V> e)
    • 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

      @Nonnull default IMapBuilder<K,V> add(Map<? extends K,? extends V> source)
      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

      @Nonnull default <T extends IMapEntry<? extends K, ? extends V>> IMapBuilder<K,V> add(T... source)
      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

      @Nonnull default IMapBuilder<K,V> add(Indexed<? extends IMapEntry<? extends K,? extends V>> source)
      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

      @Nonnull default IMapBuilder<K,V> add(@Nonnull IMapBuilder<K,V> other)
    • 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)