* @return
*/
public static final TweetPollAnswerSwitchBean convertTweetPollSwitchToBean(
final TweetPollSwitch tweetPollSwitch,
final HttpServletRequest request) {
final TweetPollAnswerSwitchBean answerSwitchBean = new TweetPollAnswerSwitchBean();
answerSwitchBean.setTweetPollId(tweetPollSwitch.getTweetPoll()
.getTweetPollId());
answerSwitchBean.setAnswerBean(ConvertDomainBean
.convertAnswerToBean(tweetPollSwitch.getAnswers()));
answerSwitchBean.setShortUrl(tweetPollSwitch.getShortUrl());
if (request == null) {
answerSwitchBean.setRelativeUrl(tweetPollSwitch.getRelativeUrl());
} else {
final StringBuffer buffer = new StringBuffer(WidgetUtil.getDomain(request));
buffer.append(tweetPollSwitch.getRelativeUrl());
answerSwitchBean.setRelativeUrl(buffer.toString());
}
answerSwitchBean.setId(tweetPollSwitch.getSwitchId());
return answerSwitchBean;
}