33import com .google .common .annotations .VisibleForTesting ;
44import com .google .common .cache .LoadingCache ;
55import io .ipdata .client .error .IpdataException ;
6- import io .ipdata .client .model .Asn ;
6+ import io .ipdata .client .model .AsnModel ;
77import io .ipdata .client .model .Currency ;
88import io .ipdata .client .model .IpdataModel ;
9- import io .ipdata .client .model .Threat ;
9+ import io .ipdata .client .model .ThreatModel ;
1010import io .ipdata .client .model .TimeZone ;
1111import java .util .List ;
1212import java .util .concurrent .ExecutionException ;
1313import java .util .concurrent .TimeUnit ;
1414import lombok .Builder ;
1515import lombok .experimental .Delegate ;
1616
17-
1817@ Builder
1918@ VisibleForTesting
2019
@@ -34,10 +33,10 @@ public class CachingInternalClient implements IpdataInternalClient, IpdataIntern
3433
3534 private LoadingCache <String , IpdataModel > ipdataCache ;
3635 private LoadingCache <HashPair <String , String >, IpdataModel > fieldsCache ;
37- private LoadingCache <String , Asn > asnCache ;
36+ private LoadingCache <String , AsnModel > asnCache ;
3837 private LoadingCache <String , TimeZone > tzCache ;
3938 private LoadingCache <String , Currency > currencyCache ;
40- private LoadingCache <String , Threat > threatCache ;
39+ private LoadingCache <String , ThreatModel > threatCache ;
4140
4241 @ Override
4342 public IpdataModel getFields (String ip , String fields ) throws IpdataException {
@@ -49,7 +48,7 @@ public IpdataModel getFields(String ip, String fields) throws IpdataException {
4948 }
5049
5150 @ Override
52- public Asn asn (String ip ) throws IpdataException {
51+ public AsnModel asn (String ip ) throws IpdataException {
5352 try {
5453 return asnCache .get (ip );
5554 } catch (ExecutionException e ) {
@@ -76,7 +75,7 @@ public Currency currency(String ip) throws IpdataException {
7675 }
7776
7877 @ Override
79- public Threat threat (String ip ) throws IpdataException {
78+ public ThreatModel threat (String ip ) throws IpdataException {
8079 try {
8180 return threatCache .get (ip );
8281 } catch (ExecutionException e ) {
@@ -98,19 +97,19 @@ public List<IpdataModel> bulkIpdata(List<String> ips) throws IpdataException {
9897 return ipdataInternalClient .bulkIpdata (ips );
9998 }
10099
101- @ Delegate (types = IpdataInternalSingleFieldClient .class , excludes = $ DelegateExcludes .class )
100+ @ Delegate (types = IpdataInternalSingleFieldClient .class , excludes = DelegateExcludes .class )
102101 IpdataInternalSingleFieldClient getIpdataInternalSingleFieldClient () {
103102 return ipdataInternalSingleFieldClient ;
104103 }
105104
106- private interface $ DelegateExcludes {
107- Asn asn (String ip );
105+ private interface DelegateExcludes {
106+ AsnModel asn (String ip );
108107
109108 TimeZone timeZone (String ip );
110109
111110 Currency currency (String ip );
112111
113- Threat threat (String ip );
112+ ThreatModel threat (String ip );
114113 }
115114
116115}
0 commit comments