All Downloads are FREE. Search and download functionalities are using the official Maven repository.

arrow.integrations.jackson.module.ArrowModule.kt Maven / Gradle / Ivy

There is a newer version: 0.14.2-alpha.2
Show newest version
package arrow.integrations.jackson.module

import com.fasterxml.jackson.databind.ObjectMapper

public fun ObjectMapper.registerArrowModule(
  eitherModuleConfig: EitherModuleConfig = EitherModuleConfig("left", "right"),
  validatedModuleConfig: ValidatedModuleConfig = ValidatedModuleConfig("invalid", "valid"),
  iorModuleConfig: IorModuleConfig = IorModuleConfig("left", "right")
): ObjectMapper =
  registerModules(
    NonEmptyListModule,
    OptionModule,
    EitherModule(eitherModuleConfig.leftFieldName, eitherModuleConfig.rightFieldName),
    ValidatedModule(validatedModuleConfig.invalidFieldName, validatedModuleConfig.validFieldName),
    IorModule(iorModuleConfig.leftFieldName, iorModuleConfig.rightFieldName)
  )

public data class EitherModuleConfig(val leftFieldName: String, val rightFieldName: String)

public data class ValidatedModuleConfig(val invalidFieldName: String, val validFieldName: String)

public data class IorModuleConfig(val leftFieldName: String, val rightFieldName: String)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy