Record Class VilleTestObject
java.lang.Object
java.lang.Record
studentrepoloader.cli.VilleTestObject
- All Implemented Interfaces:
Comparable<VilleSubmissionFields>
,VilleSubmissionFields
-
Constructor Summary
ConstructorsConstructorDescriptionVilleTestObject
(String[] array) Creates an instance of aVilleTestObject
record class. -
Method Summary
Modifier and TypeMethodDescriptionString[]
array()
Returns the value of thearray
record component.final boolean
Indicates whether some other object is "equal to" this one.Returns the student's given name.Returns the student's surname.Returns a timestamp-based folder name to group this submission.Returns the student's official identifier, such as a student number or other ID code.getTime()
Returns the timestamp of the submission as a raw string.getUser()
Returns the full user identifier, typically an email address.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface studentrepoloader.model.villecsv.mapper.VilleSubmissionFields
compareTo, getFolderName, getID
-
Constructor Details
-
VilleTestObject
Creates an instance of aVilleTestObject
record class.- Parameters:
array
- the value for thearray
record component
-
-
Method Details
-
getUser
Description copied from interface:VilleSubmissionFields
Returns the full user identifier, typically an email address.This value should be unique across submissions, and is often used to derive internal IDs.
- Specified by:
getUser
in interfaceVilleSubmissionFields
- Returns:
- the user's identifier (e.g., "student@university.fi")
-
getFirstName
Description copied from interface:VilleSubmissionFields
Returns the student's given name.- Specified by:
getFirstName
in interfaceVilleSubmissionFields
- Returns:
- first name
-
getLastName
Description copied from interface:VilleSubmissionFields
Returns the student's surname.- Specified by:
getLastName
in interfaceVilleSubmissionFields
- Returns:
- last name
-
getTime
Description copied from interface:VilleSubmissionFields
Returns the timestamp of the submission as a raw string.No specific format is enforced — it is the implementer's responsibility to parse or sanitize this if needed.
- Specified by:
getTime
in interfaceVilleSubmissionFields
- Returns:
- submission time as string
-
getStudentId
Description copied from interface:VilleSubmissionFields
Returns the student's official identifier, such as a student number or other ID code.- Specified by:
getStudentId
in interfaceVilleSubmissionFields
- Returns:
- student ID
-
getParentFolderName
Returns a timestamp-based folder name to group this submission.Since this test object is not constructed with a
ViLLeCsvFile
and lacks batch-level metadata, the fallback strategy is to return the raw timestamp field from the submission itself.This ensures submissions created from arbitrary test data can still be placed into separate subdirectories like:
clones/ └── 2025-06-14/ ├── ...
where2025-06-14
comes fromgetTime()
.Note: this method assumes the
getTime()
format is already compliant with filesystem-safe and lexicographically sortable naming (e.g.,yyyy-MM-dd
).- Specified by:
getParentFolderName
in interfaceVilleSubmissionFields
- Returns:
- timestamp string from
getTime()
to be used as a folder name
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
array
Returns the value of thearray
record component.- Returns:
- the value of the
array
record component
-