Class YamlOperations

    • Method Detail

      • parseYaml

        @NonNull
        public static Map<String,​ObjectparseYaml​(Path target)
                                                  throws IOException
        Parse the data represented in YAML in the provided target, producing an mapping of field names to Java object values.
        Parameters:
        target - the YAML file to parse
        Returns:
        the mapping of field names to Java object values
        Throws:
        IOException - if an error occurred while parsing the YAML content
      • yamlToJson

        public static org.json.JSONObject yamlToJson​(@NonNull
                                                     Map<String,​Object> map)
        Converts the provided YAML map into JSON.
        Parameters:
        map - the YAML map
        Returns:
        the JSON object
        Throws:
        org.json.JSONException - if an error occurred while building the JSON tree