All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.minestom.server.command.builder.CommandData Maven / Gradle / Ivy

There is a newer version: 7320437640
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy