Class Placeholders<T,P extends Placeholders<T,P>>

java.lang.Object
net.dzikoysk.funnyguilds.feature.placeholders.Placeholders<T,P>
Direct Known Subclasses:
BasicPlaceholders, GuildPlaceholders, OffsetDateTimePlaceholders, UserPlaceholders

public abstract class Placeholders<T,P extends Placeholders<T,P>> extends Object
  • Field Details

  • Constructor Details

    • Placeholders

      public Placeholders()
  • Method Details

    • create

      public abstract P create()
    • property

      public P property(String name, Placeholder<T> placeholder)
    • property

      public P property(String name, LocaleMonoResolver<T> resolver)
    • property

      public P property(String name, MonoResolver<T> resolver)
    • property

      public P property(String name, SimpleResolver resolver)
    • property

      public P property(Map<String,Placeholder<T>> placeholders)
    • property

      public P property(P placeholders)
    • format

      public String format(@Nullable @Nullable Object entity, String text, T data)
      Format text with raw placeholders
      Parameters:
      text - text to format
      data - data to use to formatting
      Returns:
      formatted text
    • format

      public String format(String text, T data)
    • toFormatter

      public FunnyFormatter toFormatter(@Nullable @Nullable Object entity, T data)
    • toFormatter

      public FunnyFormatter toFormatter(T data)
    • formatVariables

      public String formatVariables(@Nullable @Nullable Object entity, String text, T data)
      Format text with variable format placeholders (e.g. {NAME})
      Parameters:
      text - text to format
      data - data to use to formatting
      Returns:
      formatted text
    • formatVariables

      public String formatVariables(String text, T data)
    • toVariablesFormatter

      public FunnyFormatter toVariablesFormatter(@Nullable @Nullable Object entity, T data)
    • toVariablesFormatter

      public FunnyFormatter toVariablesFormatter(T data)
    • formatCustom

      public String formatCustom(@Nullable @Nullable Object entity, String text, T data, String prefix, String suffix, Function<String,String> nameModifier)
      Format text with custom format placeholders
      Parameters:
      text - text to format
      data - data to use to formatting
      prefix - prefix to use before placeholders (for eg. "{")
      suffix - suffix to use after placeholders (for eg. "}")
      nameModifier - function to modify placeholder name (for eg. upper case)
      Returns:
      formatted text
    • formatCustom

      public String formatCustom(String text, T data, String prefix, String suffix, Function<String,String> nameModifier)
    • toCustomFormatter

      public FunnyFormatter toCustomFormatter(@Nullable @Nullable Object entity, T data, String prefix, String suffix, Function<String,String> nameModifier)
    • toCustomFormatter

      public FunnyFormatter toCustomFormatter(T data, String prefix, String suffix, Function<String,String> nameModifier)