Class ThriftJacksonModule

java.lang.Object
com.fasterxml.jackson.databind.Module
com.linecorp.armeria.common.thrift.ThriftJacksonModule
All Implemented Interfaces:
com.fasterxml.jackson.core.Versioned

public final class ThriftJacksonModule extends com.fasterxml.jackson.databind.Module
Jackson Module for Thrift types. You can serialize ThriftCall, ThriftReply, TMessage, TBase and TApplicationException by registering this module:

 ObjectMapper objectMapper = new ObjectMapper();
 objectMapper.registerModule(new ThriftJacksonModule());
 
See Also:
  • ObjectMapper.registerModule(Module)
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.Module

    com.fasterxml.jackson.databind.Module.SetupContext
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new instance with the default settings.
    ThriftJacksonModule(boolean useNamedEnums)
    Creates a new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    void
    setupModule(com.fasterxml.jackson.databind.Module.SetupContext context)
     
    com.fasterxml.jackson.core.Version
     

    Methods inherited from class com.fasterxml.jackson.databind.Module

    getDependencies, getTypeId

    Methods inherited from class java.lang.Object

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

    • ThriftJacksonModule

      public ThriftJacksonModule()
      Creates a new instance with the default settings.
    • ThriftJacksonModule

      public ThriftJacksonModule(boolean useNamedEnums)
      Creates a new instance.
      Parameters:
      useNamedEnums - whether to serialize an enum as a string or an integer
  • Method Details

    • getModuleName

      public String getModuleName()
      Specified by:
      getModuleName in class com.fasterxml.jackson.databind.Module
    • version

      public com.fasterxml.jackson.core.Version version()
      Specified by:
      version in interface com.fasterxml.jackson.core.Versioned
      Specified by:
      version in class com.fasterxml.jackson.databind.Module
    • setupModule

      public void setupModule(com.fasterxml.jackson.databind.Module.SetupContext context)
      Specified by:
      setupModule in class com.fasterxml.jackson.databind.Module