public class Utils extends Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static Poll |
calculateVote(Poll poll,
String userId,
String voteOptions)
Calculate data of poll when user Voted.
|
static String |
getCurrentUserVote(Poll poll) |
static Calendar |
getGreenwichMeanTime() |
static String |
getInfoVote(Poll poll)
Get a string from infoVote of poll
|
static String |
getUserVote(Poll poll,
String userName)
Convert userVote of poll to s string
|
static boolean |
isEmpty(String s) |
static boolean |
isListEmpty(List<String> list) |
public static final String COLON
public static Calendar getGreenwichMeanTime()
public static boolean isEmpty(String s)
public static Poll calculateVote(Poll poll, String userId, String voteOptions) throws Exception
poll - the poll after user vote.userId - the user name voted.voteOptions - the value user voted.
- If is single vote, the value is one number.
- If is multi vote, the value has format a:b:c, with a,b,c is number user selected.Exception - the exceptionpublic static String getInfoVote(Poll poll)
poll - public static String getUserVote(Poll poll, String userName)
poll - userName - Copyright © 2003–2015 eXo Platform SAS. All rights reserved.