Skip to content

Commit 15faf58

Browse files
committed
Drop DatabaseRecord InetAddress constructor
1 parent 7dd5628 commit 15faf58

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ CHANGELOG
2222
accessor methods (e.g., `binaryFormatMajorVersion()`, `databaseType()`, etc.).
2323
* `Network.getNetworkAddress()` and `Network.getPrefixLength()` have been
2424
replaced with record accessor methods `networkAddress()` and `prefixLength()`.
25+
* Removed the legacy `DatabaseRecord(T, InetAddress, int)` constructor; pass a
26+
`Network` when constructing records manually.
2527
* Deserialization improvements:
2628
* If no constructor is annotated with `@MaxMindDbConstructor`, records now
2729
use their canonical constructor automatically. For non‑record classes with
Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.maxmind.db;
22

3-
import java.net.InetAddress;
4-
53
/**
64
* DatabaseRecord represents the data and metadata associated with a database
75
* lookup.
@@ -14,15 +12,4 @@
1412
* the largest network where all of the IPs in the network have the same
1513
* data.
1614
*/
17-
public record DatabaseRecord<T>(T data, Network network) {
18-
/**
19-
* Create a new record.
20-
*
21-
* @param data the data for the record in the database.
22-
* @param ipAddress the IP address used in the lookup.
23-
* @param prefixLength the network prefix length associated with the record in the database.
24-
*/
25-
public DatabaseRecord(T data, InetAddress ipAddress, int prefixLength) {
26-
this(data, new Network(ipAddress, prefixLength));
27-
}
28-
}
15+
public record DatabaseRecord<T>(T data, Network network) {}

0 commit comments

Comments
 (0)