Class GsonMappingProvider

java.lang.Object
com.jayway.jsonpath.spi.mapper.GsonMappingProvider
All Implemented Interfaces:
MappingProvider

public class GsonMappingProvider extends Object implements MappingProvider
  • Field Details

    • logger

      private static final org.slf4j.Logger logger
    • factory

      private final Callable<com.google.gson.Gson> factory
  • Constructor Details

    • GsonMappingProvider

      public GsonMappingProvider(com.google.gson.Gson gson)
    • GsonMappingProvider

      public GsonMappingProvider(Callable<com.google.gson.Gson> factory)
    • GsonMappingProvider

      public GsonMappingProvider()
  • Method Details

    • map

      public <T> T map(Object source, Class<T> targetType, Configuration configuration)
      Specified by:
      map in interface MappingProvider
      Type Parameters:
      T - the mapped result type
      Parameters:
      source - object to map
      targetType - the type the source object should be mapped to
      configuration - current configuration
      Returns:
      return the mapped object
    • map

      public <T> T map(Object source, TypeRef<T> targetType, Configuration configuration)
      Specified by:
      map in interface MappingProvider
      Type Parameters:
      T - the mapped result type
      Parameters:
      source - object to map
      targetType - the type the source object should be mapped to
      configuration - current configuration
      Returns:
      return the mapped object