Class OpFunctions.Mod
java.lang.Object
org.apache.juneau.commons.svl.functions.OpFunctions.Mod
- All Implemented Interfaces:
VarFunction
- Enclosing class:
- OpFunctions
$op.mod.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioninvoke(VarResolverSession session, List<Object> args) Invokes this function with already-resolved, type-coerced arguments.invokeValue(VarResolverSession session, List<Object> args) Typed variant ofVarFunction.invoke(VarResolverSession, List)used by#{...} expressions.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.
-
Constructor Details
-
Mod
public Mod()Constructor.
-
-
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
public int 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
public int 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.
-
invokeValue
Description copied from interface:VarFunctionTyped variant ofVarFunction.invoke(VarResolverSession, List)used by#{...} expressions.The default delegates to
VarFunction.invoke(VarResolverSession, List).- Specified by:
invokeValuein interfaceVarFunction- Parameters:
session- The session.args- The already-evaluated arguments (typed values, not necessarily strings).- Returns:
- The result;
null means absent.
-
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).
-