Skip to content

Commit f61d2b4

Browse files
committed
Move model and record classes to records
This will eventually reduce boilerplate and provide a more consistent experience for users. I am leaving the old getter methods as deprecated for one major version to give users the ability to upgrade before having to migrate to the updated accessors. There are other breaking changes, but these will likely not affect most users.
1 parent bf1dda7 commit f61d2b4

30 files changed

+2274
-1346
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ CHANGELOG
44
5.0.0
55
------------------
66

7+
* **BREAKING:** All model and record classes have been converted to Java records.
8+
This provides a more modern, immutable data model with automatic implementations
9+
of `equals()`, `hashCode()`, and `toString()`. The abstract classes
10+
`AbstractRecord`, `AbstractNamedRecord`, `AbstractResponse`,
11+
`AbstractCountryResponse`, `AbstractCityResponse`, and `IpBaseResponse` have
12+
been removed. Record components can be accessed using the new accessor methods
13+
(e.g., `city()`, `country()`, `location()`). The traditional getter methods
14+
(e.g., `getCity()`, `getCountry()`, `getLocation()`) are still available but
15+
have been deprecated and will be removed in version 6.0.0.
16+
* **BREAKING:** `RepresentedCountry` is now a separate record type instead of
17+
extending `Country`. It shares the same fields as `Country` but adds a `type`
18+
field.
719
* The deprecation notices for IP Risk database support have been removed.
820
IP Risk database support will continue to be maintained.
921
* **BREAKING:** The deprecated `WebServiceClient.Builder` methods

src/main/java/com/maxmind/geoip2/model/AbstractCityResponse.java

Lines changed: 0 additions & 131 deletions
This file was deleted.

src/main/java/com/maxmind/geoip2/model/AbstractCountryResponse.java

Lines changed: 0 additions & 108 deletions
This file was deleted.

src/main/java/com/maxmind/geoip2/model/AbstractResponse.java

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)