Skip to content

Instantly share code, notes, and snippets.

@CliveEvans
Created July 6, 2010 10:09
Show Gist options
  • Save CliveEvans/465221 to your computer and use it in GitHub Desktop.
Save CliveEvans/465221 to your computer and use it in GitHub Desktop.
general code snippets
int escalated = 0, regular = 0, requeue = 0;
for (LanguageMessageCountType languageMessageCountType : LanguageMessageCountType.values()) {
switch (languageMessageCountType) {
case ESCALATED:
escalated = languageQueue.getEscalatedMessagesCount();
keyValuesMap.put(languageMessageCountType.name(), String.valueOf(escalated));
break;
case REGULAR:
regular = languageQueue.getRegularMessagesCount();
keyValuesMap.put(languageMessageCountType.name(), String.valueOf(regular));
break;
case REQUEUE:
requeue = languageQueue.getRequeuedMessagesCount();
keyValuesMap.put(languageMessageCountType.name(), String.valueOf(requeue));
break;
default:
break;
}
}
keyValuesMap.put(TOTAL.name(), String.valueOf(escalated + regular + requeue));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment