Class FastJsonHelper

  • All Implemented Interfaces:

    
    public class FastJsonHelper
    
                        
    FastJson Util, not recommended for use in complex types
    
    Fastjson NOTE
    * LocalDateTime as "2023-04-05 06:07:08"
    * ZoneDateTime as "2023-04-05T06:07:08[America/New_York]"
    * OffsetDateTime as "2023-04-05T06:07:08-04:00"
    
    Since:

    2022-04-22

    Author:

    trydofor

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
      FastJsonHelper()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      static <T> T object(String json, @NotNull() ResolvableType targetType) Deserialization with the wings convention
      static <T> T object(String json, @NotNull() TypeDescriptor targetType) Deserialization with the wings convention
      static <T> T object(String json, @NotNull() Type targetType) Deserialization with the wings convention
      static <T> T object(String json, @NotNull() Class<out Object> targetType, Array<Class<out Object>> generics) Deserialization with the wings convention
      static JSONObject object(String json) Deserialization with the wings convention
      static <T> T object(InputStream json, @NotNull() ResolvableType targetType) Deserialization with the wings convention
      static <T> T object(InputStream json, @NotNull() TypeDescriptor targetType) Deserialization with the wings convention
      static <T> T object(InputStream json, @NotNull() Type targetType) Deserialization with the wings convention
      static <T> T object(InputStream json, @NotNull() Class<out Object> targetType, Array<Class<out Object>> generics) Deserialization with the wings convention
      static JSONObject object(InputStream json) Deserialization with the wings convention
      static <T> T object(Array<byte> json, @NotNull() ResolvableType targetType) Deserialization with the wings convention
      static <T> T object(Array<byte> json, @NotNull() TypeDescriptor targetType) Deserialization with the wings convention
      static <T> T object(Array<byte> json, @NotNull() Type targetType) Deserialization with the wings convention
      static <T> T object(Array<byte> json, @NotNull() Class<out Object> targetType, Array<Class<out Object>> generics) Deserialization with the wings convention
      static JSONObject object(Array<byte> json) Deserialization with the wings convention
      static String string(Object obj) Serialization using the wings convention, output as string wherever possible to ensure data precision, but not affecting Java type inverse parsing
      static Array<byte> bytes(Object obj)
      static String string(Object obj, Array<Filter> filters) Serialization using the wings convention, output as string wherever possible to ensure data precision, but not affecting Java type inverse parsing
      static Array<byte> bytes(Object obj, Array<Filter> filters)
      static JSONPath path(@NotNull() String path) weak cached JsonPath
      static JSONPath path(@NotNull() String path, Type type) weak cached JsonPath
      static JSONPath path(@NotNull() String path, Class<out Object> type, Array<Class<out Object>> generics) weak cached JsonPath
      static JSONPath path(@NotNull() String path, Type type, Array<JSONPath.Feature> features) weak cached JsonPath
      static JSONPath path(@NotNull() Array<String> paths, Array<Type> types, Array<JSONPath.Feature> features) cached JsonPath
      static JSONPath path(@NotNull() Array<String> paths, Array<Type> types, Array<JSONPath.Feature> pathFeatures, Array<JSONReader.Feature> features) cached JsonPath
      static Array<long> features(int size, Array<JSONPath.Feature> features)
      static long featureMask(Array<JSONPath.Feature> features)
      static String getString(JSONObject node, String field, String defaults)
      static boolean getBoolean(JSONObject node, String field, boolean defaults)
      static int getInt(JSONObject node, String field, int defaults)
      static long getLong(JSONObject node, String field, long defaults)
      static double getDouble(JSONObject node, String field, double defaults)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FastJsonHelper

        FastJsonHelper()
    • Method Detail

      • object

        @Contract(value = "!null,_->!null") static <T> T object(String json, @NotNull() ResolvableType targetType)

        Deserialization with the wings convention

      • object

        @Contract(value = "!null,_->!null") static <T> T object(String json, @NotNull() TypeDescriptor targetType)

        Deserialization with the wings convention

      • object

        @Contract(value = "!null,_->!null") static <T> T object(String json, @NotNull() Type targetType)

        Deserialization with the wings convention

      • object

        @Contract(value = "!null,_,_->!null") static <T> T object(String json, @NotNull() Class<out Object> targetType, Array<Class<out Object>> generics)

        Deserialization with the wings convention

      • object

        @Contract(value = "!null->!null") static JSONObject object(String json)

        Deserialization with the wings convention

      • object

        @Contract(value = "!null,_->!null") static <T> T object(InputStream json, @NotNull() ResolvableType targetType)

        Deserialization with the wings convention

      • object

        @Contract(value = "!null,_->!null") static <T> T object(InputStream json, @NotNull() TypeDescriptor targetType)

        Deserialization with the wings convention

      • object

        @Contract(value = "!null,_->!null") static <T> T object(InputStream json, @NotNull() Type targetType)

        Deserialization with the wings convention

      • object

        @Contract(value = "!null->!null") static JSONObject object(InputStream json)

        Deserialization with the wings convention

      • object

        @Contract(value = "!null,_->!null") static <T> T object(Array<byte> json, @NotNull() ResolvableType targetType)

        Deserialization with the wings convention

      • object

        @Contract(value = "!null,_->!null") static <T> T object(Array<byte> json, @NotNull() TypeDescriptor targetType)

        Deserialization with the wings convention

      • object

        @Contract(value = "!null,_->!null") static <T> T object(Array<byte> json, @NotNull() Type targetType)

        Deserialization with the wings convention

      • object

        @Contract(value = "!null,_,_->!null") static <T> T object(Array<byte> json, @NotNull() Class<out Object> targetType, Array<Class<out Object>> generics)

        Deserialization with the wings convention

      • object

        @Contract(value = "!null->!null") static JSONObject object(Array<byte> json)

        Deserialization with the wings convention

      • string

        @Contract(value = "!null->!null") static String string(Object obj)

        Serialization using the wings convention, output as string wherever possible to ensure data precision, but not affecting Java type inverse parsing

      • string

        @Contract(value = "!null,_->!null") static String string(Object obj, Array<Filter> filters)

        Serialization using the wings convention, output as string wherever possible to ensure data precision, but not affecting Java type inverse parsing

      • bytes

        @Contract(value = "!null,_->!null") static Array<byte> bytes(Object obj, Array<Filter> filters)
      • path

         static JSONPath path(@NotNull() String path)

        weak cached JsonPath

      • path

         static JSONPath path(@NotNull() String path, Type type)

        weak cached JsonPath

      • path

         static JSONPath path(@NotNull() String path, Type type, Array<JSONPath.Feature> features)

        weak cached JsonPath

      • path

         static JSONPath path(@NotNull() Array<String> paths, Array<Type> types, Array<JSONPath.Feature> pathFeatures, Array<JSONReader.Feature> features)

        cached JsonPath

      • getBoolean

         static boolean getBoolean(JSONObject node, String field, boolean defaults)
      • getInt

         static int getInt(JSONObject node, String field, int defaults)
      • getLong

         static long getLong(JSONObject node, String field, long defaults)
      • getDouble

         static double getDouble(JSONObject node, String field, double defaults)