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.");