Package it.unimib.unimibmodules.dto
Class SurveyDTO
java.lang.Object
it.unimib.unimibmodules.dto.SurveyDTO
DTO for the Survey class.
- Version:
- 0.4.1
- Author:
- Luca Milazzo
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
Serialization of the dateCreation of the survey.private int
Serialization of the id of the survey.private Set<SurveyQuestionsDTO>
Serialization of the questions of the survey.private String
Serialization of the name of the survey.private UserDTO
Serialization of the id of the user who created the survey. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCreationDateConverted
(String timezone, SimpleDateFormat dateFormat) Returns the creationDate of the surveyDTO in Date type using the given time zone.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.void
setId
(int id) Modifies the id of the surveyDTO, setting id as the new value.void
Modifies the id of the surveyDTO, setting id as the new value.
-
Field Details
-
id
private int idSerialization of the id of the survey. -
surveyName
Serialization of the name of the survey. -
creationDate
Serialization of the dateCreation of the survey. -
userDTO
Serialization of the id of the user who created the survey. -
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
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 typedateFormat
- the date format to use during the conversion- Returns:
- the creationDate of the surveyDTO in Date type
- Throws:
FormatException
-
setCreationDate
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 Stringtimezone
- the time zone to use to parse creationDate in StringdateFormat
- the date format to use during the conversion
-