Class StringMapCompositor
java.lang.Object
io.nosqlbench.virtdata.core.templates.StringMapCompositor
- All Implemented Interfaces:
ValuesArrayBinder<StringMapCompositor,String>
public class StringMapCompositor
extends Object
implements ValuesArrayBinder<StringMapCompositor,String>
StringCompositor provides a way to build strings from a string template and provided values.
The template is simply an array of string values, where odd indices represent literals, and even indices represent token positions. If the token positions contains words, then these can be used as keys for looking up values in an associated map. If not, then values are simply positional, in which case simple numerals are used as indices for debugging purposes, although they are not referenced during string interpolation.
-
Constructor Summary
ConstructorsConstructorDescriptionStringMapCompositor(String template) Create a string template which has positional tokens, in "{}" form. -
Method Summary
Modifier and TypeMethodDescriptionbindValues(StringMapCompositor context, Object[] values) Using context instance of type T, AKA the template, create and bind values to target object of type R
-
Constructor Details
-
StringMapCompositor
Create a string template which has positional tokens, in "{}" form.- Parameters:
template- The string template
-
-
Method Details
-
bindValues
Description copied from interface:ValuesArrayBinderUsing context instance of type T, AKA the template, create and bind values to target object of type R- Specified by:
bindValuesin interfaceValuesArrayBinder<StringMapCompositor,String> - Parameters:
context- A context object that knows how to provide an instance of type Rvalues- An array of values which should be bound to the new R instance- Returns:
- The new result instance of R
-