Class JsonUtils


  • public class JsonUtils
    extends Object
    Generic utilities for operations with Json and text formats.
    • Constructor Detail

      • JsonUtils

        public JsonUtils()
    • Method Detail

      • modifyDataJson

        public String modifyDataJson​(String data,
                                     String type,
                                     io.cucumber.datatable.DataTable modifications)
                              throws Exception
        Returns the information modified
        Parameters:
        data - string containing the information
        type - type of information, it can be: json
        modifications - modifications to apply with a format: WHERE,ACTION,VALUE
        Returns:
        resulting string
        Throws:
        Exception - the exception
      • modifyDataString

        public String modifyDataString​(String data,
                                       String type,
                                       io.cucumber.datatable.DataTable modifications)
                                throws Exception
        Returns the information modified
        Parameters:
        data - string containing the information
        type - type of information, it can be: string
        modifications - modifications to apply with a format: WHERE,ACTION,VALUE
        Returns:
        resulting string
        Throws:
        Exception - the exception
      • removeNulls

        public org.hjson.JsonObject removeNulls​(org.hjson.JsonObject object)
        Eliminates null occurrences, replacing them with "TO_BE_NULL"
        Parameters:
        object - JsonObject containing json where to replace null ocurrences
        Returns:
        JsonObject