https://github.com/robtimus/ip-jackson-databind
Provides support for serializing and deserializing IP addresses and ranges using Jackson
https://github.com/robtimus/ip-jackson-databind
ip ip-address ipv4 ipv6 jackson jackson-databind java json
Last synced: 2 months ago
JSON representation
Provides support for serializing and deserializing IP addresses and ranges using Jackson
- Host: GitHub
- URL: https://github.com/robtimus/ip-jackson-databind
- Owner: robtimus
- License: apache-2.0
- Created: 2020-10-13T11:53:33.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-07-27T13:48:21.000Z (10 months ago)
- Last Synced: 2025-01-18T01:45:19.581Z (4 months ago)
- Topics: ip, ip-address, ipv4, ipv6, jackson, jackson-databind, java, json
- Language: Java
- Homepage: https://robtimus.github.io/ip-jackson-databind/
- Size: 676 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# ip-jackson-databind
[](https://search.maven.org/artifact/com.github.robtimus/ip-jackson-databind)
[](https://github.com/robtimus/ip-jackson-databind/actions/workflows/build.yml)
[](https://sonarcloud.io/summary/overall?id=com.github.robtimus%3Aip-jackson-databind)
[](https://sonarcloud.io/summary/overall?id=com.github.robtimus%3Aip-jackson-databind)
[](https://snyk.io/test/github/robtimus/ip-jackson-databind)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](https://robtimus.github.io/ip-utils/apidocs/com/github/robtimus/net/ip/IPAddress.html), [IPRange](https://robtimus.github.io/ip-utils/apidocs/com/github/robtimus/net/ip/IPRange.html) and [Subnet](https://robtimus.github.io/ip-utils/apidocs/com/github/robtimus/net/ip/Subnet.html) to be serialized and deserialized, without the need for any custom serializer or deserializer.