Created
October 17, 2016 22:42
-
-
Save vahidhedayati/1df1597662065931b2083adfbdda0a54 to your computer and use it in GitHub Desktop.
compileStatic - config this way
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@CompileStatic | |
class QueuekitLists { | |
//// | |
/** | |
* Retrieve configuration value of reportPriorties | |
* this should be a list containing key value e.g: ReportName:Priority.HIGH | |
* | |
* Assign report priority back if not set to DEFAULT LOW | |
*/ | |
static Priority sortPriority(String reportName) { | |
Priority priority = Priority.LOW | |
Priority configProp =getConfigPriority(reportName) | |
if (configProp) { | |
priority = configProp | |
} | |
return priority | |
} | |
static Priority getConfigPriority(String reportName) { | |
return (getConfig('reportPriorities') as Map).find{k,v-> k==reportName}.value as Priority | |
} | |
static def getConfig(String configProperty) { | |
Holders.grailsApplication.config.queuekit[configProperty] ?: '' | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment