Class SurveyDTO

java.lang.Object
it.unimib.unimibmodules.dto.SurveyDTO

public class SurveyDTO extends Object
DTO for the Survey class.
Version:
0.4.1
Author:
Luca Milazzo
  • Field Details

    • id

      private int id
      Serialization of the id of the survey.
    • surveyName

      private String surveyName
      Serialization of the name of the survey.
    • creationDate

      private String creationDate
      Serialization of the dateCreation of the survey.
    • userDTO

      private UserDTO userDTO
      Serialization of the id of the user who created the survey.
    • questions

      private Set<SurveyQuestionsDTO> questions
      Serialization of the questions of the survey.
  • Constructor Details

    • SurveyDTO

      public SurveyDTO()
  • Method Details

    • setId

      public void setId(int id)
      Modifies the id of the surveyDTO, setting id as the new value.
      Parameters:
      id - the new id value
    • setId

      public void setId(Object id)
      Modifies the id of the surveyDTO, setting id as the new value.
      Parameters:
      id - the new id value
    • getCreationDateConverted

      public Date getCreationDateConverted(String timezone, SimpleDateFormat dateFormat) throws FormatException
      Returns the creationDate of the surveyDTO in Date type using the given time zone.
      Parameters:
      timezone - the time zone to use to parse the creationDate of the surveyDTO in Date type
      dateFormat - the date format to use during the conversion
      Returns:
      the creationDate of the surveyDTO in Date type
      Throws:
      FormatException
    • setCreationDate

      public void setCreationDate(Date creationDate, String timezone, SimpleDateFormat dateFormat)
      Modifies the creationDate of the surveyDTO, setting creationDate as the new value after its conversion to String using the given time zone.
      Parameters:
      creationDate - the new creationDate value that has to be converted to String
      timezone - the time zone to use to parse creationDate in String
      dateFormat - the date format to use during the conversion