build metodu
Örnek
Şöyle yaparız.
Şöyle yaparız.
Şöyle yaparız.
Örnek
Şöyle yaparız.
ImmutableMap.Builder<String,String> myMap = ImmutableMap.<String, String>builder()
.put("key1", "value1")
.put("key2", "value2")
.put("key3", "value3")
.put("key4", "value4")
.put("key5", "value5")
.put("key6", "value6")
.put("key7", "value7")
.put("key8", "value8")
.put("key9", "value9")
.build();
put metodu
ÖrnekŞöyle yaparız.
final Map<String, Integer> m = ImmutableMap.<String, Integer>builder().
put("a", 1).
put("b", 2).
build();
putAll metoduŞöyle yaparız.
Map<String, String> srcMap = Map.of("A", "a", "B", "b", "C", "c");
ImmutableMap<String, String> map = ImmutableMap.<String, String> builder()
.putAll(srcMap)
.put("D", "d")
.build();