Add Javadoc generation scripts and enhance README examples

Introduce Javadoc-related files (`javadoc.sh`, `options`, and `packages`) for API documentation generation. Update README to improve clarity on usage examples and remove redundant "Example" headings for a cleaner presentation.
This commit is contained in:
2025-03-23 13:12:45 +01:00
parent 042678a6d7
commit 30ffb7c4b4
4 changed files with 45 additions and 24 deletions
+18 -24
View File
@@ -27,14 +27,22 @@ BETA
## Methods Overview
### 1. `zoneListAll`
The following text focuses on the basic methods. For further information take a look at the [javadoc of the CfDnsClient](docs/apidocs/codes/thischwa/cf/CfDnsClient.html).
### Instantiation of `CfDnsClient`
```java
CfDnsClient client = new CfDnsClient(
"email@example.com", "yourApiKey", "yourApiToken"
);
```
### `zoneListAll`
Retrieve all zones within the Cloudflare account.
- **Returns**: A list of `ZoneEntity` objects.
**Example:**
```java
List<ZoneEntity> zones = cfDnsClient.zoneListAll();
zones.forEach(zone -> System.out.println("Zone: " + zone.getName()));
@@ -42,7 +50,7 @@ zones.forEach(zone -> System.out.println("Zone: " + zone.getName()));
---
### 2. `zoneInfo`
### `zoneInfo`
Get detailed information about a specific zone by its name.
@@ -50,8 +58,6 @@ Get detailed information about a specific zone by its name.
- `String name` - The zone name (e.g., "example.com").
- **Returns**: A `ZoneEntity` object.
**Example:**
```java
ZoneEntity zone = cfDnsClient.zoneInfo("example.com");
System.out.println("Zone ID: " + zone.getId());
@@ -59,7 +65,7 @@ System.out.println("Zone ID: " + zone.getId());
---
### 3. `sldListAll`
### `sldListAll`
Retrieve all records for a specific second-level domain (SLD) under a given zone.
@@ -68,8 +74,6 @@ Retrieve all records for a specific second-level domain (SLD) under a given zone
- `String sld` - Second-level domain (e.g., "www" in "www.example.com").
- **Returns**: A list of `RecordEntity` objects.
**Example:**
```java
List<RecordEntity> records = cfDnsClient.sldListAll(zone, "sld");
records.forEach(record ->
@@ -79,7 +83,7 @@ records.forEach(record ->
---
### 4. `sldInfo`
### `sldInfo`
Retrieve DNS record details for a specific SLD, zone, and record type.
@@ -88,8 +92,6 @@ Retrieve DNS record details for a specific SLD, zone, and record type.
- `String sld` - The second-level domain.
- `RecordType type` - Record type (e.g., A, CNAME).
**Example:**
```java
RecordEntity record = cfDnsClient.sldInfo(zone, "www", RecordType.A);
System.out.println("Record IP: " + record.getContent());
@@ -97,7 +99,7 @@ System.out.println("Record IP: " + record.getContent());
---
### 5. `recordCreate`
### `recordCreate`
Create a new DNS record in a specific zone.
@@ -105,8 +107,6 @@ Create a new DNS record in a specific zone.
- `ZoneEntity zone` - DNS zone object.
- `RecordEntity rec` - Details of the new record (name, type, content).
**Example:**
```java
RecordEntity newRecord = new RecordEntity("api.example.com", RecordType.A, "192.168.1.1");
RecordEntity created = cfDnsClient.recordCreate(zone, newRecord);
@@ -115,7 +115,7 @@ System.out.println("Created Record ID: " + created.getId());
---
### 6. `recordUpdate`
### `recordUpdate`
Update an existing DNS record.
@@ -123,8 +123,6 @@ Update an existing DNS record.
- `ZoneEntity zone` - The zone that contains the record.
- `RecordEntity rec` - Updated record data.
**Example:**
```java
record.setContent("192.168.1.2");
RecordEntity updated = cfDnsClient.recordUpdate(zone, record);
@@ -133,7 +131,7 @@ System.out.println("Updated Record: " + updated.getContent());
---
### 7. `recordDelete`
### `recordDelete`
Delete a DNS record from a zone.
@@ -141,8 +139,6 @@ Delete a DNS record from a zone.
- `ZoneEntity zone` - The parent zone.
- `RecordEntity rec` - Record to delete.
**Example:**
```java
boolean isDeleted = cfDnsClient.recordDelete(zone, record);
System.out.println(isDeleted ? "Deletion successful." : "Deletion failed.");
@@ -150,7 +146,7 @@ System.out.println(isDeleted ? "Deletion successful." : "Deletion failed.");
---
### 8. `recordDeleteTypeIfExists`
### `recordDeleteTypeIfExists`
Delete a DNS record of a specific type if it exists.
@@ -159,8 +155,6 @@ Delete a DNS record of a specific type if it exists.
- `String sld` - Second-level domain.
- `RecordType type` - Record type.
**Example:**
```java
cfDnsClient.recordDeleteTypeIfExists(zone, "api", RecordType.A);
System.out.println("Deletion attempt completed.");
+1
View File
@@ -0,0 +1 @@
/Users/thilo/.sdkman/candidates/java/21.0.4-amzn/bin/javadoc @options @packages
+24
View File
@@ -0,0 +1,24 @@
-classpath
'/Users/thilo/.m2/repository/org/apache/httpcomponents/client5/httpclient5/5.4.2/httpclient5-5.4.2.jar:/Users/thilo/.m2/repository/org/apache/httpcomponents/core5/httpcore5/5.3.3/httpcore5-5.3.3.jar:/Users/thilo/.m2/repository/org/apache/httpcomponents/core5/httpcore5-h2/5.3.3/httpcore5-h2-5.3.3.jar:/Users/thilo/.m2/repository/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar:/Users/thilo/.m2/repository/org/projectlombok/lombok/1.18.36/lombok-1.18.36.jar:/Users/thilo/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.18.2/jackson-databind-2.18.2.jar:/Users/thilo/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.18.2/jackson-annotations-2.18.2.jar:/Users/thilo/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.18.2/jackson-core-2.18.2.jar:/Users/thilo/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.18.2/jackson-datatype-jsr310-2.18.2.jar:/Users/thilo/.m2/repository/ch/qos/logback/logback-classic/1.5.12/logback-classic-1.5.12.jar:/Users/thilo/.m2/repository/ch/qos/logback/logback-core/1.5.12/logback-core-1.5.12.jar:/Users/thilo/.m2/repository/org/jetbrains/annotations/24.0.0/annotations-24.0.0.jar'
-encoding
'UTF-8'
-protected
-source
'17'
-sourcepath
'/Users/thilo/development/java/CloudflareDNS-java/src/main/java'
-author
-bottom
'Copyright &#169; 2025. All rights reserved.'
-charset
'UTF-8'
-d
'/Users/thilo/development/java/CloudflareDNS-java/docs/apidocs'
-docencoding
'UTF-8'
-doctitle
'CloudflareDNS-java 0.1.0-SNAPSHOT API'
-use
-version
-windowtitle
'CloudflareDNS-java 0.1.0-SNAPSHOT API'
+2
View File
@@ -0,0 +1,2 @@
codes.thischwa.cf
codes.thischwa.cf.model