Class ImmutableSetMultimap.Builder<K,V>

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

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

    • put

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

      public ImmutableSetMultimap.Builder<K,V> putAll(K key, Iterable<? extends V> values)
      Put all values for a key. 为键放入所有值。
      Parameters:
      key - the key | 键
      values - the values | 值
      Returns:
      this builder | 此构建器
    • putAll

      @SafeVarargs public final ImmutableSetMultimap.Builder<K,V> putAll(K key, V... values)
      Put all values for a key. 为键放入所有值。
      Parameters:
      key - the key | 键
      values - the values | 值
      Returns:
      this builder | 此构建器
    • putAll

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

      public ImmutableSetMultimap<K,V> build()
      Build the immutable set multimap. 构建不可变集合多值映射。
      Returns:
      immutable set multimap | 不可变集合多值映射