Package jsonvalues
Class ParseOptions
- java.lang.Object
-
- jsonvalues.ParseOptions
-
public class ParseOptions extends Object
Builder with different options to customize the parsing of a string into a json.
-
-
Constructor Summary
Constructors Constructor Description ParseOptions()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ParseOptions
builder()
static factory method to create a builder to customize the parsing of a string into a json.ParseOptions
withElemFilter(Predicate<? super JsPair> filter)
adds a predicate to this builder to filter the elements of the json to be parsed, removing those pairs that are evaluated to false on the predicate.ParseOptions
withElemMap(Function<JsPair,JsElem> map)
adds a function to this builder to map the elements of the json to be parsedParseOptions
withKeyFilter(Predicate<JsPath> keyFilter)
adds a function to this builder to filter the keys of the json to be parsed.ParseOptions
withKeyMap(UnaryOperator<String> keyMap)
adds a function to this builder to map the keys of the json to be parsed.
-
-
-
Method Detail
-
builder
public static ParseOptions builder()
static factory method to create a builder to customize the parsing of a string into a json.- Returns:
- a new builder instance
-
withElemFilter
public ParseOptions withElemFilter(Predicate<? super JsPair> filter)
adds a predicate to this builder to filter the elements of the json to be parsed, removing those pairs that are evaluated to false on the predicate.- Parameters:
filter
- the predicate to filter pair of elements.- Returns:
- this ParseOptions builder
-
withKeyFilter
public ParseOptions withKeyFilter(Predicate<JsPath> keyFilter)
adds a function to this builder to filter the keys of the json to be parsed.- Parameters:
keyFilter
- the predicate to filter- Returns:
- this ParseOptions builder
-
withKeyMap
public ParseOptions withKeyMap(UnaryOperator<String> keyMap)
adds a function to this builder to map the keys of the json to be parsed.- Parameters:
keyMap
- the map function which takes as input the name of the key and returns the new key name- Returns:
- this ParseOptions builder
-
withElemMap
public ParseOptions withElemMap(Function<JsPair,JsElem> map)
adds a function to this builder to map the elements of the json to be parsed- Parameters:
map
- the map function which takes as input a JsPair and returns the new JsElem- Returns:
- this ParseOptions builder
-
-