Class SimpleStringModifierFunction

  • All Implemented Interfaces:
    IFormatModifierFunction

    public class SimpleStringModifierFunction
    extends BaseStringModifierFunction
    Represents a simple format modifier function that does not take any argument.

    This class is intended to allow creating simple modifiers without having to create a new dedicated class. For example, to create a modifier that turns its input into lowercase:

     new SimpleStringModifierFunction("lower", (input) -> input.toLowerCase());
     
    • Constructor Detail

      • SimpleStringModifierFunction

        public SimpleStringModifierFunction​(String name,
                                            Function<String,​String> func)
        Creates a new instance.
        Parameters:
        name - The name of the modifier function to create.
        func - The implementation of the function.
    • Method Detail

      • getName

        public String getName()
        Description copied from interface: IFormatModifierFunction
        Gets the name by which the function should be called in a placeholder.
        Returns:
        The function name.
      • getSignature

        public String getSignature()
        Description copied from interface: IFormatModifierFunction
        Gets the expected signature of the function. This works similarly to ISSSOMTFunction.getSignature(), but it only concerns the additional arguments beyond the value of the substituted placeholder to modify (e.g. extra_arg1 in the example above).
        Returns:
        The function signature.