Class JSONFormatterJsonToPdxConverter

java.lang.Object
org.springframework.geode.data.json.converter.support.JSONFormatterJsonToPdxConverter
All Implemented Interfaces:
org.springframework.core.convert.converter.Converter<String,org.apache.geode.pdx.PdxInstance>, JsonToPdxConverter

public class JSONFormatterJsonToPdxConverter extends Object implements JsonToPdxConverter
A JsonToPdxConverter implementation using the Apache Geode JSONFormatter to convert from a JSON String to a PdxInstance.
Since:
1.3.0
See Also:
  • Constructor Details

    • JSONFormatterJsonToPdxConverter

      public JSONFormatterJsonToPdxConverter()
  • Method Details

    • getJsonToObjectConverter

      @NonNull protected JsonToObjectConverter getJsonToObjectConverter()
      Returns a reference to the configured JsonToObjectConverter used to convert from JSON to an Object.
      Returns:
      a reference to the configured JsonToObjectConverter; never null.
      See Also:
    • convert

      @NonNull public final org.apache.geode.pdx.PdxInstance convert(@NonNull String json)
      Specified by:
      convert in interface org.springframework.core.convert.converter.Converter<String,org.apache.geode.pdx.PdxInstance>
    • adapt

      @NonNull protected org.apache.geode.pdx.PdxInstance adapt(@NonNull Object target)
      Adapts the given Object as a PdxInstance.
      Parameters:
      target - Object to adapt as PDX; must not be null.
      Returns:
      a PdxInstance representing the given Object.
      See Also:
    • convertJsonToObjectToPdx

      @NonNull protected org.apache.geode.pdx.PdxInstance convertJsonToObjectToPdx(@NonNull String json)
      Converts the given JSON into a Object and then adapts the Object as a PdxInstance.
      Parameters:
      json - JSON to convert into an Object into PDX.
      Returns:
      a PdxInstance converted from the given JSON.
      See Also:
    • convertJsonToPdx

      @NonNull protected org.apache.geode.pdx.PdxInstance convertJsonToPdx(@NonNull String json)
      Converts the given JSON to PDX.
      Parameters:
      json - String containing JSON to convert to PDX; must not be null.
      Returns:
      JSON for the given PDX.
      See Also:
    • jsonFormatterFromJson

      @NonNull protected org.apache.geode.pdx.PdxInstance jsonFormatterFromJson(@NonNull String json)
      Converts JSON into PDX using JSONFormatter.fromJSON(String).
      Parameters:
      json - JSON to convert to PDX; must not be null.
      Returns:
      PDX generated from the given, required JSON; never null.
      See Also:
      • JSONFormatter.fromJSON(String)
      • PdxInstance
    • wrap

      @NonNull protected PdxInstanceWrapper wrap(@NonNull org.apache.geode.pdx.PdxInstance pdxInstance)
      Wraps the given PdxInstance in a new instance of PdxInstanceWrapper.
      Parameters:
      pdxInstance - PdxInstance to wrap.
      Returns:
      a new instance of PdxInstanceWrapper wrapping the given PdxInstance.
      See Also: