net.minestom.server.command.builder.CommandData Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of minestom-snapshots Show documentation
Show all versions of minestom-snapshots Show documentation
1.20.4 Lightweight Minecraft server
package net.minestom.server.command.builder;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
public class CommandData {
private final Map dataMap = new ConcurrentHashMap<>();
public CommandData set(@NotNull String key, Object value) {
this.dataMap.put(key, value);
return this;
}
@Nullable
public T get(@NotNull String key) {
return (T) dataMap.get(key);
}
public boolean has(@NotNull String key) {
return dataMap.containsKey(key);
}
@NotNull
public Map getDataMap() {
return dataMap;
}
}