Class FactCastJson

java.lang.Object
org.factcast.core.util.FactCastJson

public final class FactCastJson extends Object
Statically shared ObjectMapper reader & writer to be used within FactCast for Headers and FactCast-specific objects.

You must not change the configuration of this mapper, and it should not be used outside of FactCast.

Author:
[email protected]
  • Constructor Details

    • FactCastJson

      public FactCastJson()
  • Method Details

    • copy

      public static <T> T copy(@NonNull T toCopy)
    • writeValueAsString

      public static <T> String writeValueAsString(@NonNull T value)
    • readValue

      public static <T> T readValue(@NonNull @NonNull Class<T> class1, @NonNull @NonNull String json)
    • readValue

      public static <T> T readValue(@NonNull @NonNull com.fasterxml.jackson.core.type.TypeReference<T> class1, @NonNull @NonNull String json)
    • readValue

      public static <T> T readValue(@NonNull @NonNull Class<T> class1, @NonNull @NonNull InputStream json)
    • toObjectNode

      public static com.fasterxml.jackson.databind.node.ObjectNode toObjectNode(String json)
    • newObjectNode

      public static com.fasterxml.jackson.databind.node.ObjectNode newObjectNode()
    • writeValueAsPrettyString

      public static String writeValueAsPrettyString(Object o)
    • addSerToHeader

      public static String addSerToHeader(long ser, String jsonHeader)
    • toPrettyString

      public static String toPrettyString(String jsonString)
    • readJSON

      public static String readJSON(File file) throws IOException
      Throws:
      IOException
    • valueToTree

      public static <T> com.fasterxml.jackson.databind.JsonNode valueToTree(T object)
    • readTree

      public static com.fasterxml.jackson.databind.JsonNode readTree(String json) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • convertValue

      public static <T> T convertValue(Object fromValue, Class<T> toValueType)
    • toJsonNode

      public static com.fasterxml.jackson.databind.JsonNode toJsonNode(Map<String,Object> jsonAsMap)
    • writeValueAsBytes

      public static byte[] writeValueAsBytes(Object a)
    • readValueFromBytes

      public static <A> A readValueFromBytes(Class<A> type, byte[] bytes)
    • mapper

      public static com.fasterxml.jackson.databind.ObjectMapper mapper()
    • getObjectMapper

      public static com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()