public class SplitOperator extends Object
An example shows it all:
split().on("yes;or;no").into([anarray]);
produces
{ "anarray" : ["yes" , "or" , "no" ] }
You can change the delimiters using delim(java.lang.String)
. For example:
split().delim(":").on("yes:or:no").into([anarray]);
Constructor and Description |
---|
SplitOperator()
Default ctor.
|
Modifier and Type | Method and Description |
---|---|
SplitOperator |
delim(String s)
Reset the delimiter.
|
SplitOperator |
escape(char start,
char end)
Enable escaping
|
SplitOperator |
inferTypes()
Activate type inference.
|
boolean |
into(Tuple tuple)
Fire the operator and store the result in the passed tuple.
|
SplitOperator |
on(String input)
Set the input value to split
|
SplitOperator |
on(Tuple input)
Set the input value to split
|
SplitOperator |
trim()
Trim the values, removing starting and trailing '"'
|
public SplitOperator inferTypes()
public SplitOperator trim()
public SplitOperator delim(String s)
s
- a valid regex used to delimit valuespublic SplitOperator escape(char start, char end)
start
- the start escaping characterend
- the end escaping characterpublic SplitOperator on(String input)
input
- the input Stringpublic SplitOperator on(Tuple input)
input
- the input Tuplepublic boolean into(Tuple tuple)
tuple
- the destination tupleCopyright © 2022. All rights reserved.