Interface StringApplier

All Superinterfaces:
Applier<String>

public interface StringApplier extends Applier<String>
A specialization of Applier for handling String transformations.

The StringApplier interface provides a fluent API to apply successive string operations, such as formatting, replacement, or any other transformation. It extends Applier with methods that are specific to strings.

  • Method Details

    • apply

      @NotNull @NotNull StringApplier apply(Applier.Priority priority, UnaryOperator<String> operator)
      Applies a transformation to the string with the specified priority.
      Specified by:
      apply in interface Applier<String>
      Parameters:
      priority - the priority at which to apply the operator.
      operator - the transformation to apply.
      Returns:
      this StringApplier instance for chaining.
      Throws:
      NullPointerException - if operator is null.
    • apply

      @NotNull @NotNull StringApplier apply(UnaryOperator<String> operator)
      Applies a transformation to the string at the default priority (NORMAL).
      Specified by:
      apply in interface Applier<String>
      Parameters:
      operator - the transformation to apply.
      Returns:
      this StringApplier instance for chaining.
      Throws:
      NullPointerException - if operator is null.
    • toString

      String toString()
      Returns the resulting string after all transformations have been applied.
      Overrides:
      toString in class Object
      Returns:
      the transformed string.
    • simplified

      static StringApplier simplified(String string)
      Creates a simplified StringApplier for the provided string.
      Parameters:
      string - the string to transform.
      Returns:
      a new instance of a simplified StringApplier.
    • simplified

      static StringApplier simplified(StringApplier applier)
      Creates a simplified StringApplier by extracting the result from an existing StringApplier.
      Parameters:
      applier - the existing StringApplier.
      Returns:
      a new instance of a simplified StringApplier initialized with the result.
    • prioritized

      static StringApplier prioritized(String string)
      Creates a prioritized StringApplier for the provided string.
      Parameters:
      string - the string to transform.
      Returns:
      a new instance of a prioritized StringApplier.
    • prioritized

      static StringApplier prioritized(StringApplier applier)
      Creates a prioritized StringApplier by extracting the result from an existing StringApplier.
      Parameters:
      applier - the existing StringApplier.
      Returns:
      a new instance of a prioritized StringApplier initialized with the result.