@@ -413,51 +413,51 @@ private Optional<AnonymousIpResponse> getAnonymousIp(
413413 )
414414 );
415415 }
416+
416417 /**
417- * Look up an IP address in a GeoIP2 IP Risk.
418- *
419- * @param ipAddress IPv4 or IPv6 address to lookup.
420- * @return a IPRiskResponse for the requested IP address.
421- * @throws GeoIp2Exception if there is an error looking up the IP
422- * @throws IOException if there is an IO error
423- */
424- @ Override
425- public IpRiskResponse ipRisk (InetAddress ipAddress ) throws IOException ,
426- GeoIp2Exception {
427- Optional <IpRiskResponse > r = getIpRisk (ipAddress );
428- if (r .isEmpty ()) {
429- throw new AddressNotFoundException ("The address "
430- + ipAddress .getHostAddress () + " is not in the database." );
431- }
432- return r .get ();
433- }
418+ * Look up an IP address in a GeoIP2 IP Risk database .
419+ *
420+ * @param ipAddress IPv4 or IPv6 address to lookup.
421+ * @return a IPRiskResponse for the requested IP address.
422+ * @throws GeoIp2Exception if there is an error looking up the IP
423+ * @throws IOException if there is an IO error
424+ */
425+ @ Override
426+ public IpRiskResponse ipRisk (InetAddress ipAddress ) throws IOException ,
427+ GeoIp2Exception {
428+ Optional <IpRiskResponse > r = getIpRisk (ipAddress );
429+ if (r .isEmpty ()) {
430+ throw new AddressNotFoundException ("The address "
431+ + ipAddress .getHostAddress () + " is not in the database." );
432+ }
433+ return r .get ();
434+ }
434435
435- @ Override
436- public Optional <IpRiskResponse > tryIpRisk (InetAddress ipAddress ) throws IOException ,
437- GeoIp2Exception {
438- return getIpRisk (ipAddress );
439- }
436+ @ Override
437+ public Optional <IpRiskResponse > tryIpRisk (InetAddress ipAddress ) throws IOException ,
438+ GeoIp2Exception {
439+ return getIpRisk (ipAddress );
440+ }
440441
441- private Optional <IpRiskResponse > getIpRisk (
442- InetAddress ipAddress
443- ) throws IOException , GeoIp2Exception {
444- LookupResult <IpRiskResponse > result = this .get (
445- ipAddress ,
446- IpRiskResponse .class ,
447- DatabaseType .IP_RISK
448- );
449- IpRiskResponse response = result .getModel ();
450- if (response == null ) {
451- return Optional .empty ();
452- }
453- return Optional .of (
454- new IpRiskResponse (
455- response ,
456- result .getIpAddress (),
457- result .getNetwork ()
458- )
459- );
460- }
442+ private Optional <IpRiskResponse > getIpRisk ( InetAddress ipAddress ) throws IOException ,
443+ GeoIp2Exception {
444+ LookupResult <IpRiskResponse > result = this .get (
445+ ipAddress ,
446+ IpRiskResponse .class ,
447+ DatabaseType .IP_RISK
448+ );
449+ IpRiskResponse response = result .getModel ();
450+ if (response == null ) {
451+ return Optional .empty ();
452+ }
453+ return Optional .of (
454+ new IpRiskResponse (
455+ response ,
456+ result .getIpAddress (),
457+ result .getNetwork ()
458+ )
459+ );
460+ }
461461
462462 /**
463463 * Look up an IP address in a GeoLite2 ASN database.
0 commit comments