docs(global): Optimised javadoc, changed the spelling to British English.

This commit is contained in:
Zihlu Wang
2023-09-18 15:04:10 +08:00
parent fee85d5d84
commit f80c47e8ad
41 changed files with 459 additions and 438 deletions
@@ -21,11 +21,12 @@ import java.util.ArrayList;
import java.util.List;
/**
* The WebCalendar class represents a web calendar in iCalendar format.
* {@code WebCalendar} class represents a web calendar in iCalendar format.
* <p>
* It allows users to create and customize calendar components and events and
* generate an iCalendar string containing all the calendar information.
* <p>Usage Example:
* It allows users to create and customise calendar components and events and
* generate an <b>iCalendar</b> string containing all the calendar information.
* <p>
* Usage Example:
* <pre>
* WebCalendar calendar = new WebCalendar()
* .setName("My Web Calendar")
@@ -38,9 +39,9 @@ import java.util.List;
* String iCalendarString = calendar.resolve();
* </pre>
* <p>
* The WebCalendar class is designed to generate an iCalendar string conforming
* to the iCalendar specification, which can be used to share calendar data
* with other calendar applications or services.
* The {@code WebCalendar} class is designed to generate an iCalendar string
* conforming to the iCalendar specification, which can be used to share
* calendar data with other calendar applications or services.
*
* @author Zihlu Wang
* @version 1.1.0
@@ -49,7 +50,7 @@ import java.util.List;
public final class WebCalendar {
/**
* The VCALENDAR tag for iCalendar format
* The {@code VCALENDAR} tag for iCalendar format
*/
private final static String TAG = "VCALENDAR";
@@ -60,7 +61,6 @@ public final class WebCalendar {
/**
* The company who produces this calendar.
*
* <p>
* This property will be used in {@code PRODID}.
*/
@@ -68,7 +68,6 @@ public final class WebCalendar {
/**
* The product name.
*
* <p>
* This property will be used in {@code PRODID}
*/
@@ -28,17 +28,16 @@ import java.util.Optional;
import java.util.UUID;
/**
* The WebCalendarEvent class represents an event in the web calendar. It
* extends the abstract class WebCalendarNode and provides additional methods
* to set properties specific to events.
*
* The {@code WebCalendarEvent} class represents an event in the web calendar.
* It extends the abstract class WebCalendarNode and provides additional
* methods to set properties specific to events.
* <p>
* Users can use the methods in this class to add categories, set the
* classification, add comments, descriptions, locations, set percent complete
* , set priority, set summary, set start time, set end time, set duration, set
* URL, set UID, and set timezone for the event. After setting the properties,
* users can call the {@link #resolve()} method to generate the corresponding
* iCalendar content for the event.
* classification, add comments, descriptions, locations, set percent
* complete, set priority, set summary, set start time, set end time, set
* duration, set URL, set UID, and set timezone for the event. After setting
* the properties, users can call the {@link #resolve()} method to generate the
* corresponding iCalendar content for the event.
*
* @author Zihlu Wang
* @version 1.1.0
@@ -275,7 +274,7 @@ public final class WebCalendarEvent extends WebCalendarNode {
.map((item) -> "DTEND" + Optional.ofNullable(timezone).map(tz -> ";TZID=" + tz).orElse("") + ":" +
end.format(DateTimeFormatter.ISO_LOCAL_DATE_TIME) + "\n").orElse("") +
Optional.ofNullable(classification)
.map((item) -> "CLASS:" + item.getClassification() + "\n").orElse("") +
.map((item) -> "CLASS:" + item.name() + "\n").orElse("") +
Optional.ofNullable(comment).map((item) -> "COMMENT:" + item + "\n").orElse("") +
Optional.ofNullable(description).map((item) -> "DESCRIPTION:" + item + "\n").orElse("") +
Optional.ofNullable(location).map((item) -> "LOCATION:" + item + "\n").orElse("") +
@@ -25,14 +25,13 @@ import java.util.ArrayList;
import java.util.List;
/**
* The abstract sealed class WebCalendarNode represents a node in the web
* calendar, such as an event, a to-do item, or an alarm. It provides common
* properties and methods for all calendar components and events.
*
* The abstract sealed class {@code WebCalendarNode} represents a node in the
* web calendar, such as an event, a to-do item, or an alarm. It provides
* common properties and methods for all calendar components and events.
* <p>
* Subclasses of WebCalendarNode should implement the {@link #resolve()} method
* to generate the corresponding iCalendar content for the specific calendar
* component or event.
* Subclasses of {@code WebCalendarNode} should implement the {@link
* #resolve()} method to generate the corresponding iCalendar content for the
* specific calendar component or event.
*
* @author Zihlu Wang
* @version 1.1.0
@@ -20,8 +20,8 @@ package cn.org.codecrafters.webcal.config;
import lombok.Getter;
/**
* The Classification enum represents the classification levels of calendar
* content based on RFC 5545.
* The {@code Classification} enum represents the classification levels of
* calendar content based on <b>RFC-5545</b>.
* <p>
* Calendar events or components can be classified as one of the following
* levels:
@@ -44,7 +44,6 @@ import lombok.Getter;
* @version 1.1.0
* @since 1.0.0
*/
@Getter
public enum Classification {
/**
@@ -53,7 +52,7 @@ public enum Classification {
* Indicates that the calendar content is public and can be freely
* distributed.
*/
PUBLIC("PUBLIC"),
PUBLIC,
/**
* Private classification level.
@@ -61,7 +60,7 @@ public enum Classification {
* Indicates that the calendar content is private and should not be shared
* with others.
*/
PRIVATE("PRIVATE"),
PRIVATE,
/**
* Confidential classification level.
@@ -69,22 +68,7 @@ public enum Classification {
* Indicates that the calendar content is confidential and should be kept
* strictly private.
*/
CONFIDENTIAL("CONFIDENTIAL"),
CONFIDENTIAL,
;
/**
* -- GETTER --
* Get the string representation of the classification level.
*/
private final String classification;
/**
* Constructor for Classification enum.
*
* @param classification the classification level as a string representation
*/
Classification(String classification) {
this.classification = classification;
}
}
@@ -16,10 +16,10 @@
*/
/**
* The package cn.org.codecrafters.webcal.config contains classes related to
* the configuration and settings of the web calendar module. It provides
* various configurations and constants used in the generation and resolution
* of iCalendar content.
* The package {@code cn.org.codecrafters.webcal.config} contains classes
* related to the configuration and settings of the web calendar module. It
* provides various configurations and constants used in the generation and
* resolution of iCalendar content.
* <p>The classes in this package include:</p>
* <ul>
* <li>