Skip to content

HashMap

Larrox edited this page Aug 28, 2025 · 2 revisions

Note

Dont forget to Import the HashMapUtil!

import dev.larrox.HashMapUtil

Empty map

Map<String, Integer> empty = HashMapUtil.create();

Map with entries (varargs)

Map<String, String> map1 = HashMapUtil.of(
    "Name", "Steve",
    "World", "Overworld"
);

Map with a single key-value pair

Map<Integer, String> map2 = HashMapUtil.of(1, "One");

Builder style

Map<String, Integer> map3 = HashMapUtil.<String, Integer>builder()
    .put("Apple", 5)
    .put("Banana", 10)
    .build();

Clone this wiki locally