Package com.nicholasalfonso.lato.entity
Class Assignment
java.lang.Object
com.nicholasalfonso.lato.entity.Assignment
JPA entity representing an assignment.
Stores assignment data with support for synced (from LMS) and custom user-defined attributes.
Assignments can be marked as completed or archived, and have priority levels.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enum -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the course this assignment belongs to.Gets the creation timestamp.Gets the custom description.Gets the custom due date.Gets the custom due time.Gets the custom title.Gets the display description, preferring custom description over synced description.Gets the display due date, preferring custom due date over synced due date.Gets the display due time, preferring custom due time over synced due time.Gets the display title, preferring custom title over synced title.Gets the external ID from the LMS.getId()Gets the ID of this assignment.getNote()Gets the associated note for this assignment.Gets the priority level of this assignment.Gets the synced description from the LMS.Gets the synced due date from the LMS.Gets the synced due time from the LMS.Gets the synced title from the LMS.getType()Gets the type of this assignment.Gets the last update timestamp.booleanChecks if this assignment is archived.booleanChecks if this assignment is completed.voidsetArchived(boolean archived) Sets whether this assignment is archived.voidsetCompleted(boolean completed) Sets whether this assignment is completed.voidSets the course for this assignment.voidsetCustomDescription(String customDescription) Sets the custom description.voidsetCustomDueDate(LocalDate customDueDate) Sets the custom due date.voidsetCustomDueTime(LocalTime customDueTime) Sets the custom due time.voidsetCustomTitle(String customTitle) Sets the custom title.voidsetExternalId(String externalId) Sets the external ID from the LMS.voidsetId(long l) Sets the ID of this assignment.voidSets the associated note for this assignment.voidsetPriority(Assignment.AssignmentPriority priority) Sets the priority level of this assignment.voidsetSyncedDescription(String syncedDescription) Sets the synced description from the LMS.voidsetSyncedDueDate(LocalDate syncedDueDate) Sets the synced due date from the LMS.voidsetSyncedDueTime(LocalTime syncedDueTime) Sets the synced due time from the LMS.voidsetSyncedTitle(String syncedTitle) Sets the synced title from the LMS.voidSets the type of this assignment.
-
Constructor Details
-
Assignment
public Assignment()
-
-
Method Details
-
getId
Gets the ID of this assignment.- Returns:
- the assignment ID
-
getCourse
Gets the course this assignment belongs to.- Returns:
- the associated course
-
setCourse
Sets the course for this assignment.- Parameters:
course- the course to associate
-
getExternalId
Gets the external ID from the LMS.- Returns:
- the external ID
-
setExternalId
Sets the external ID from the LMS.- Parameters:
externalId- the external ID
-
getSyncedTitle
Gets the synced title from the LMS.- Returns:
- the synced title
-
setSyncedTitle
Sets the synced title from the LMS.- Parameters:
syncedTitle- the synced title
-
getCustomTitle
Gets the custom title.- Returns:
- the custom title
-
setCustomTitle
Sets the custom title.- Parameters:
customTitle- the custom title
-
getSyncedDescription
Gets the synced description from the LMS.- Returns:
- the synced description
-
setSyncedDescription
Sets the synced description from the LMS.- Parameters:
syncedDescription- the synced description
-
getCustomDescription
Gets the custom description.- Returns:
- the custom description
-
setCustomDescription
Sets the custom description.- Parameters:
customDescription- the custom description
-
getSyncedDueDate
Gets the synced due date from the LMS.- Returns:
- the synced due date
-
setSyncedDueDate
Sets the synced due date from the LMS.- Parameters:
syncedDueDate- the synced due date
-
getCustomDueDate
Gets the custom due date.- Returns:
- the custom due date
-
setCustomDueDate
Sets the custom due date.- Parameters:
customDueDate- the custom due date
-
getSyncedDueTime
Gets the synced due time from the LMS.- Returns:
- the synced due time
-
setSyncedDueTime
Sets the synced due time from the LMS.- Parameters:
syncedDueTime- the synced due time
-
getCustomDueTime
Gets the custom due time.- Returns:
- the custom due time
-
setCustomDueTime
Sets the custom due time.- Parameters:
customDueTime- the custom due time
-
getPriority
Gets the priority level of this assignment.- Returns:
- the priority
-
setPriority
Sets the priority level of this assignment.- Parameters:
priority- the priority
-
isCompleted
public boolean isCompleted()Checks if this assignment is completed.- Returns:
- true if completed, false otherwise
-
setCompleted
public void setCompleted(boolean completed) Sets whether this assignment is completed.- Parameters:
completed- true to mark as completed
-
isArchived
public boolean isArchived()Checks if this assignment is archived.- Returns:
- true if archived, false otherwise
-
setArchived
public void setArchived(boolean archived) Sets whether this assignment is archived.- Parameters:
archived- true to archive the assignment
-
getCreatedAt
Gets the creation timestamp.- Returns:
- the creation timestamp
-
getUpdatedAt
Gets the last update timestamp.- Returns:
- the update timestamp
-
getDisplayTitle
Gets the display title, preferring custom title over synced title.- Returns:
- the title to display
-
getDisplayDescription
Gets the display description, preferring custom description over synced description.- Returns:
- the description to display
-
getDisplayDueDate
Gets the display due date, preferring custom due date over synced due date.- Returns:
- the due date to display
-
getDisplayDueTime
Gets the display due time, preferring custom due time over synced due time.- Returns:
- the due time to display
-
getNote
Gets the associated note for this assignment.- Returns:
- the note
-
setNote
Sets the associated note for this assignment.- Parameters:
note- the note to associate
-
getType
Gets the type of this assignment.- Returns:
- the assignment type
-
setType
Sets the type of this assignment.- Parameters:
type- the assignment type
-
setId
public void setId(long l) Sets the ID of this assignment.- Parameters:
l- the ID
-