Class StringFunctions.Join
java.lang.Object
org.apache.juneau.commons.svl.functions.StringFunctions.Join
- All Implemented Interfaces:
VarFunction
- Enclosing class:
- StringFunctions
#{join(separator, parts...)} — concatenates parts with separator
between each pair.
Example:
#{join("/", ${tenant}, ${id})} → acme/42
A single Collection argument supplies the parts. Each part is rendered with toString() (doubles
without a trailing .0), so a nested Map or List part prints as its Java toString(),
not as JSON like the value formatter does; this inconsistency is known and intentional for now.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioninvoke(VarResolverSession session, List<Object> args) Invokes this function with already-resolved, type-coerced arguments.intmaxArity()Maximum argument count this function accepts.intminArity()Minimum argument count this function accepts.name()The function's invocation name as it appears between#{}and the opening parenthesis in the template.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.juneau.commons.svl.VarFunction
invokeValue
-
Constructor Details
-
Join
public Join()
-
-
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.- Specified by:
namein interfaceVarFunction- Returns:
- The invocation name. Never
nullor empty.
-
minArity
Description copied from interface:VarFunctionMinimum argument count this function accepts.- Specified by:
minArityin interfaceVarFunction- Returns:
- The minimum number of args.
0means the function may be called with no args. Returns-1for "any number of args" — equivalent to declaringminArity == 0 && maxArity == Integer.MAX_VALUE.
-
maxArity
Description copied from interface:VarFunctionMaximum argument count this function accepts.- Specified by:
maxArityin interfaceVarFunction- Returns:
- The maximum number of args, or
Integer.MAX_VALUEfor unbounded variadic functions.
-
invoke
Description copied from interface:VarFunctionInvokes this function with already-resolved, type-coerced arguments.The runtime resolves each
#{...}arg template against the session, then coerces the resolved string to the target Java type viaArgCoercer. The resultingList<Object>is passed in here.- Specified by:
invokein interfaceVarFunction- Parameters:
session- The current resolver session. Must not benull.args- The coerced arguments. Size is in[minArity(), maxArity()]. Each element is the type the function expects per its signature; for variadic /Object-typed slots, elements remainString.- Returns:
- The function's result as a
String. May be empty but should not benull(the runtime treatsnullas the empty string for SVL output).
-