Package org.encuestame.utils.json

Examples of org.encuestame.utils.json.HomeBean


        final List<HashTagBean> hashTags = new ArrayList<HashTagBean>();
        hashTags.add(tagBean1);
        hashTags.add(tagBean2);
        hashTags.add(tagBean3);

        HomeBean homeBean = new HomeBean();
        homeBean.setCreateDate(myDate.toString());
        homeBean.setDislikeVote(150L);
        homeBean.setFavorite(Boolean.TRUE);
        homeBean.setHashTags(hashTags);
        homeBean.setHits(55L);
        homeBean.setItemType("TWEETPOLL");
        homeBean.setLikeVote(80L);
        homeBean.setOwnerUsername("jhonny");
        homeBean.setQuestionBean(qBean);
        homeBean.setRelativeTime("");
        homeBean.setRelevance(40L);
        homeBean.setTotalVotes(158L);
        homeBean.setUserId(1L);
        assertNotNull(homeBean);
        assertNotNull(homeBean.getCreateDate());
        assertNotNull(homeBean.getDislikeVote());
        assertNotNull(homeBean.getFavorite());
        assertNotNull(homeBean.getHashTags());
        assertNotNull(homeBean.getHits());
        assertNotNull(homeBean.getItemType());
        assertNotNull(homeBean.getLikeVote());
        assertNotNull(homeBean.getOwnerUsername());
        assertNotNull(homeBean.getQuestionBean());
        assertNotNull(homeBean.getRelativeTime());
        assertNotNull(homeBean.getTotalVotes());
        assertNotNull(homeBean.getUserId());
    }
View Full Code Here


     * @param tweetBean
     * @return
     */
    public static final HomeBean convertTweetPollToHomeBean(
            final TweetPollBean tweetBean) {
        final HomeBean homeBean = new HomeBean();
        homeBean.setId(tweetBean.getId());
        homeBean.setCreateDate(tweetBean.getCreateDate());
        homeBean.setQuestionBean(tweetBean.getQuestionBean());
        homeBean.setRelativeTime(tweetBean.getRelativeTime());
        homeBean.setTotalVotes(tweetBean.getTotalVotes());
        homeBean.setCreateDateComparable(tweetBean.getCreateDateComparable());
        homeBean.setHits(tweetBean.getHits() == null ? 0L : tweetBean.getHits());
        homeBean.setUserId(tweetBean.getUserId());
        homeBean.setOwnerUsername(tweetBean.getOwnerUsername());
        homeBean.setItemType(tweetBean.getItemType() == null ? null : tweetBean
                .getItemType().toString());
        homeBean.setRelevance(tweetBean.getRelevance());
        homeBean.setItemType(TypeSearchResult.TWEETPOLL.toString()
                .toLowerCase());
        homeBean.setHashTags(tweetBean.getHashTags());
        homeBean.setTotalComments(tweetBean.getTotalComments() == null ? 0
                : tweetBean.getTotalComments());
        return homeBean;
    }
View Full Code Here

     *
     * @param pollBean
     * @return
     */
    public static final HomeBean convertPollToHomeBean(final PollBean pollBean) {
        final HomeBean homeBean = new HomeBean();
        homeBean.setId(pollBean.getId());
        homeBean.setQuestionBean(pollBean.getQuestionBean());
        homeBean.setOwnerUsername(pollBean.getOwnerUsername());
        homeBean.setCreateDate(pollBean.getCreationDate());
        homeBean.setCreateDateComparable(pollBean.getCreateDateComparable());
        homeBean.setTotalVotes(pollBean.getTotalVotes());
        homeBean.setHits(pollBean.getHits() == null ? 0L : pollBean.getHits());
        homeBean.setRelativeTime(pollBean.getRelativeTime());
        homeBean.setItemType(pollBean.getItemType() == null ? null : pollBean
                .getItemType().toString());
        homeBean.setRelevance(pollBean.getRelevance() == null ? 0L : pollBean
                .getRelevance());
        homeBean.setItemType(TypeSearchResult.POLL.toString().toLowerCase());
        homeBean.setHashTags(pollBean.getHashTags());
        homeBean.setTotalComments(pollBean.getTotalComments() == null ? 0
                : pollBean.getTotalComments());
        return homeBean;
    }
View Full Code Here

     * @return
     */
    public static final HomeBean convertSurveyToHomeBean(
            final SurveyBean surveyBean) {
        // TODO: ENCUESTAME-312
        final HomeBean homeBean = new HomeBean();
        homeBean.setId(surveyBean.getSid());
        homeBean.setQuestionBean(convertSurveyToQuestionBean(surveyBean));
        homeBean.setOwnerUsername(surveyBean.getOwnerUsername());
        homeBean.setHits(surveyBean.getHits());
        homeBean.setCreateDate(surveyBean.getCreatedAt() == null ? null
                : DateUtil.DOJO_DATE_FORMAT.format(surveyBean.getCreatedAt()));
        homeBean.setTotalVotes(surveyBean.getTotalVotes());
        homeBean.setRelativeTime(surveyBean.getRelativeTime());
        homeBean.setTotalComments(surveyBean.getTotalComments() == null ? 0
                : surveyBean.getTotalComments());
        homeBean.setItemType(TypeSearchResult.SURVEY.toString().toLowerCase());
        homeBean.setRelevance(surveyBean.getRelevance());
        homeBean.setHashTags(surveyBean.getHashTags());
        return homeBean;
    }
View Full Code Here

TOP

Related Classes of org.encuestame.utils.json.HomeBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.