Releases: maxmind/MaxMind-DB-Reader-java
Releases · maxmind/MaxMind-DB-Reader-java
4.0.0
This is a major release with several breaking changes. Please see
UPGRADING.md for detailed migration instructions.
- Java 17 or greater is now required.
- Added support for MaxMind DB files larger than 2GB. The library now uses
an internal Buffer abstraction that can handle databases exceeding the
2GB ByteBuffer limit. Files under 2GB continue to use a single ByteBuffer
for optimal performance. Requested by nonetallt. GitHub #154. Fixed by
Silvano Cerza. GitHub #289. Metadata.getBuildDate()has been replaced withbuildTime(), which returns
java.time.Instantinstead ofjava.util.Date. The instant represents the
database build time in UTC.DatabaseRecord,Metadata,Network, and internalDecodedValueclasses
have been converted to records. The following API changes were made:DatabaseRecord.getData()andDatabaseRecord.getNetwork()have been
replaced with record accessor methodsdata()andnetwork().- Simple getter methods on
Metadata(e.g.,getBinaryFormatMajorVersion(),
getDatabaseType(), etc.) have been replaced with their corresponding record
accessor methods (e.g.,binaryFormatMajorVersion(),databaseType(), etc.). Network.getNetworkAddress()andNetwork.getPrefixLength()have been
replaced with record accessor methodsnetworkAddress()andprefixLength().- Removed the legacy
DatabaseRecord(T, InetAddress, int)constructor; pass a
Networkwhen constructing records manually.
- Deserialization improvements:
- If no constructor is annotated with
@MaxMindDbConstructor, records now
use their canonical constructor automatically. For non‑record classes with
a single public constructor, that constructor is used by default. @MaxMindDbParameterannotations are now optional when parameter names
match field names in the database: for records, component names are used;
for classes, Java parameter names are used (when compiled with
-parameters). Annotations still take precedence when present.- Added
@MaxMindDbIpAddressand@MaxMindDbNetworkannotations to inject
the lookup IP address and resulting network into constructors. Annotation
metadata is cached per type to avoid repeated reflection overhead.
- If no constructor is annotated with
3.2.0
3.1.1
3.1.0
3.0.0
2.1.0
2.0.0
2.0.0-rc2
- Build using the
--releasecommand-line option so linking when using
Java 8 works.
2.0.0-rc1
- Significant API changes. The
get()andgetRecord()methods now take a
class parameter specifying the type of object to deserialize into. You
can either deserialize into aMapor to model classes that use the
MaxMindDbConstructorandMaxMindDbParameterannotations to identify
the constructors and parameters to deserialize into. jackson-databindis no longer a dependency.- The
Recordclass is now namedDatabaseRecord. This is to avoid a
conflict withjava.lang.Recordin Java 14.
1.4.0
- IMPORTANT: Java 8 is now required. If you need Java 7 support, please
continue using 1.3.1 or earlier. - The decoder will now throw an
InvalidDatabaseExceptionon an invalid
control byte in the data section rather than an
ArrayIndexOutOfBoundsException. Reported by Edwin Delgado H. GitHub
#68. - In order to improve performance when lookups are done from multiple
threads, a use ofsynchronizedhas been removed. GitHub #65 & #69. jackson-databindhas been upgraded to 2.11.0.