Skip to content

Commit 7da2ecb

Browse files
Fix Javadoc
1 parent 9717f0f commit 7da2ecb

25 files changed

+737
-49
lines changed

src/main/java/co/ipregistry/api/client/IpregistryConfig.java

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,39 +22,74 @@
2222

2323

2424
/**
25-
* Configuration options for {@link IpregistryClient}.
25+
* Configuration settings for the Ipregistry API client.
26+
* <p>
27+
* This class provides configuration options for customizing the behavior of the
28+
* {@link IpregistryClient}, including API authentication, endpoint URLs, and
29+
* network timeout settings. Use the builder pattern to create instances with
30+
* custom configuration values.
31+
* </p>
32+
* <p>
33+
* Instances are created using the Builder pattern. The class uses Lombok's {@code @Builder}
34+
* annotation to generate a builder with proper constructor handling for required and optional fields.
35+
* </p>
2636
*/
2737
@Builder
2838
@Getter
2939
public class IpregistryConfig {
3040

3141
/**
32-
* The IpregistryClient API key used to authenticate calls.
42+
* Creates a new IpregistryConfig with the specified parameters.
43+
* This constructor is used internally by the Builder pattern.
44+
*
45+
* @param apiKey the API key for authentication
46+
* @param baseUrl the base URL for the API
47+
* @param connectionKeepAlive connection keep-alive timeout
48+
* @param connectionTimeout connection timeout
49+
* @param socketTimeout socket timeout
50+
*/
51+
public IpregistryConfig(String apiKey, String baseUrl, int connectionKeepAlive, int connectionTimeout, int socketTimeout) {
52+
this.apiKey = apiKey;
53+
this.baseUrl = baseUrl;
54+
this.connectionKeepAlive = connectionKeepAlive;
55+
this.connectionTimeout = connectionTimeout;
56+
this.socketTimeout = socketTimeout;
57+
}
58+
59+
/**
60+
* The API key used to authenticate requests to the Ipregistry API.
61+
* This key is required and must be obtained from your Ipregistry account dashboard.
3362
*/
3463
@NonNull
3564
private final String apiKey;
3665

3766
/**
38-
* The IpregistryClient API endpoint URL.
67+
* The base URL for the Ipregistry API endpoint.
68+
* Defaults to "https://api.ipregistry.co" but can be customized for testing or private deployments.
3969
*/
4070
@Builder.Default
4171
private String baseUrl = "https://api.ipregistry.co";
4272

4373
/**
44-
* The maximum amount of time that a connection to the server should be kept alive. This is useful for reducing the number of connections that need to be created, which can improve performance and reduce bandwidth usage.
74+
* The maximum time in milliseconds that HTTP connections should be kept alive for reuse.
75+
* Keeping connections alive reduces overhead by reusing existing connections for multiple requests.
76+
* Defaults to 15 minutes (900,000 milliseconds).
4577
*/
4678
@Builder.Default
4779
private final int connectionKeepAlive = 15 * 60 * 1000;
4880

4981
/**
50-
* The time to wait in milliseconds until a connection is established.
82+
* The maximum time in milliseconds to wait when establishing a connection to the server.
83+
* If a connection cannot be established within this time, the request will fail.
84+
* Defaults to 15 seconds (15,000 milliseconds).
5185
*/
5286
@Builder.Default
5387
private final int connectionTimeout = 15000;
5488

5589
/**
56-
* The time to wait for data in milliseconds.
57-
* Said differently, the maximum period inactivity of between two consecutive data packets.
90+
* The maximum time in milliseconds to wait for data between consecutive data packets.
91+
* This is the socket read timeout, which determines how long to wait for the server
92+
* to send data after the connection is established. Defaults to 15 seconds (15,000 milliseconds).
5893
*/
5994
@Builder.Default
6095
private final int socketTimeout = 15000;

src/main/java/co/ipregistry/api/client/model/Carrier.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,35 @@
2424

2525
/**
2626
* Wraps mobile carrier data (name, MCC, MNC) associated with an IP address.
27+
* This class provides information about the mobile network operator that owns
28+
* a mobile IP address, including the carrier name and network codes.
2729
*/
2830
@AllArgsConstructor
2931
@Data
30-
@NoArgsConstructor
3132
public final class Carrier {
3233

34+
/**
35+
* Creates a new Carrier instance with default values.
36+
* This constructor is primarily used for JSON deserialization and object initialization.
37+
*/
38+
public Carrier() {
39+
}
40+
41+
/**
42+
* The name of the mobile carrier/operator.
43+
*/
3344
@JsonProperty("name")
3445
private String name;
3546

47+
/**
48+
* Mobile Country Code (MCC) - a 3-digit code identifying the country of the mobile network.
49+
*/
3650
@JsonProperty("mcc")
3751
private String mcc;
3852

53+
/**
54+
* Mobile Network Code (MNC) - a 2-3 digit code identifying the mobile network within a country.
55+
*/
3956
@JsonProperty("mnc")
4057
private String mnc;
4158

src/main/java/co/ipregistry/api/client/model/Company.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,35 @@
2424

2525
/**
2626
* Wraps company data associated with an IP address.
27+
* Contains information about the organization that owns or operates
28+
* the IP address, including company name, domain, and business type.
2729
*/
2830
@AllArgsConstructor
2931
@Data
30-
@NoArgsConstructor
3132
public class Company {
3233

34+
/**
35+
* Creates a new Company instance with default values.
36+
* This constructor is primarily used for JSON deserialization and object initialization.
37+
*/
38+
public Company() {
39+
}
40+
41+
/**
42+
* The name of the company or organization.
43+
*/
3344
@JsonProperty("name")
3445
private String name;
3546

47+
/**
48+
* The primary domain name associated with the company.
49+
*/
3650
@JsonProperty("domain")
3751
private String domain;
3852

53+
/**
54+
* The type/category of the company (e.g., business, education, government).
55+
*/
3956
@JsonProperty("type")
4057
private CompanyType type;
4158

src/main/java/co/ipregistry/api/client/model/Connection.java

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,47 @@
2424

2525
/**
2626
* Wraps connection data associated with an IP address.
27+
* Contains network infrastructure information including ASN, organization,
28+
* routing details, and connection type classification.
2729
*/
2830
@AllArgsConstructor
2931
@Data
30-
@NoArgsConstructor
3132
public class Connection {
3233

34+
/**
35+
* Creates a new Connection instance with default values.
36+
* This constructor is primarily used for JSON deserialization and object initialization.
37+
*/
38+
public Connection() {
39+
}
40+
41+
/**
42+
* The Autonomous System Number (ASN) that manages the IP address.
43+
*/
3344
@JsonProperty("asn")
3445
private Long asn;
3546

47+
/**
48+
* The primary domain name associated with the organization.
49+
*/
3650
@JsonProperty("domain")
3751
private String domain;
3852

53+
/**
54+
* The name of the organization or ISP that owns the IP address.
55+
*/
3956
@JsonProperty("organization")
4057
private String organization;
4158

59+
/**
60+
* The IP route or subnet in CIDR notation.
61+
*/
4262
@JsonProperty("route")
4363
private String route;
4464

65+
/**
66+
* The classification of the connection type (e.g., ISP, business, hosting).
67+
*/
4568
@JsonProperty("type")
4669
private ConnectionType type;
4770

src/main/java/co/ipregistry/api/client/model/Continent.java

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,36 @@
2424

2525

2626
/**
27-
* Wraps continent data associated with an IP address.
27+
* Represents continent information associated with an IP address location.
28+
* <p>
29+
* This class contains basic continent identification data, including the continent
30+
* code and name. It provides geographical context at the continental level for
31+
* IP address geolocation results.
32+
* </p>
2833
*/
2934
@AllArgsConstructor
3035
@Builder
3136
@Data
32-
@NoArgsConstructor
3337
public class Continent {
3438

39+
/**
40+
* Creates a new Continent instance with default values.
41+
* This constructor is used for JSON deserialization and the Builder pattern.
42+
*/
43+
public Continent() {
44+
}
45+
46+
/**
47+
* The two-letter continent code (e.g., "NA" for North America, "EU" for Europe, "AS" for Asia).
48+
* This follows standard continent abbreviation conventions used in geographical data.
49+
*/
3550
@JsonProperty("code")
3651
private String code;
3752

53+
/**
54+
* The full English name of the continent (e.g., "North America", "Europe", "Asia").
55+
* Provides the human-readable name for the continent.
56+
*/
3857
@JsonProperty("name")
3958
private String name;
4059

src/main/java/co/ipregistry/api/client/model/Country.java

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,43 +25,99 @@
2525

2626

2727
/**
28-
* Wraps country data associated with an IP address.
28+
* Represents country information associated with an IP address location.
29+
* <p>
30+
* This class contains comprehensive country-level data including geographical,
31+
* demographic, political, and administrative information. It provides details
32+
* about the country where an IP address is located, including physical characteristics,
33+
* population statistics, governmental information, and cultural attributes.
34+
* </p>
2935
*/
3036
@AllArgsConstructor
3137
@Data
32-
@NoArgsConstructor
3338
public class Country {
3439

40+
/**
41+
* Creates a new Country instance with default values.
42+
* This constructor is primarily used for JSON deserialization and object initialization.
43+
*/
44+
public Country() {
45+
}
46+
47+
/**
48+
* The total land area of the country in square kilometers.
49+
* Represents the geographical size of the country's territory.
50+
*/
3551
@JsonProperty("area")
3652
private double area;
3753

54+
/**
55+
* List of ISO 3166-1 alpha-2 country codes for countries that share land borders.
56+
* Contains two-letter country codes (e.g., ["US", "MX"]) for neighboring countries.
57+
*/
3858
@JsonProperty("borders")
3959
private List<String> borders;
4060

61+
/**
62+
* The international dialing code for the country (e.g., "+1", "+44", "+33").
63+
* Used for making international phone calls to this country.
64+
*/
4165
@JsonProperty("calling_code")
4266
private String callingCode;
4367

68+
/**
69+
* The name of the country's capital city.
70+
* May be null for countries without a designated capital.
71+
*/
4472
@JsonProperty("capital")
4573
private String capital;
4674

75+
/**
76+
* The ISO 3166-1 alpha-2 country code (e.g., "US", "GB", "FR").
77+
* This is the standard two-letter country code used internationally.
78+
*/
4779
@JsonProperty("code")
4880
private String code;
4981

82+
/**
83+
* The official English name of the country (e.g., "United States", "United Kingdom").
84+
* Provides the commonly used English name for the country.
85+
*/
5086
@JsonProperty("name")
5187
private String name;
5288

89+
/**
90+
* The total population of the country.
91+
* Represents the estimated number of inhabitants in the country.
92+
*/
5393
@JsonProperty("population")
5494
private int population;
5595

96+
/**
97+
* The population density in people per square kilometer.
98+
* Calculated as population divided by total area, indicating how crowded the country is.
99+
*/
56100
@JsonProperty("population_density")
57101
private double populationDensity;
58102

103+
/**
104+
* Information about the country's flag including colors, design, and emoji representation.
105+
* Contains visual and symbolic information about the national flag.
106+
*/
59107
@JsonProperty("flag")
60108
private Flag flag;
61109

110+
/**
111+
* List of languages officially spoken or commonly used in the country.
112+
* Contains language information including codes, names, and native representations.
113+
*/
62114
@JsonProperty("languages")
63115
private List<Language> languages;
64116

117+
/**
118+
* The country code top-level domain (ccTLD) for the country (e.g., ".us", ".uk", ".fr").
119+
* This is the Internet domain extension assigned to the country.
120+
*/
65121
@JsonProperty("tld")
66122
private String tld;
67123

0 commit comments

Comments
 (0)