1212 * This class contains minFraud response data related to the IP location
1313 */
1414public final class IpAddress extends InsightsResponse implements IpAddressInterface {
15- private final GeoIp2Country country ;
1615 private final GeoIp2Location location ;
1716 private final Double risk ;
1817 private final List <IpRiskReason > riskReasons ;
1918
19+ /**
20+ * @param city The city information.
21+ * @param continent The continent information.
22+ * @param country The country information.
23+ * @param location The location information.
24+ * @param maxmind MaxMind-specific information.
25+ * @param postal The postal information.
26+ * @param registeredCountry The information about the country where the IP was registered.
27+ * @param representedCountry The represented country, e.g., for military bases in other countries.
28+ * @param risk The IP risk.
29+ * @param riskReasons The reasons for the IP risk.
30+ * @param subdivisions The list of subdivisions.
31+ * @param traits Information about various other IP traits.
32+ */
2033 public IpAddress (
2134 @ JsonProperty ("city" ) City city ,
2235 @ JsonProperty ("continent" ) Continent continent ,
23- @ JsonProperty ("country" ) GeoIp2Country country ,
36+ @ JsonProperty ("country" ) Country country ,
2437 @ JsonProperty ("location" ) GeoIp2Location location ,
2538 @ JsonProperty ("maxmind" ) MaxMind maxmind ,
2639 @ JsonProperty ("postal" ) Postal postal ,
@@ -32,56 +45,13 @@ public IpAddress(
3245 @ JsonProperty ("traits" ) Traits traits
3346 ) {
3447 super (city , continent , country , location , maxmind , postal , registeredCountry , representedCountry , subdivisions , traits );
35- this .country = country == null ? new GeoIp2Country () : country ;
3648 this .location = location == null ? new GeoIp2Location () : location ;
3749 this .risk = risk ;
3850 this .riskReasons = Collections .unmodifiableList (riskReasons == null ? new ArrayList <>() : riskReasons );
3951 }
4052
41- /**
42- * @param city The city information.
43- * @param continent The continent information.
44- * @param country The country information.
45- * @param location The location information.
46- * @param maxmind MaxMind-specific information.
47- * @param postal The postal information.
48- * @param registeredCountry The information about the country where the IP was registered.
49- * @param representedCountry The represented country, e.g., for military bases in other countries.
50- * @param risk The IP risk.
51- * @param subdivisions The list of subdivisions.
52- * @param traits Information about various other IP traits.
53- * @deprecated This constructor only exists for backward compatibility
54- * and will be removed in the next major release.
55- */
56- public IpAddress (
57- City city ,
58- Continent continent ,
59- GeoIp2Country country ,
60- GeoIp2Location location ,
61- MaxMind maxmind ,
62- Postal postal ,
63- Country registeredCountry ,
64- RepresentedCountry representedCountry ,
65- Double risk ,
66- List <Subdivision > subdivisions ,
67- Traits traits
68- ) {
69- this (city , continent , country , location , maxmind , postal , registeredCountry , representedCountry ,
70- risk , null , subdivisions , traits );
71- }
72-
7353 public IpAddress () {
74- this (null , null , null , null , null , null , null , null , null , null , null );
75- }
76-
77- /**
78- * @return Country record for the requested IP address. This object
79- * represents the country where MaxMind believes the end user is
80- * located.
81- */
82- @ Override
83- public GeoIp2Country getCountry () {
84- return country ;
54+ this (null , null , null , null , null , null , null , null , null , null , null , null );
8555 }
8656
8757 /**
0 commit comments