package net.knarcraft.blacksmith.util; import java.util.ArrayList; import java.util.List; /** * A helper class for tab-completion */ public final class TabCompletionHelper { private TabCompletionHelper() { } /** * Finds tab complete values that contain the typed text * * @param values

The values to filter

* @param typedText

The text the player has started typing

* @return

The given string values that contain the player's typed text

*/ public static List filterMatchingContains(List values, String typedText) { List configValues = new ArrayList<>(); for (String value : values) { if (value.toLowerCase().contains(typedText.toLowerCase())) { configValues.add(value); } } return configValues; } }