Class Template
java.lang.Object
io.nosqlbench.virtdata.library.basics.shared.from_long.to_string.Template
- All Implemented Interfaces:
LongFunction<String>
- Direct Known Subclasses:
FullNames,JoinTemplate
Creates a template function which will yield a string which fits the template
provided, with all occurrences of
{} substituted pair-wise with the
result of the provided functions. The number of {} entries in the template
must strictly match the number of functions or an error will be thrown.
If you need to include single quotes or other special characters, you may use a
backslash "\" in your template.
The objects passed must be functions of any of the following types:
- LongUnaryOperator
- IntUnaryOperator
- DoubleUnaryOperator
- LongFunction
- IntFunction
- DoubleFunction
- Function<Long,?>
The result of applying the input value to any of these functions is converted to a String and then stitched together according to the template provided.
-
Constructor Summary
ConstructorsConstructorDescriptionTemplate(LongUnaryOperator iterOp, String template, LongFunction<?>... funcs) If an operator is provided, it is used to change the function input value in an additional way before each function. -
Method Summary
-
Constructor Details
-
Template
-
Template
-
Template
If an operator is provided, it is used to change the function input value in an additional way before each function.- Parameters:
iterOp- A pre-generation value mapping functiontemplate- A string template containing{}anchorsfuncs- A varargs length of LongFunctions of any output type
-
-
Method Details
-
apply
- Specified by:
applyin interfaceLongFunction<String>
-