Class Template
java.lang.Object
io.nosqlbench.virtdata.library.basics.shared.from_long.to_string.Template
- All Implemented Interfaces:
java.util.function.LongFunction<java.lang.String>
- Direct Known Subclasses:
JoinTemplate
public class Template
extends java.lang.Object
implements java.util.function.LongFunction<java.lang.String>
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.
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
Constructors Constructor Description Template(boolean truncate, java.lang.String template, java.lang.Object... funcs)Template(java.lang.String template, java.lang.Object... funcs)Template(java.util.function.LongUnaryOperator iterOp, java.lang.String template, java.util.function.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
Modifier and Type Method Description java.lang.Stringapply(long value)
-
Constructor Details
-
Template
public Template(java.lang.String template, java.lang.Object... funcs) -
Template
public Template(boolean truncate, java.lang.String template, java.lang.Object... funcs) -
Template
public Template(java.util.function.LongUnaryOperator iterOp, java.lang.String template, java.util.function.LongFunction<?>... funcs)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
public java.lang.String apply(long value)- Specified by:
applyin interfacejava.util.function.LongFunction<java.lang.String>
-