Class ImmutableMap.Builder<K,V>

java.lang.Object
cloud.opencode.base.collections.ImmutableMap.Builder<K,V>
Type Parameters:
K - key type | 键类型
V - value type | 值类型
Enclosing class:
ImmutableMap<K,V>

public static final class ImmutableMap.Builder<K,V> extends Object
Builder for ImmutableMap ImmutableMap 构建器
Since:
JDK 25, opencode-base-collections V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Method Details

    • put

      public ImmutableMap.Builder<K,V> put(K key, V value)
      Put an entry. 放入条目。
      Parameters:
      key - the key | 键
      value - the value | 值
      Returns:
      this builder | 此构建器
    • put

      public ImmutableMap.Builder<K,V> put(Map.Entry<? extends K, ? extends V> entry)
      Put an entry. 放入条目。
      Parameters:
      entry - the entry | 条目
      Returns:
      this builder | 此构建器
    • putAll

      public ImmutableMap.Builder<K,V> putAll(Map<? extends K, ? extends V> map)
      Put all entries from a map. 从映射放入所有条目。
      Parameters:
      map - the map | 映射
      Returns:
      this builder | 此构建器
    • build

      public ImmutableMap<K,V> build()
      Build the immutable map. 构建不可变映射。
      Returns:
      immutable map | 不可变映射