Package org.ametys.plugins.survey.data
Class SurveySession
- java.lang.Object
-
- org.ametys.plugins.survey.data.SurveySession
-
- Direct Known Subclasses:
ProcessInputAction.SurveyInput
public class SurveySession extends Object
Class representing a survey session, i.e. all the responses of a user to a survey.
-
-
Field Summary
Fields Modifier and Type Field Description protected List<SurveyAnswer>
_answers
The list of answers.protected int
_id
The session ID.protected String
_ipAddress
The IP address of the person who answered the survey.protected String
_login
The login of the person who answered the survey.protected String
_population
The population of the person who answered the survey.protected Date
_submittedAt
The date and time at which the person completed the survey.protected String
_surveyId
The survey ID.
-
Constructor Summary
Constructors Constructor Description SurveySession()
Build a SurveySession object.SurveySession(int id, String surveyId, UserIdentity user, String ipAddress, Date submittedAt, List<SurveyAnswer> answers)
Build a SurveySession object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<? extends SurveyAnswer>
getAnswers()
Get the answers.int
getId()
Get the id.String
getIpAddress()
Get the ipAddress.String
getLogin()
Get the login of the user answering the surveyString
getPopulation()
Get the population of the user answering the surveyDate
getSubmittedAt()
Get the submittedAt.String
getSurveyId()
Get the surveyId.UserIdentity
getUser()
Get the identity of the user answering the surveyvoid
setAnswers(List<SurveyAnswer> answers)
Set the answers.void
setId(int id)
Set the id.void
setIpAddress(String ipAddress)
Set the ipAddress.void
setLogin(String login)
Set the login of the user answering the surveyvoid
setPopulation(String population)
Set the population of the user answering the surveyvoid
setSubmittedAt(Date submittedAt)
Set the submittedAt.void
setSurveyId(String surveyId)
Set the surveyId.void
setUser(UserIdentity user)
Set the identity of the user answering the survey
-
-
-
Field Detail
-
_id
protected int _id
The session ID.
-
_population
protected String _population
The population of the person who answered the survey.
-
_ipAddress
protected String _ipAddress
The IP address of the person who answered the survey.
-
_submittedAt
protected Date _submittedAt
The date and time at which the person completed the survey.
-
_answers
protected List<SurveyAnswer> _answers
The list of answers.
-
-
Constructor Detail
-
SurveySession
public SurveySession()
Build a SurveySession object.
-
SurveySession
public SurveySession(int id, String surveyId, UserIdentity user, String ipAddress, Date submittedAt, List<SurveyAnswer> answers)
Build a SurveySession object.- Parameters:
id
- the session ID.surveyId
- the survey ID.user
- the user.ipAddress
- the user IP address.submittedAt
- the date of completion.answers
- the list of answers.
-
-
Method Detail
-
getId
public int getId()
Get the id.- Returns:
- the id
-
setId
public void setId(int id)
Set the id.- Parameters:
id
- the id to set
-
getSurveyId
public String getSurveyId()
Get the surveyId.- Returns:
- the surveyId
-
setSurveyId
public void setSurveyId(String surveyId)
Set the surveyId.- Parameters:
surveyId
- the surveyId to set
-
getLogin
public String getLogin()
Get the login of the user answering the survey- Returns:
- the user login
-
setLogin
public void setLogin(String login)
Set the login of the user answering the survey- Parameters:
login
- the login
-
getPopulation
public String getPopulation()
Get the population of the user answering the survey- Returns:
- the user identity
-
setPopulation
public void setPopulation(String population)
Set the population of the user answering the survey- Parameters:
population
- the population
-
setUser
public void setUser(UserIdentity user)
Set the identity of the user answering the survey- Parameters:
user
- the user identity
-
getUser
public UserIdentity getUser()
Get the identity of the user answering the survey- Returns:
- the user identity
-
getIpAddress
public String getIpAddress()
Get the ipAddress.- Returns:
- the ipAddress
-
setIpAddress
public void setIpAddress(String ipAddress)
Set the ipAddress.- Parameters:
ipAddress
- the ipAddress to set
-
getSubmittedAt
public Date getSubmittedAt()
Get the submittedAt.- Returns:
- the submittedAt
-
setSubmittedAt
public void setSubmittedAt(Date submittedAt)
Set the submittedAt.- Parameters:
submittedAt
- the submittedAt to set
-
getAnswers
public List<? extends SurveyAnswer> getAnswers()
Get the answers.- Returns:
- the answers
-
setAnswers
public void setAnswers(List<SurveyAnswer> answers)
Set the answers.- Parameters:
answers
- the answers to set
-
-