pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.component.survey.model
Class SurveyToken

java.lang.Object
  extended by org.torweg.pulse.component.survey.model.SurveyToken
All Implemented Interfaces:
java.io.Serializable

@Entity
public class SurveyToken
extends java.lang.Object
implements java.io.Serializable

For Surveys that require a token.

Simply maps the id of a Survey to a token- String.

Version:
$Revision: 1586 $
Author:
Daniel Dietz
See Also:
Serialized Form

Constructor Summary
protected SurveyToken()
          Default constructor.
  SurveyToken(java.lang.Long surId)
          Creates a new SurveyToken with the given surId.
  SurveyToken(Survey survey)
          Creates a new SurveyToken for the given Survey.
 
Method Summary
 java.lang.Long getId()
          Returns the id of the SurveyToken.
 java.lang.Long getSurveyId()
          Returns the surveyId.
 java.lang.String getToken()
          Returns the token.
 boolean isUsed()
          Indicates whether the token has been used already.
 SurveyToken setUsed()
          Sets the SurveyToken used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SurveyToken

protected SurveyToken()
Default constructor.


SurveyToken

public SurveyToken(java.lang.Long surId)
Creates a new SurveyToken with the given surId.

Parameters:
surId - the id of the Survey

SurveyToken

public SurveyToken(Survey survey)
Creates a new SurveyToken for the given Survey.

Parameters:
survey - the Survey
Method Detail

getId

public final java.lang.Long getId()
Returns the id of the SurveyToken.

Returns:
the id

getToken

public final java.lang.String getToken()
Returns the token.

Returns:
the token

getSurveyId

public final java.lang.Long getSurveyId()
Returns the surveyId.

Returns:
the surveyId

setUsed

public final SurveyToken setUsed()
Sets the SurveyToken used.

Returns:
the modified SurveyToken

isUsed

public final boolean isUsed()
Indicates whether the token has been used already.

Returns:
true if the token is used, false otherwise