Skip to content

Commit d91ba12

Browse files
committed
java doc for flashcard request model
1 parent b2f4122 commit d91ba12

File tree

3 files changed

+61
-11
lines changed

3 files changed

+61
-11
lines changed

src/main/java/data_access_use_case/entity_request_models/CommonUserDsRequestModel.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
package data_access_use_case.entity_request_models;
22

33
import java.util.List;
4-
4+
/**
5+
* Common User Request Model.
6+
* Application Business Rules
7+
* @author Justin Li
8+
*/
59
public class CommonUserDsRequestModel {
610
private final String username;
711
private final String password;

src/main/java/data_access_use_case/entity_request_models/FlashcardDsRequestModel.java

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
package data_access_use_case.entity_request_models;
2-
// use case layer
32

43
import java.time.LocalDateTime;
4+
/**
5+
* Flashcard Request Model.
6+
* Application Business Rules
7+
* @author Justin Li
8+
*/
59

610
public class FlashcardDsRequestModel {
711
private String term;
@@ -10,6 +14,14 @@ public class FlashcardDsRequestModel {
1014
private int flashcardId;
1115
private final int belongsToId;
1216

17+
/**
18+
* Creates a flashcard response model based on the following parameters.
19+
* @param term the flashcard term
20+
* @param definition the flashcard definition for the term
21+
* @param creationDate the time the flashcard is created (time formatted in LocalDateTime)
22+
* @param flashcardId the flashcard id
23+
* @param belongsToId the id of the flashcard set that the flashcard is in.
24+
*/
1325
public FlashcardDsRequestModel(String term, String definition, LocalDateTime creationDate,
1426
int flashcardId, int belongsToId){
1527
this.term = term;
@@ -18,33 +30,54 @@ public FlashcardDsRequestModel(String term, String definition, LocalDateTime cre
1830
this.flashcardId = flashcardId;
1931
this.belongsToId = belongsToId;
2032
}
33+
/**
34+
* Gets the flashcard term.
35+
* @return the flashcard term
36+
*/
2137
public String getTerm() {
2238
return term;
2339
}
24-
40+
/**
41+
* Gets the flashcard definition.
42+
* @return the flashcard definition.
43+
*/
2544
public String getDefinition() {
2645
return definition;
2746
}
28-
47+
/**
48+
* Gets the flashcard creation date.
49+
* @return the flashcard creation date in LocalDateTime formatting.
50+
*/
2951
public LocalDateTime getCreationDate() {
3052
return creationDate;
3153
}
32-
54+
/**
55+
* Gets the flashcard id.
56+
* @return the flashcard id.
57+
*/
3358
public int getFlashcardId(){
3459
return flashcardId;
3560
}
36-
61+
/**
62+
* Gets the id of the flashcard set that the flashcard belongs to.
63+
* @return the id of the flashcard set that the flashcard belongs to.
64+
*/
3765
public int getBelongsToId(){
3866
return belongsToId;
3967
}
40-
public void setTerm(String term) {
41-
this.term = term;
42-
}
43-
68+
/**
69+
* Sets the term.
70+
*/
71+
public void setTerm(String term) {this.term = term;}
72+
/**
73+
* Sets the definition.
74+
*/
4475
public void setDefinition(String definition) {
4576
this.definition = definition;
4677
}
47-
78+
/**
79+
* Sets the flashcard id.
80+
*/
4881
public void setFlashcardId(int flashcardId) {
4982
this.flashcardId = flashcardId;
5083
}

src/main/java/data_access_use_case/entity_request_models/FlashcardSetDsRequestModel.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
package data_access_use_case.entity_request_models;
22

33
import java.util.List;
4+
/**
5+
* Flashcard Set Request Model.
6+
* Application Business Rules
7+
* @author Justin Li
8+
*/
49

510
public class FlashcardSetDsRequestModel {
611
private String title;
@@ -11,6 +16,14 @@ public class FlashcardSetDsRequestModel {
1116
private final String ownerUsername;
1217
private int flashcardSetId;
1318

19+
/**
20+
* Creates a flashcard response model based on the following parameters.
21+
* @param title the flashcard set title
22+
* @param description the flashcard set description.
23+
* @param isPrivate true if the flashcard set is private.
24+
* @param flashcardSetId the flashcard set id
25+
* @param ownerUsername the id of the user that created the flashcard set.
26+
*/
1427
public FlashcardSetDsRequestModel(String title, String description, boolean isPrivate,
1528
int flashcardSetId, String ownerUsername,
1629
List<Integer> flashcardIds){

0 commit comments

Comments
 (0)