Class StringFunctions.Format
java.lang.Object
org.apache.juneau.commons.svl.TypedFunction
org.apache.juneau.commons.svl.functions.StringFunctions.Format
- All Implemented Interfaces:
VarFunction
- Enclosing class:
- StringFunctions
#{format(pattern, args...)} — Java formatter-style
formatting. Pattern uses Java Formatter syntax (e.g. %s,
%d, %.2f). Variadic args; coerced per Java Formatter rules at
invocation.
Example:
#{format("%s-%03d", ${prefix}, ${counter})}
All args are passed as raw String values; format specifiers like %d will
convert numeric strings via Integer.parseInt(java.lang.String, int) / Long.parseLong(java.lang.String, int) as needed.
%s accepts any string verbatim.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.juneau.commons.svl.TypedFunction
invoke, maxArity, minArity
-
Constructor Details
-
Format
public Format()
-
-
Method Details
-
name
Description copied from interface:VarFunctionThe function's invocation name as it appears between#{}and the opening parenthesis in the template. Must consist of ASCII letters, digits, and underscores; must begin with a letter.- Returns:
- The invocation name. Never
nullor empty.
-
invoke
-