Skip to content

Provides support for serializing and deserializing IP addresses and ranges using Jackson

License

Notifications You must be signed in to change notification settings

robtimus/ip-jackson-databind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ip-jackson-databind

Maven Central Build Status Quality Gate Status Coverage Known Vulnerabilities

Provides support for serializing and deserializing IP addresses and ranges using Jackson. All you need to do is register a module. This can be done in two ways:

  1. Using ObjectMapper.registerModule:

     mapper.registerModule(IPModule.instance());
    
  2. Using ObjectMapper.findAndRegisterModules(). This will register not just an instance of IPModule, but any other module that's made available through the Service Provider Interface (SPI) mechanism:

     mapper.findAndRegisterModules();
    

No matter which way you choose, it will automatically allow all instances of IPAddress, IPRange and Subnet to be serialized and deserialized, without the need for any custom serializer or deserializer.