Record Class VilleTestObject

java.lang.Object
java.lang.Record
studentrepoloader.cli.VilleTestObject
All Implemented Interfaces:
Comparable<VilleSubmissionFields>, VilleSubmissionFields

public record VilleTestObject(String[] array) extends Record implements VilleSubmissionFields
  • Constructor Details

    • VilleTestObject

      public VilleTestObject(String[] array)
      Creates an instance of a VilleTestObject record class.
      Parameters:
      array - the value for the array record component
  • Method Details

    • getUser

      public String 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 interface VilleSubmissionFields
      Returns:
      the user's identifier (e.g., "student@university.fi")
    • getFirstName

      public String getFirstName()
      Description copied from interface: VilleSubmissionFields
      Returns the student's given name.
      Specified by:
      getFirstName in interface VilleSubmissionFields
      Returns:
      first name
    • getLastName

      public String getLastName()
      Description copied from interface: VilleSubmissionFields
      Returns the student's surname.
      Specified by:
      getLastName in interface VilleSubmissionFields
      Returns:
      last name
    • getTime

      public String 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 interface VilleSubmissionFields
      Returns:
      submission time as string
    • getStudentId

      public 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 interface VilleSubmissionFields
      Returns:
      student ID
    • getParentFolderName

      public String 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/
           ├── ...
       
      where 2025-06-14 comes from getTime().

      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 interface VilleSubmissionFields
      Returns:
      timestamp string from getTime() to be used as a folder name
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • array

      public String[] array()
      Returns the value of the array record component.
      Returns:
      the value of the array record component