Class Txt

java.lang.Object
com.kamikazejam.kamicommon.util.Txt

public class Txt extends Object
  • Field Details

  • Constructor Details

    • Txt

      public Txt()
  • Method Details

    • upperCaseFirst

      @Contract("null -> null; !null -> !null") public static String upperCaseFirst(String string)
    • lowerCaseFirst

      @Contract("null -> null; !null -> !null") public static String lowerCaseFirst(String string)
    • isVowel

      @Contract("null -> false") public static boolean isVowel(String str)
    • aan

      @NotNull public static @NotNull String aan(String noun)
    • implode

      @NotNull public static @NotNull String implode(Object @NotNull [] list, String glue)
    • implode

      @NotNull public static @NotNull String implode(@NotNull @NotNull Collection<?> coll, String glue)
    • implode

      @NotNull public static @NotNull String implode(@NotNull @NotNull Collection<?> coll, String glue, @Nullable @Nullable String format)
    • implode

      @NotNull public static @NotNull String implode(Object @NotNull [] list, String glue, @Nullable @Nullable String format)
    • implodeCommaAndDot

      @NotNull public static @NotNull String implodeCommaAndDot(@NotNull @NotNull Collection<?> objects, @Nullable @Nullable String format, String comma, String and, String dot)
    • camelSplit

      @NotNull public static @NotNull List<String> camelSplit(String string)
    • getFiltered

      @NotNull public static <T> @NotNull List<T> getFiltered(@NotNull @NotNull Iterable<T> elements, @NotNull @NotNull Predicate<T> predicate)
    • getFiltered

      @NotNull public static <T> @NotNull List<T> getFiltered(T @NotNull [] elements, @NotNull @NotNull Predicate<T> predicate)
    • getStartsWithIgnoreCase

      @NotNull public static @NotNull List<String> getStartsWithIgnoreCase(@NotNull @NotNull Iterable<String> elements, String prefix)
    • getStartsWithIgnoreCase

      @NotNull public static @NotNull List<String> getStartsWithIgnoreCase(String @NotNull [] elements, String prefix)
    • getNicedEnumString

      @NotNull public static @NotNull String getNicedEnumString(@NotNull @NotNull String str, String glue)
    • getNicedEnumString

      @NotNull public static @NotNull String getNicedEnumString(@NotNull @NotNull String str)
    • getNicedEnum

      @NotNull public static <T extends Enum<T>> @NotNull String getNicedEnum(@NotNull T enumObject, String glue)
    • getNicedEnum

      @NotNull public static <T extends Enum<T>> @NotNull String getNicedEnum(@NotNull T enumObject)
    • getMaterialName

      @NotNull public static @NotNull String getMaterialName(@NotNull @NotNull Material material)
    • getItemName

      @NotNull public static @NotNull String getItemName(@Nullable @Nullable ItemStack itemStack)
      Returns:
      The name of the item, or a default name (getItemName(ItemStack, String)) if the item is null or empty.
    • getItemName

      @NotNull public static @NotNull String getItemName(@Nullable @Nullable ItemStack itemStack, @NotNull @NotNull String defaultName)
      Returns:
      The name of the item, or the supplied default name if the item is null or empty.
    • tokenizeArguments

      @NotNull public static @NotNull List<String> tokenizeArguments(@NotNull @NotNull String str)
    • removeSmartQuotes

      @Contract("null -> null; !null -> !null") public static String removeSmartQuotes(String string)
    • titleize

      @NotNull public static @NotNull String titleize(@NotNull @NotNull String title)
      Formats a given title to be centered in a titleized line.

      Titleized lines can be configured in Txt.Config

      They feature the centered in additional 'titleized' line characters.
      Parameters:
      title - The unformatted title, which will be titleized.
      Returns:
      The titleized page title String.
    • titleizedPageTitle

      @NotNull public static @NotNull String titleizedPageTitle(@NotNull @NotNull String title, int pageNum, int pageCount, @NotNull @NotNull List<String> args)
      Forms a page title using , and , and then passes it to titleize(String).

      Default format is configured in Txt.Config.pageTitleFormat and looks like:
      Parameters:
      title - The unformatted title, which will be titleized.
      pageNum - The current page number, 1-based (e.g. 1 for the first page).
      pageCount - The total number of pages.
      Returns:
      The titleized page title String.