NounsPicker/src/main/java/wtf/beatrice/nounspicker/utils/Cache.java

29 lines
696 B
Java

package wtf.beatrice.nounspicker.utils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.HashMap;
public class Cache
{
// map to store pronouns' "raw" names and how they appear in game.
private static final HashMap<String, String> pronouns = new HashMap<>();
public static @Nullable String getPronoun(String pronoun)
{
return pronouns.get(pronoun);
}
public static void addPronoun(@NotNull String pronoun, @NotNull String appearance)
{
pronouns.put(pronoun, appearance);
}
public static boolean isPronounValid(String pronoun)
{
return getPronoun(pronoun) != null;
}
}