Class DmxFunModule

java.lang.Object
com.fasterxml.jackson.databind.Module
com.fasterxml.jackson.databind.module.SimpleModule
dmx.fun.jackson.DmxFunModule
All Implemented Interfaces:
com.fasterxml.jackson.core.Versioned, Serializable

@NullMarked public class DmxFunModule extends com.fasterxml.jackson.databind.module.SimpleModule
Jackson module that registers serializers and deserializers for all dmx-fun types.

Register manually:

ObjectMapper mapper = new ObjectMapper().registerModule(new DmxFunModule());

Or rely on auto-discovery:

ObjectMapper mapper = new ObjectMapper().findAndRegisterModules();
See Also:
  • Nested Class Summary

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

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

    Fields inherited from class com.fasterxml.jackson.databind.module.SimpleModule

    _abstractTypes, _deserializerModifier, _deserializers, _hasExplicitName, _keyDeserializers, _keySerializers, _mixins, _name, _namingStrategy, _serializerModifier, _serializers, _subtypes, _valueInstantiators, _version
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new instance of DmxFunModule.
  • Method Summary

    Methods inherited from class com.fasterxml.jackson.databind.module.SimpleModule

    _checkNotNull, addAbstractTypeMapping, addDeserializer, addKeyDeserializer, addKeySerializer, addSerializer, addSerializer, addValueInstantiator, getModuleName, getTypeId, registerSubtypes, registerSubtypes, registerSubtypes, setAbstractTypes, setDeserializerModifier, setDeserializers, setKeyDeserializers, setKeySerializers, setMixInAnnotation, setNamingStrategy, setSerializerModifier, setSerializers, setupModule, setValueInstantiators, version

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

    getDependencies

    Methods inherited from class Object

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

    • DmxFunModule

      public DmxFunModule()
      Constructs a new instance of DmxFunModule.

      This module extends SimpleModule and is specifically designed to handle serialization and deserialization for various dmx-fun types. During construction, it registers custom serializers and deserializers for types such as Try, Either, Option, Result, Validated, Tuple2, Tuple3, Tuple4, and NonEmptyList.

      It is used to ensure these types are correctly processed by Jackson's ObjectMapper.

      Typical usage includes registering this module with an ObjectMapper either manually or automatically.