Class JsonYamlUtil


  • public class JsonYamlUtil
    extends Object
    Author:
    Madhav Krishna
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static String convertObjectToJsonString​(Object obj)  
      static <T> T readNoException​(String path, com.jayway.jsonpath.TypeRef<T> type, com.jayway.jsonpath.DocumentContext yamlDocCtx)  
      static <T> T readNoException​(String yamlPath, com.jayway.jsonpath.TypeRef<T> typeRef, com.jayway.jsonpath.DocumentContext defaultProperties, com.jayway.jsonpath.DocumentContext overriddenProperties)
      This method first read the overridden property if that does not exist in overridenProperties then read it from defaultProperties.
      static <T> T readNoException​(String path, Class<T> type, com.jayway.jsonpath.DocumentContext yamlDocCtx)  
      static <T> T readNoException​(String yamlPath, Class<T> clazz, com.jayway.jsonpath.DocumentContext defaultProperties, com.jayway.jsonpath.DocumentContext overriddenProperties)
      This method first read the overridden property if that does not exist in overridenProperties then read it from defaultProperties.
    • Method Detail

      • readNoException

        public static <T> T readNoException​(String path,
                                            Class<T> type,
                                            com.jayway.jsonpath.DocumentContext yamlDocCtx)
      • readNoException

        public static <T> T readNoException​(String path,
                                            com.jayway.jsonpath.TypeRef<T> type,
                                            com.jayway.jsonpath.DocumentContext yamlDocCtx)
      • readNoException

        public static <T> T readNoException​(String yamlPath,
                                            Class<T> clazz,
                                            com.jayway.jsonpath.DocumentContext defaultProperties,
                                            com.jayway.jsonpath.DocumentContext overriddenProperties)
        This method first read the overridden property if that does not exist in overridenProperties then read it from defaultProperties.
        Type Parameters:
        T -
        Parameters:
        yamlPath -
        clazz -
        defaultProperties -
        overriddenProperties -
        Returns:
      • readNoException

        public static <T> T readNoException​(String yamlPath,
                                            com.jayway.jsonpath.TypeRef<T> typeRef,
                                            com.jayway.jsonpath.DocumentContext defaultProperties,
                                            com.jayway.jsonpath.DocumentContext overriddenProperties)
        This method first read the overridden property if that does not exist in overridenProperties then read it from defaultProperties.
        Type Parameters:
        T -
        Parameters:
        yamlPath -
        typeRef -
        defaultProperties -
        overriddenProperties -
        Returns:
      • convertObjectToJsonString

        public static String convertObjectToJsonString​(Object obj)
                                                throws com.fasterxml.jackson.core.JsonProcessingException
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException