Interface StringFormat.Template<T>

Enclosing class:
StringFormat

public static interface StringFormat.Template<T>
A template that will produce instances of type T, after filling the template placeholders with the given variadic parameters.
Since:
8.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the string representation of the format.
    with(Object... params)
    Returns an instance of T from the string format filled with params.
  • Method Details

    • with

      T with(Object... params)
      Returns an instance of T from the string format filled with params.

      The correctness of the number of parameters and them being in the expected order (as defined by the template's placeholders) is checked by a compile-time plugin so for example template("WHERE id = {user_id} AND name = {name}").with(name, userId) will fail to compile.

    • toString

      String toString()
      Returns the string representation of the format.
      Overrides:
      toString in class Object