Package jsonvalues

Class ImmutableJsons


  • public final class ImmutableJsons
    extends Object
    Factory to create immutable jsons.
    • Method Detail

      • toImmutable

        public Json<?> toImmutable​(Json<?> json)
        converts the given json using this factory to an immutable one, if it's not immutable, returning the same instance otherwise.
        Parameters:
        json - the given json
        Returns:
        an immutable json
      • parse

        public Try parse​(String str)
        Tries to parse the string into an immutable json.
        Parameters:
        str - the string that will be parsed
        Returns:
        a Try computation
      • parse

        public Try parse​(String str,
                         ParseBuilder builder)
        Tries to parse the string into an immutable json, performing the specified transformations while the parsing.
        Parameters:
        str - the string that will be parsed
        builder - a builder with the transformations that will be applied during the parsing
        Returns:
        a Try computation