Class JacksonSerializer

  • All Implemented Interfaces:
    com.oracle.bmc.http.client.Serializer

    public final class JacksonSerializer
    extends java.lang.Object
    implements com.oracle.bmc.http.client.Serializer
    Implementation of Serializer for Jackson.

    Use the getDefaultSerializer() to get the instance with default configuration for java sdk.

    Exposed only for internal use.

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static com.fasterxml.jackson.databind.ObjectMapper getDefaultObjectMapper()
      Get the instance of Object Mapper with default configuration for java sdk serialization.
      static JacksonSerializer getDefaultSerializer()
      Get the instance of Jackson JSON mapper with default configuration for java sdk serialization.
      <T> T readValue​(byte[] bytes, java.lang.Class<T> type)  
      <T> T readValue​(java.lang.String s, java.lang.Class<T> type)  
      java.lang.String writeValueAsString​(java.lang.Object o)  
      • Methods inherited from class java.lang.Object

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

      • readValue

        public <T> T readValue​(java.lang.String s,
                               java.lang.Class<T> type)
                        throws java.io.IOException
        Specified by:
        readValue in interface com.oracle.bmc.http.client.Serializer
        Throws:
        java.io.IOException
      • readValue

        public <T> T readValue​(byte[] bytes,
                               java.lang.Class<T> type)
                        throws java.io.IOException
        Specified by:
        readValue in interface com.oracle.bmc.http.client.Serializer
        Throws:
        java.io.IOException
      • writeValueAsString

        public java.lang.String writeValueAsString​(java.lang.Object o)
                                            throws java.io.IOException
        Specified by:
        writeValueAsString in interface com.oracle.bmc.http.client.Serializer
        Throws:
        java.io.IOException
      • getDefaultSerializer

        public static JacksonSerializer getDefaultSerializer()
        Get the instance of Jackson JSON mapper with default configuration for java sdk serialization.
        Returns:
        JSON mapper to handle JSON serialization.
      • getDefaultObjectMapper

        public static com.fasterxml.jackson.databind.ObjectMapper getDefaultObjectMapper()
        Get the instance of Object Mapper with default configuration for java sdk serialization.
        Returns:
        Object mapper to handle JSON serialization