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

29 lines
696 B
Java
Raw Normal View History

2022-10-22 16:12:46 +02:00
package wtf.beatrice.nounspicker.utils;
2022-10-22 16:11:37 +02:00
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;
}
}