public class ToKvOperator extends Object
{ "top" : { "a"=1, "b"="hello world"}, "c"=[1,2,3] }
stored in some Tuple, say the Tuple input. If you run :
String result = toKv().on(input);
it produces a single String containing:
top.a="1" top.b="hello world" c="[1,2,3]"
| Constructor and Description |
|---|
ToKvOperator()
Create a flatten operator.
|
| Modifier and Type | Method and Description |
|---|---|
ToKvOperator |
fieldSplit(String delimiter)
Reset the String used to delimit key-value pairs.
|
ToKvOperator |
nestedSeparator(String separator)
Set the string to be used to separate nested properties.
|
String |
on(Tuple input)
Make the operator work on an input Tuple.
|
ToKvOperator |
valueSplit(String delimiter)
Reset the String used to delimit keys from values.
|
public String on(Tuple input)
input - the input Tuplepublic ToKvOperator valueSplit(String delimiter)
delimiter - the new delimiter, it must be a valid regex.public ToKvOperator fieldSplit(String delimiter)
delimiter - the new delimiter, it must be a valid regex.public ToKvOperator nestedSeparator(String separator)
separator - the separator you want.Copyright © 2023. All rights reserved.