Package jsonvalues

Class ParseBuilder


  • public final class ParseBuilder
    extends Object
    Builder with different transformations to customize the parsing of a string into a json.
    • Method Detail

      • builder

        public static ParseBuilder builder()
        static factory method to create a builder to customize the parsing of a string into a json.
        Returns:
        a new builder instance
      • withValueFilter

        public ParseBuilder withValueFilter​(Predicate<? super JsPair> filter)
        adds a predicate to this builder to filter the elements of the json, 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 ParseBuilder withKeyFilter​(Predicate<? super JsPath> keyFilter)
        adds a function to this builder to filter the keys of the json.
        Parameters:
        keyFilter - the predicate to filter
        Returns:
        this ParseOptions builder
      • withKeyMap

        public ParseBuilder withKeyMap​(UnaryOperator<String> keyMap)
        adds a function to this builder to map the keys of the json.
        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 ParseBuilder withElemMap​(Function<? super JsPair,​? extends JsValue> map)
        adds a function to this builder to map the elements of the json.
        Parameters:
        map - the map function which takes as input a JsPair and returns the new JsElem
        Returns:
        this ParseOptions builder