io.github.bakedlibs.dough.collections.KeyMap Maven / Gradle / Ivy
package io.github.bakedlibs.dough.collections;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Supplier;
import javax.annotation.Nonnull;
import org.bukkit.Keyed;
import org.bukkit.NamespacedKey;
public class KeyMap extends OptionalMap {
public KeyMap(@Nonnull Supplier extends Map> constructor) {
super(constructor);
}
public KeyMap() {
this(HashMap::new);
}
public void add(T value) {
put(value.getKey(), value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy