org.exoplatform.poll.service
Class Utils
java.lang.Object
org.exoplatform.poll.service.Utils
public class Utils
- extends Object
|
Constructor Summary |
Utils()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
COLON
public static final String COLON
Utils
public Utils()
getGreenwichMeanTime
public static Calendar getGreenwichMeanTime()
isEmpty
public static boolean isEmpty(String s)
isListEmpty
public static boolean isListEmpty(List<String> list)
calculateVote
public static Poll calculateVote(Poll poll,
String userId,
String voteOptions)
throws Exception
- Calculate data of poll when user Voted. Apply for all case (Single vote and multi vote)
- Parameters:
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.
- Throws:
Exception - the exception
getInfoVote
public static String getInfoVote(Poll poll)
- Get a string from infoVote of poll
- Parameters:
poll -
- Returns:
getUserVote
public static String getUserVote(Poll poll,
String userName)
- Convert userVote of poll to s string
- Parameters:
poll - userName -
- Returns:
getCurrentUserVote
public static String getCurrentUserVote(Poll poll)
Copyright © 2003–2014 eXo Platform SAS. All rights reserved.