Type Params | Return Type | Name and description |
---|---|---|
|
java.lang.Object |
getOrSet(java.lang.String key, groovy.lang.Closure closure, java.lang.Boolean cacheNulls = false) Uses getOrSetMap method passing api.global as default map |
|
java.lang.Object |
getOrSet(java.lang.String key, java.util.List args, groovy.lang.Closure closure, java.lang.Boolean cacheNulls = false) Uses getOrSetMap method passing api.global as default map |
|
java.lang.Object |
getOrSetGlobalAndShared(java.lang.String key, groovy.lang.Closure closure, java.lang.Boolean cacheNulls = false) Cache objects in api.global and shared cache, run closure to fill |
|
java.lang.Object |
getOrSetGlobalAndShared(java.lang.String key, java.util.List args, groovy.lang.Closure closure, java.lang.Boolean cacheNulls = false) Cache objects in api.global and shared cache, run closure to fill |
|
java.lang.Object |
getOrSetMap(java.util.Map map, java.lang.String key, groovy.lang.Closure closure, java.lang.Boolean cacheNulls = false) Cache objects in provided map, run closure to fill |
|
java.lang.Object |
getOrSetMap(java.util.Map map, java.lang.String key, java.util.List args, groovy.lang.Closure closure, java.lang.Boolean cacheNulls = false) Cache objects in provided map, run closure to fill |
|
java.lang.Object |
getOrSetShared(java.lang.String key, groovy.lang.Closure closure, java.lang.Boolean cacheNulls = false) Cache objects in shared cache, run closure to fill |
|
java.lang.Object |
getOrSetShared(java.lang.String key, java.util.List args, groovy.lang.Closure closure, java.lang.Boolean cacheNulls = false) Cache objects in shared cache, run closure to fill |
|
java.lang.Object |
getOrSetShared(java.lang.Integer maxTTL, java.lang.String key, java.util.List args, groovy.lang.Closure closure) Same as getOrSetShared, but with an enforced Max TTL before refresh is forced Does not guarantee Minimum TTL, or removal from cache Ironically uses cache to store TTL. |
null |
static void |
main(java.lang.String[] args) Implicit main method for Groovy Scripts |
|
java.lang.Object |
tryDecodeJSON(java.lang.Object str) An unfortunate hack I couldn't make more elegant... |
Methods inherited from class | Name |
---|---|
class groovy.lang.Script |
groovy.lang.Script#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.Script#evaluate(java.lang.String), groovy.lang.Script#evaluate(java.io.File), groovy.lang.Script#getBinding(), groovy.lang.Script#setBinding(groovy.lang.Binding), groovy.lang.Script#println(), groovy.lang.Script#println(java.lang.Object), groovy.lang.Script#run(java.io.File, [Ljava.lang.String;), groovy.lang.Script#run(), groovy.lang.Script#setProperty(java.lang.String, java.lang.Object), groovy.lang.Script#getProperty(java.lang.String), groovy.lang.Script#print(java.lang.Object), groovy.lang.Script#printf(java.lang.String, java.lang.Object), groovy.lang.Script#printf(java.lang.String, [Ljava.lang.Object;), groovy.lang.Script#getMetaClass(), groovy.lang.Script#setMetaClass(groovy.lang.MetaClass), groovy.lang.Script#wait(long, int), groovy.lang.Script#wait(long), groovy.lang.Script#wait(), groovy.lang.Script#equals(java.lang.Object), groovy.lang.Script#toString(), groovy.lang.Script#hashCode(), groovy.lang.Script#getClass(), groovy.lang.Script#notify(), groovy.lang.Script#notifyAll() |
class groovy.lang.GroovyObjectSupport |
groovy.lang.GroovyObjectSupport#getMetaClass(), groovy.lang.GroovyObjectSupport#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#setMetaClass(groovy.lang.MetaClass), groovy.lang.GroovyObjectSupport#setProperty(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#getProperty(java.lang.String), groovy.lang.GroovyObjectSupport#wait(long, int), groovy.lang.GroovyObjectSupport#wait(long), groovy.lang.GroovyObjectSupport#wait(), groovy.lang.GroovyObjectSupport#equals(java.lang.Object), groovy.lang.GroovyObjectSupport#toString(), groovy.lang.GroovyObjectSupport#hashCode(), groovy.lang.GroovyObjectSupport#getClass(), groovy.lang.GroovyObjectSupport#notify(), groovy.lang.GroovyObjectSupport#notifyAll() |
Uses getOrSetMap method passing api.global as default map
key
- Dictionary key to this object in mapclosure
- Function to run to populate cache of nothing exists therecacheNulls
- Allow null-values to be cached, default false results in re-execution of closure each call if nullUses getOrSetMap method passing api.global as default map
key
- Dictionary key to this object in mapargs
- Array of inputs to give to closureclosure
- Function to run to populate cache of nothing exists therecacheNulls
- Allow null-values to be cached, default false results in re-execution of closure each call if nullCache objects in api.global and shared cache, run closure to fill
key
- Dictionary key to this object in cacheclosure
- Function to run to populate cache of nothing exists therecacheNulls
- Allow null-values to be cached, default false results in re-execution of closure each call if nullCache objects in api.global and shared cache, run closure to fill
key
- Dictionary key to this object in cacheargs
- Array of inputs to give to closureclosure
- Function to run to populate cache of nothing exists therecacheNulls
- Allow null-values to be cached, default false results in re-execution of closure each call if nullCache objects in provided map, run closure to fill
map
- The map to store objects inkey
- Dictionary key to this object in mapclosure
- Function to run to populate cache of nothing exists therecacheNulls
- Allow null-values to be cached, default false results in re-execution of closure each call if nullCache objects in provided map, run closure to fill
map
- The map to store objects inkey
- Dictionary key to this object in mapargs
- Array of inputs to give to closureclosure
- Function to run to populate cache of nothing exists therecacheNulls
- Allow null-values to be cached, default false results in re-execution of closure each call if nullCache objects in shared cache, run closure to fill
key
- Dictionary key to this object in cacheclosure
- Function to run to populate cache of nothing exists therecacheNulls
- Allow null-values to be cached, default false results in re-execution of closure each call if nullCache objects in shared cache, run closure to fill
key
- Dictionary key to this object in cacheargs
- Array of inputs to give to closureclosure
- Function to run to populate cache of nothing exists therecacheNulls
- Allow null-values to be cached, default false results in re-execution of closure each call if nullSame as getOrSetShared, but with an enforced Max TTL before refresh is forced Does not guarantee Minimum TTL, or removal from cache Ironically uses cache to store TTL.
maxTTL
- Max time in Seconds before object must renew in cache - or be left for deadkey
- Shared cache key to this objectargs
- Array of inputs to give to closureclosure
- Function to run to populate cache of nothing exists thereImplicit main method for Groovy Scripts
An unfortunate hack I couldn't make more elegant... Required by shared cache functions as everything must be stored as string. Takes in a string of json and parses either a map, list, or number. If first character not '[' or '{', or string input is not a number, function will just return what it was given.
str
- The string to attempt to parse from