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

dev.aurelium.auraskills.api.loot.LootOptioned Maven / Gradle / Ivy

There is a newer version: 2.2.6
Show newest version
package dev.aurelium.auraskills.api.loot;

import org.jetbrains.annotations.Nullable;

import java.util.Map;

public class LootOptioned {

    protected final Map options;

    public LootOptioned(Map options) {
        this.options = options;
    }

    public Map getOptions() {
        return options;
    }

    @Nullable
    public  T getOption(String key, Class type) {
        Object o = options.get(key);
        if (o == null) return null;
        return type.cast(o);
    }

    public  T getOption(String key, Class type, T def) {
        Object o = options.get(key);
        if (o == null) return def;
        return type.cast(o);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy