Skip to content

Commit

Permalink
Add documentation for Date class
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Y-Yan committed Nov 11, 2023
1 parent c00c0c6 commit 37a9f61
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions src/main/java/seedu/duke/data/Date.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,20 @@ public class Date {
public String standardString;
transient LocalDate date;

// @SerializedName("rawData")

/**
* Create a new date.
*
* @param rawData A String that needs to comply with a supported format and
* indicates a correct date that will be recorded by this Date
* instance.
* @throws TipsException Any excption will be throw in this type, which contains
* information about this exception and the possible
* solution.
* @param rawData refers to the date String
* @throws InvalidDateException if failed to parse date string input
*/
public Date(String rawData) throws InvalidDateException {
setRawData(rawData);
}

/**
* Modifying an existing date with a rawData String.
*
* @param rawData A String that needs to comply with a supported format and
* indicates a correct date that will be recorded by this Date
* instance.
* @throws TipsException Any excption will be throw in this type, which contains
* information about this exception and the possible
* solution.
* The method is used to set up the date field of a Date object
* It contains the actual implementation to parse date information from a string
* @param rawData refers to a date string
* @throws InvalidDateException if failed to parse date string input
*/
public void setRawData(String rawData) throws InvalidDateException {
for (DateTimeFormatter formatter : formatters) {
Expand Down

0 comments on commit 37a9f61

Please sign in to comment.